# Severe Obstetric ComplicationsFHIR - eCQM QICore Content Implementation Guide v2023.0.0

* [**Table of Contents**](toc.md)
* [**Artifacts Summary**](artifacts.md)
* **Severe Obstetric ComplicationsFHIR**

## Measure: Severe Obstetric ComplicationsFHIR 

| | | |
| :--- | :--- | :--- |
| *Official URL*:http://ecqi.healthit.gov/ecqms/Measure/SevereObstetricComplicationsFHIR | *Version*:0.0.007 | |
| Draft as of 2023-08-08 | *Responsible:*[The Joint Commission](https://www.jointcommission.org/) | *Computable Name*:SevereObstetricComplicationsFHIR |
| *Other Identifiers:*Short Name (use: usual, ), UUID:6cf03fe2-b962-4f83-ac37-26d7477183c7 (use: official, ), UUID:2c92808482ead7c5018384daff512547 (use: official, ), Publisher (use: official, ) | | |
| **Usage:**Program: EH/CAH | | |
| **Copyright/Legal**: Measure specifications are in the Public Domain.LOINC(R) copyright 2004-2022 Regenstrief Institute, Inc. This material contains SNOMED Clinical Terms(R) (SNOMED CT[R]) copyright 2004-2022 International Health Terminology Standards Development Organisation. ICD-10 copyright 2022 World Health Organization. All Rights Reserved. | | |

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

 
UNKNOWN 

* **Logic Definitions:**: **Id: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````: SevereObstetricComplicationsFHIR
* **Logic Definitions:**: **Download cql: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````: [SevereObstetricComplicationsFHIR.cql](Library-SevereObstetricComplicationsFHIR.cql)
* **Logic Definitions:**: **Version: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````: 0.0.007
* **Logic Definitions:**: **Url: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````: [Severe Obstetric ComplicationsFHIR](Measure-SevereObstetricComplicationsFHIR.md)
* **Logic Definitions:**: ** short-name identifier: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  CMS1028FHIR 
* **Logic Definitions:**: ** version-independent identifier: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  urn:uuid:6cf03fe2-b962-4f83-ac37-26d7477183c7 
* **Logic Definitions:**: ** version-specific identifier: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  urn:uuid:2c92808482ead7c5018384daff512547 
* **Logic Definitions:**: ** publisher (CMS) identifier: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  1028FHIR 
* **Logic Definitions:**: **Effective Period: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````: 2024-01-01 ..2024-12-31
* **Logic Definitions:**: **Status: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````: draft
* **Logic Definitions:**: **Date: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````: 2023-08-08 18:35:06+0000
* **Logic Definitions:**: **Approval Date: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````: 2023-08-21
* **Logic Definitions:**: **Last Review Date: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````: 2023-08-21
* **Logic Definitions:**: **Name: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````: SevereObstetricComplicationsFHIR
* **Logic Definitions:**: **Publisher: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````: The Joint Commission
* **Logic Definitions:**: **Author: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````: The Joint Commission:[https://www.jointcommission.org/](https://www.jointcommission.org/), Centers for Medicare & Medicaid Services (CMS):[https://www.cms.gov/](https://www.cms.gov/), Yale New Haven Health Service Corporation/ Center for Outcomes Research and Evaluation:[https://medicine.yale.edu/core/](https://medicine.yale.edu/core/)
* **Logic Definitions:**: **Description: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````: Patients with severe obstetric complications which occur during the inpatient delivery hospitalization
* **Logic Definitions:**: **Purpose: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````: UNKNOWN
* **Logic Definitions:**: **Copyright: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````: Measure specifications are in the Public Domain.LOINC(R) copyright 2004-2022 Regenstrief Institute, Inc. This material contains SNOMED Clinical Terms(R) (SNOMED CT[R]) copyright 2004-2022 International Health Terminology Standards Development Organisation. ICD-10 copyright 2022 World Health Organization. All Rights Reserved.
* **Logic Definitions:**: **Disclaimer: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````: These performance measures are not clinical guidelines and do not establish a standard of medical care, and have not been tested for all potential applications. The measures and specifications are provided without warranty.
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable Lab and Physical Exam Results 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable Anemia 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable Asthma 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable Autoimmune Disease 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable Bariatric Surgery 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable Bleeding Disorder 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable Morbid Obesity 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable Cardiac Disease 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable Economic Housing Instability 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable Gastrointestinal Disease 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable Gestational Diabetes 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable HIV 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable Hypertension 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable Long Term Anticoagulant Use 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable Mental Health Disorder 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable Multiple Pregnancy 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable Neuromuscular 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable Obstetrical VTE 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable Placenta Previa 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable Placental Abruption 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable Placental Accreta Spectrum 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable Preexisting Diabetes 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable Previous Cesarean 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable Pulmonary Hypertension 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable Renal Disease 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable Severe Preeclampsia 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable Substance Abuse 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable Thyrotoxicosis 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable Other Preeclampsia 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable Preterm Birth 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable First Hematocrit Lab Test 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable First White Blood Cell Count Lab Test 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable Heart Rate 
* **Logic Definitions:**: **Risk Adjustment Factor: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````:  Risk Variable Systolic Blood Pressure 
* **Logic Definitions:**: **Rationale: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````: The United States (US) experiences higher rates of maternal morbidity and mortality than most other developed countries. These rates have continued to trend upward in recent decades (CDC, n.d.). Research indicates that the overall rate of severe maternal morbidity (SMM) increased by almost 200% between 1993 and 2014 to 144 per 10,000 delivery hospitalizations (CDC, n.d.), with more than 25,000 women per year experiencing obstetric complications (U.S. Department of Health and Human Services, 2020). Recent maternal mortality data from 2018 reveal that 658 women in the US died from maternal causes, resulting in a rate of 17.4 deaths per 100,000 live births, with 77% of the deaths attributed to direct obstetric causes like hemorrhage, preeclampsia, obstetric embolism, and other complications (Hoyert & Minino, 2018). 144 per 10,000 women hospitalized for delivery have experienced SMM, including hemorrhage, embolism, hypertension, stroke, and other serious complications (CDC,2020). Racial and ethnic disparities for Black women and Hispanic women are at a significantly higher risk for developing these complications than are Non-Hispanic White women (Leonard et al., 2019). Increasing rates of SMM are resulting in increased healthcare costs, longer hospitalization stays and impacts on a woman's health.There is limited national evaluation of hospitals' performance on maternal morbidity and mortality although SMM is widely used at the population level. SMM is linked to maternal mortality, varies significantly among hospitals, and has significant racial/ethnic and urban/rural disparities. SMM is a cost driver for both Medicaid and commercial plans. This measure is important as it will assist in the discovery and understanding of SMM patterns which can lead to improvements in the safety and quality of maternal care necessary to reduce SMM rates.
* **Logic Definitions:**: **Clinical recommendation statement: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````: Healthy People 2030 Measure (MICH-05): Reduce severe maternal complications identified during delivery hospitalizationsThe American College of Obstetricians and Gynecologists (the College) and the Society for Maternal-Fetal Medicine (SMFM) recommend identifying potential cases of severe maternal morbidity for further review, with a focus on outcomes and complications, and consider this an important step toward promoting safe obstetric care.
* **Logic Definitions:**: **Guidance (Usage): **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````: This measure allows for 3 approaches to determine gestational age (GA) in the following order of precedence: 1. The GA is calculated using the American College of Obstetricians and Gynecologists ReVITALize guidelines.* 2. The GA is obtained from a discrete field in the electronic health record. This option is only used when the calculated GA is not available. 3. The GA is based on ICD10 or SNOMED codes indicative of weeks gestation. This option is only used when results from items #1 and #2 (see above) are not available. Wherever gestational age is mentioned, relative to the delivery, the intent is to capture the last estimated gestational age prior to or at the time of delivery. *ACOG ReVITALize Guidelines for Calculating Gestational Age: Gestational Age = (280-(Estimated Due Date minus Reference Date))/7 --Estimated Due Date (EDD): The best obstetrical EDD is determined by last menstrual period if confirmed by early ultrasound or no ultrasound performed, or early ultrasound if no known last menstrual period or the ultrasound is not consistent with last menstrual period, or known date of fertilization (e.g., assisted reproductive technology) --Reference Date is the date on which you are trying to determine gestational age. For purposes of this eCQM, Reference Date would be the Date of Delivery. Note however the calculation may yield a non-whole number and gestational age should be rounded off to the nearest completed week. For example, an infant born on the 5th day of the 36th week (35 weeks and 5/7 days) is at a gestational age of 35 weeks, not 36 weeks. Definition: For this measure, specifications are modeled after the nationally available and adopted CDC definition for Severe Maternal Morbidity (SMM) with the addition of maternal mortality. At times, we may refer to the CDC indicators of morbidity as SMM, but the outcome of the measure, which includes morbidity and mortality, is referred to as Severe Obstetric Complications (SOC). This eCQM is an episode-based measure. An episode is defined as each inpatient hospitalization or encounter that ends during the measurement period. This FHIR-based measure has been derived from the QDM-based measure CMS1028v2. Please refer to the HL7 QI-Core Implementation Guide (http://hl7.org/fhir/us/qicore/index.html) for more information on QI-Core and mapping recommendations from QDM to QI-Core 4.1.1 (http://hl7.org/fhir/us/qicore/qdm-to-qicore.html).
* **Logic Definitions:**: ** Supplemental Data Guidance : **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````: Patient's Ethnicity: Hispanic or Latino Not Hispanic or Latino Patient's Payer: Categories of types of health care payer entities as defined by the US Public Health Data Consortium SOP code system Patient's Race: Native Hawaiian or Other Pacific Islander Asian American Indian or Alaska Native Other Race White Black or African American Patient's Sex: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories. This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "calculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition.
* **Logic Definitions:**: ** Risk Adjustment Variable Guidance : **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````: The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Lab and Physical Exam Results: Report the first resulted value 24 hours prior to start of encounter and before time of delivery in UCUM units specified: - Heart rate: {beats}/min - Systolic blood pressure: mm[Hg] - White blood cell count: 10*3/uL - Hematocrit: % The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data.
* **Logic Definitions:**: ** Supplemental Data Elements: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````: SDE Ethnicity SDE Payer SDE Race SDE Sex Variable Calculated Gestational Age
* **Logic Definitions:**: **Libraries: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````: 
| |
| :--- |
| [SevereObstetricComplicationsFHIR](Library-SevereObstetricComplicationsFHIR.md) |

* **Logic Definitions:**: **Related Artifact Dependencies: **
  * * **Group**: 638907ab4ba3d47c885c02fd
  * **Scoring**: **Group scoring:** proportion 

* **Library Name**: PCMaternal
  * **Name**: Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Encounter with Age Range": ["Encounter": "Encounter Inpatient"] EncounterInpatient where EncounterInpatient.status = 'finished' and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 ) and EncounterInpatient.period ends during day of "Measurement Period"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Delivery Encounter with Age Range
* **Library Name**: 
  * **Name**: ````define "Delivery Encounter with Age Range": "Encounter with Age Range" EncounterWithAge with ["Procedure": "Delivery Procedures"] DeliveryProcedure such that DeliveryProcedure.status = 'completed' and DeliveryProcedure.performed.toInterval ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) >= 20````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter where DeliveryEncounter.calculatedGestationalAge ( ) is null and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding": PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation" )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation": "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks" union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks" union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Systolic Blood Pressure
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg] define "Risk Variable Systolic Blood Pressure": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-bp"] BP where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and BP.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: BP.SystolicBP.value as Quantity, Timing: BP.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Asthma
* **Library Name**: 
  * **Name**: ````define "Risk Variable Asthma": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Substance Abuse
* **Library Name**: 
  * **Name**: ````define "Risk Variable Substance Abuse": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Accreta Spectrum
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Accreta Spectrum": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Neuromuscular
* **Library Name**: 
  * **Name**: ````define "Risk Variable Neuromuscular": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Renal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Renal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gastrointestinal Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gastrointestinal Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preterm Birth
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */ ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA in Interval[20, 36] or ( CGA is null and ( EGA >= 20 weeks and EGA <= 36 weeks ) ) ) union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter let CGA: DeliveryEncounter.calculatedGestationalAge ( ), EGA: DeliveryEncounter.lastEstimatedGestationalAge ( ) where CGA is null and EGA is null and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth" and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Pulmonary Hypertension
* **Library Name**: 
  * **Name**: ````define "Risk Variable Pulmonary Hypertension": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: PCMaternal
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic. "Delivery Encounter with Age Range" QualifyingEncounter let CGA: QualifyingEncounter.calculatedGestationalAge() // return { QualifyingEncounter, CGA } return { EncounterID: QualifyingEncounter.id, CalculatedCGA: CGA }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Variable Calculated Gestational Age
* **Library Name**: 
  * **Name**: ````define "Variable Calculated Gestational Age": //This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. PCMaternal."Variable Calculated Gestational Age"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Payer
* **Library Name**: 
  * **Name**: ````define "SDE Payer": SDE."SDE Payer"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Thyrotoxicosis
* **Library Name**: 
  * **Name**: ````define "Risk Variable Thyrotoxicosis": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Other Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Other Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Initial Population
* **Library Name**: 
  * **Name**: ````define "Initial Population": PCMaternal."Delivery Encounter with Age Range"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Economic Housing Instability
* **Library Name**: 
  * **Name**: ````define "Risk Variable Economic Housing Instability": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placental Abruption
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placental Abruption": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with COVID and Respiratory Condition or Procedure
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with COVID and Respiratory Condition or Procedure": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "COVID 19 Confirmed" ) and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19" ) or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator Exclusion
* **Library Name**: 
  * **Name**: ````define "Denominator Exclusion": "Delivery Encounters with COVID and Respiratory Condition or Procedure"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable HIV
* **Library Name**: 
  * **Name**: ````define "Risk Variable HIV": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Morbid Obesity
* **Library Name**: 
  * **Name**: ````define "Risk Variable Morbid Obesity": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Preexisting Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Preexisting Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Heart Rate
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min define "Risk Variable Heart Rate": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["observation-heartrate"] HeartRate where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and HeartRate.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: HeartRate.value as Quantity, Timing: HeartRate.effective.earliest() } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Mental Health Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Mental Health Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Obstetrical VTE
* **Library Name**: 
  * **Name**: ````define "Risk Variable Obstetrical VTE": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Autoimmune Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Autoimmune Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bariatric Surgery
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bariatric Surgery": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Previous Cesarean
* **Library Name**: 
  * **Name**: ````define "Risk Variable Previous Cesarean": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Race
* **Library Name**: 
  * **Name**: ````define "SDE Race": SDE."SDE Race"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Placenta Previa
* **Library Name**: 
  * **Name**: ````define "Risk Variable Placenta Previa": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": case when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' } when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' } else null end````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Sex
* **Library Name**: 
  * **Name**: ````define "SDE Sex": SDE."SDE Sex"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Gestational Diabetes
* **Library Name**: 
  * **Name**: ````define "Risk Variable Gestational Diabetes": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses" and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine" ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N') or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures where EncounterProcedures.status = 'completed' and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Expiration
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Expiration": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Blood Transfusion
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Blood Transfusion": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter with ["Procedure": "Blood Transfusion"] BloodTransfusion such that BloodTransfusion.status = 'completed' and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration" union "Delivery Encounters with Blood Transfusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Numerator
* **Library Name**: 
  * **Name**: ````define "Numerator": "Delivery Encounters with Severe Obstetric Complications"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratification Encounter
* **Library Name**: 
  * **Name**: ````define "Stratification Encounter": "Numerator" except "Denominator Exclusion"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
* **Library Name**: 
  * **Name**: ````define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions": "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion" union "Delivery Encounters with Expiration"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Stratum 1
* **Library Name**: 
  * **Name**: ````define "Stratum 1": //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication. "Stratification Encounter" intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Bleeding Disorder
* **Library Name**: 
  * **Name**: ````define "Risk Variable Bleeding Disorder": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Multiple Pregnancy
* **Library Name**: 
  * **Name**: ````define "Risk Variable Multiple Pregnancy": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First White Blood Cell Count Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL define "Risk Variable First White Blood Cell Count Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and WBC.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: WBC.value as Quantity, Timing: WBC.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Denominator
* **Library Name**: 
  * **Name**: ````define "Denominator": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable First Hematocrit Lab Test
* **Library Name**: 
  * **Name**: ````//First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as % define "Risk Variable First Hematocrit Lab Test": First(from "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter, ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery()) and Hematocrit.status in { 'final', 'amended', 'corrected' } return { EncounterId: Encounter.id, FirstResult: Hematocrit.value as Quantity, Timing: Hematocrit.issued } sort by Timing )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SupplementalDataElements
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: SDE Ethnicity
* **Library Name**: 
  * **Name**: ````define "SDE Ethnicity": SDE."SDE Ethnicity"````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Anemia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Anemia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Severe Preeclampsia
* **Library Name**: 
  * **Name**: ````define "Risk Variable Severe Preeclampsia": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Cardiac Disease
* **Library Name**: 
  * **Name**: ````define "Risk Variable Cardiac Disease": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````
* **Library Name**: **Library Name**
  * **Name**: **Name**
* **Library Name**: SevereObstetricComplicationsFHIR
  * **Name**: Risk Variable Long Term Anticoagulant Use
* **Library Name**: 
  * **Name**: ````define "Risk Variable Long Term Anticoagulant Use": "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use" and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" ) )````: * `Library/PCMaternal|5.10.000`
* `Library/FHIRHelpers|4.3.000`
* `Library/QICoreCommon|1.5.000`
* `Library/CQMCommon|1.4.000`
* `Library/QICoreCommon|1.5.000`
* `Library/FHIRHelpers|4.3.000`
* `Library/QICoreCommon|1.5.000`
* `Library/SupplementalDataElements|3.4.000`
* `Library/FHIRHelpers|4.3.000`
* [LOINC](http://tx.fhir.org/r4/ValueSet/x-loinc2.82)
* [Encounter Inpatient](https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.666.5.307/expansion)
* [Delivery Procedures](https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1045.59/expansion)
* [Observation Services](https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1111.143/expansion)
* [ED Visit and OB Triage](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.369-20210611)
* [Estimated Gestational Age at Delivery](https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1045.26/expansion)
* [20 to 42 Plus Weeks Gestation](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1110.67-20230217)
* [Asthma](https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.117.1.7.1.271/expansion)
* [Present On Admission is Yes or Exempt](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1110.63-20220127)
* [Substance Abuse](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.320-20220127)
* [Placenta Accreta](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.302-20220127)
* [Neuromuscular Disease](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.308-20220127)
* [Renal Disease](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.335-20220127)
* [Gastrointestinal Disease](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.338-20220127)
* [Hypertension](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.332-20220127)
* [Preterm Birth](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.299-20220127)
* [Pulmonary Hypertension](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.281-20220127)
* [Payer](https://vsac.nlm.nih.gov/valueset/2.16.840.1.114222.4.11.3591/expansion)
* [Thyrotoxicosis](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.296-20220127)
* [Mild or Moderate Preeclampsia](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.329-20220127)
* [Economic Housing Instability](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.292-20220127)
* [Placental Abruption](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.305-20220127)
* [COVID 19 Confirmed](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.373-20220127)
* [Respiratory Conditions Related to COVID 19](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.376-20220127)
* [Respiratory Support Procedures Related to COVID 19](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.379-20220127)
* [HIV in Pregnancy Childbirth and Puerperium](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.272-20220127)
* [Morbid or Severe Obesity](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.290-20220127)
* [Preexisting Diabetes](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.275-20220127)
* [Mental Health Disorder](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.314-20220127)
* [Venous Thromboembolism in Pregnancy](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.363-20220127)
* [Autoimmune Disease](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.311-20220127)
* [Bariatric Surgery](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.317-20220127)
* [Previous Cesarean](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.278-20220316)
* [Placenta Previa](https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1110.35/expansion)
* [Gestational Diabetes](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.269-20220127)
* [Severe Maternal Morbidity Diagnoses](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.255-20220127)
* [Present on Admission is No or Unable To Determine](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.370-20220127)
* [Severe Maternal Morbidity Procedures](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.256-20230218)
* [Patient Expired](https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.117.1.7.1.309/expansion)
* [Blood Transfusion](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.213-20220127)
* [Bleeding Disorder](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.287-20220127)
* [Multiple Pregnancy](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.284-20220127)
* [White blood cells count lab test](https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1045.129/expansion)
* [Hematocrit lab test](https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1045.114/expansion)
* [Anemia](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.323-20220127)
* [Severe Preeclampsia](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.327-20220127)
* [Cardiac Disease](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.341-20220127)
* [Long Term Anticoagulant Use](https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1029.366-20220127)




## Resource Content

```json
{
  "resourceType" : "Measure",
  "id" : "SevereObstetricComplicationsFHIR",
  "meta" : {
    "profile" : ["http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/computable-measure-cqfm",
    "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/publishable-measure-cqfm",
    "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/executable-measure-cqfm"]
  },
  "contained" : [{
    "resourceType" : "Library",
    "id" : "effective-data-requirements",
    "extension" : [{
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-directReferenceCode",
      "valueCoding" : {
        "system" : "http://loinc.org",
        "code" : "93857-1",
        "display" : "Date and time of obstetric delivery"
      }
    },
    {
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-directReferenceCode",
      "valueCoding" : {
        "system" : "http://loinc.org",
        "code" : "11778-8",
        "display" : "Delivery date Estimated"
      }
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "PCMaternal"
      },
      {
        "url" : "name",
        "valueString" : "Encounter with Age Range"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Encounter with Age Range\":\n  [\"Encounter\": \"Encounter Inpatient\"] EncounterInpatient\n                      where EncounterInpatient.status = 'finished'\n                        and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 )\n                        and EncounterInpatient.period ends during day of \"Measurement Period\""
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 0
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "PCMaternal"
      },
      {
        "url" : "name",
        "valueString" : "Delivery Encounter with Age Range"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Delivery Encounter with Age Range\":\n  \"Encounter with Age Range\" EncounterWithAge\n                with [\"Procedure\": \"Delivery Procedures\"] DeliveryProcedure\n                such that DeliveryProcedure.status = 'completed'\n                and DeliveryProcedure.performed.toInterval  ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 1
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks\":\n  PCMaternal.\"Delivery Encounter with Age Range\" DeliveryEncounter\n    where DeliveryEncounter.calculatedGestationalAge ( ) >= 20"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 2
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks\":\n  PCMaternal.\"Delivery Encounter with Age Range\" DeliveryEncounter\n    where DeliveryEncounter.calculatedGestationalAge ( ) is null\n      and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 3
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding\":\n  PCMaternal.\"Delivery Encounter with Age Range\" DeliveryEncounter\n    let CGA: DeliveryEncounter.calculatedGestationalAge ( ),\n    EGA: DeliveryEncounter.lastEstimatedGestationalAge ( )\n    where CGA is null\n      and EGA is null\n      and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis\n          where EncounterDiagnosis.code in \"20 to 42 Plus Weeks Gestation\"\n      )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 4
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\":\n  \"Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks\"\n    union \"Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks\"\n    union \"Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding\""
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 5
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable Systolic Blood Pressure"
      },
      {
        "url" : "statement",
        "valueString" : "//First resulted value 24 hours prior to start of encounter and before time of delivery\n //Report systolic blood pressure as mm[Hg]\n\n\n\ndefine \"Risk Variable Systolic Blood Pressure\":\n  First(from\n      \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" Encounter,\n      [\"observation-bp\"] BP\n      where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery())\n        and BP.status in { 'final', 'amended', 'corrected' }\n      return {\n        EncounterId: Encounter.id,\n        FirstResult: BP.SystolicBP.value as Quantity,\n        Timing: BP.effective.earliest()\n      }\n      sort by Timing\n  )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 6
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable Asthma"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Risk Variable Asthma\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses\n        where EncounterDiagnoses.condition.getCondition ( ).code in \"Acute or Persistent Asthma\"\n          and ( EncounterDiagnoses.diagnosisPresentOnAdmission in \"Present On Admission is Yes or Exempt\" )\n    )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 7
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable Substance Abuse"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Risk Variable Substance Abuse\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses\n        where EncounterDiagnoses.condition.getCondition ( ).code in \"Substance Abuse\"\n          and ( EncounterDiagnoses.diagnosisPresentOnAdmission in \"Present On Admission is Yes or Exempt\" )\n    )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 8
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable Placental Accreta Spectrum"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Risk Variable Placental Accreta Spectrum\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses\n        where EncounterDiagnoses.condition.getCondition ( ).code in \"Placental Accreta Spectrum\"\n          and ( EncounterDiagnoses.diagnosisPresentOnAdmission in \"Present On Admission is Yes or Exempt\" )\n    )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 9
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable Neuromuscular"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Risk Variable Neuromuscular\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses\n        where EncounterDiagnoses.condition.getCondition ( ).code in \"Neuromuscular Disease\"\n          and ( EncounterDiagnoses.diagnosisPresentOnAdmission in \"Present On Admission is Yes or Exempt\" )\n    )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 10
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable Renal Disease"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Risk Variable Renal Disease\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses\n        where EncounterDiagnoses.condition.getCondition ( ).code in \"Renal Disease\"\n          and ( EncounterDiagnoses.diagnosisPresentOnAdmission in \"Present On Admission is Yes or Exempt\" )\n    )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 11
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable Gastrointestinal Disease"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Risk Variable Gastrointestinal Disease\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses\n        where EncounterDiagnoses.condition.getCondition ( ).code in \"Gastrointestinal Disease\"\n          and ( EncounterDiagnoses.diagnosisPresentOnAdmission in \"Present On Admission is Yes or Exempt\" )\n    )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 12
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable Hypertension"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Risk Variable Hypertension\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses\n        where EncounterDiagnoses.condition.getCondition ( ).code in \"Hypertension\"\n          and ( EncounterDiagnoses.diagnosisPresentOnAdmission in \"Present On Admission is Yes or Exempt\" )\n    )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 13
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable Preterm Birth"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Risk Variable Preterm Birth\":\n/*  CGA = Calculated Gestational Age.  EGA = Estimated Gestational Age. */\n  \n  ( PCMaternal.\"Delivery Encounter with Age Range\" DeliveryEncounter\n      let CGA: DeliveryEncounter.calculatedGestationalAge ( ),\n      EGA: DeliveryEncounter.lastEstimatedGestationalAge ( )\n      where CGA in Interval[20, 36]\n        or ( CGA is null\n            and ( EGA >= 20 weeks\n                and EGA <= 36 weeks\n            )\n        )\n  )\n    union ( PCMaternal.\"Delivery Encounter with Age Range\" DeliveryEncounter\n        let CGA: DeliveryEncounter.calculatedGestationalAge ( ),\n        EGA: DeliveryEncounter.lastEstimatedGestationalAge ( )\n        where CGA is null\n          and EGA is null\n          and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses\n              where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in \"Preterm Birth\"\n                and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in \"Present On Admission is Yes or Exempt\" )\n          )\n    )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 14
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable Pulmonary Hypertension"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Risk Variable Pulmonary Hypertension\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses\n        where EncounterDiagnoses.condition.getCondition ( ).code in \"Pulmonary Hypertension\"\n          and ( EncounterDiagnoses.diagnosisPresentOnAdmission in \"Present On Admission is Yes or Exempt\" )\n    )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 15
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "PCMaternal"
      },
      {
        "url" : "name",
        "valueString" : "Variable Calculated Gestational Age"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Variable Calculated Gestational Age\":\n  //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic.\n  \"Delivery Encounter with Age Range\" QualifyingEncounter\n    let CGA: QualifyingEncounter.calculatedGestationalAge()\n  //  return { QualifyingEncounter, CGA }\n    return {\n      EncounterID: QualifyingEncounter.id,\n      CalculatedCGA: CGA\n    }"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 16
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Variable Calculated Gestational Age"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Variable Calculated Gestational Age\":\n  //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. \n  \n  PCMaternal.\"Variable Calculated Gestational Age\""
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 17
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SupplementalDataElements"
      },
      {
        "url" : "name",
        "valueString" : "SDE Payer"
      },
      {
        "url" : "statement",
        "valueString" : "define \"SDE Payer\":\n  [Coverage: type in \"Payer Type\"] Payer\n    return {\n      code: Payer.type,\n      period: Payer.period\n    }"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 18
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "SDE Payer"
      },
      {
        "url" : "statement",
        "valueString" : "define \"SDE Payer\":\n  SDE.\"SDE Payer\""
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 19
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable Thyrotoxicosis"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Risk Variable Thyrotoxicosis\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses\n        where EncounterDiagnoses.condition.getCondition ( ).code in \"Thyrotoxicosis\"\n          and ( EncounterDiagnoses.diagnosisPresentOnAdmission in \"Present On Admission is Yes or Exempt\" )\n    )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 20
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable Other Preeclampsia"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Risk Variable Other Preeclampsia\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses\n        where EncounterDiagnoses.condition.getCondition ( ).code in \"Mild or Moderate Preeclampsia\"\n          and ( EncounterDiagnoses.diagnosisPresentOnAdmission in \"Present On Admission is Yes or Exempt\" )\n    )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 21
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Initial Population"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Initial Population\":\n  PCMaternal.\"Delivery Encounter with Age Range\""
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 22
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable Economic Housing Instability"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Risk Variable Economic Housing Instability\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses\n        where EncounterDiagnoses.condition.getCondition ( ).code in \"Economic Housing Instability\"\n          and ( EncounterDiagnoses.diagnosisPresentOnAdmission in \"Present On Admission is Yes or Exempt\" )\n    )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 23
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable Placental Abruption"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Risk Variable Placental Abruption\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses\n        where EncounterDiagnoses.condition.getCondition ( ).code in \"Placental Abruption\"\n          and ( EncounterDiagnoses.diagnosisPresentOnAdmission in \"Present On Admission is Yes or Exempt\" )\n    )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 24
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Delivery Encounters with COVID and Respiratory Condition or Procedure"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Delivery Encounters with COVID and Respiratory Condition or Procedure\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis\n        where EncounterDiagnosis.code in \"COVID 19 Confirmed\"\n    )\n      and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis\n            where EncounterDiagnosis.code in \"Respiratory Conditions Related to COVID 19\"\n        )\n          or exists ( [\"Procedure\": \"Respiratory Support Procedures Related to COVID 19\"] EncounterProcedures\n              where EncounterProcedures.status = 'completed'\n                and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )\n          )\n      )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 25
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Denominator Exclusion"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Denominator Exclusion\":\n  \"Delivery Encounters with COVID and Respiratory Condition or Procedure\""
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 26
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable HIV"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Risk Variable HIV\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses\n        where EncounterDiagnoses.condition.getCondition ( ).code in \"HIV in Pregnancy Childbirth and Puerperium\"\n          and ( EncounterDiagnoses.diagnosisPresentOnAdmission in \"Present On Admission is Yes or Exempt\" )\n    )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 27
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable Morbid Obesity"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Risk Variable Morbid Obesity\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses\n        where EncounterDiagnoses.condition.getCondition ( ).code in \"Morbid or Severe Obesity\"\n          and ( EncounterDiagnoses.diagnosisPresentOnAdmission in \"Present On Admission is Yes or Exempt\" )\n    )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 28
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable Preexisting Diabetes"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Risk Variable Preexisting Diabetes\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses\n        where EncounterDiagnoses.condition.getCondition ( ).code in \"Preexisting Diabetes\"\n          and ( EncounterDiagnoses.diagnosisPresentOnAdmission in \"Present On Admission is Yes or Exempt\" )\n    )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 29
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable Heart Rate"
      },
      {
        "url" : "statement",
        "valueString" : "//First resulted value 24 hours prior to start of encounter and before time of delivery\n //Report heart rate as beats/min\n\n\n\ndefine \"Risk Variable Heart Rate\":\n  First(from\n      \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" Encounter,\n      [\"observation-heartrate\"] HeartRate\n      where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery())\n        and HeartRate.status in { 'final', 'amended', 'corrected' }\n      return {\n        EncounterId: Encounter.id,\n        FirstResult: HeartRate.value as Quantity,\n        Timing: HeartRate.effective.earliest()\n      }\n      sort by Timing\n  )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 30
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable Mental Health Disorder"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Risk Variable Mental Health Disorder\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses\n        where EncounterDiagnoses.condition.getCondition ( ).code in \"Mental Health Disorder\"\n          and ( EncounterDiagnoses.diagnosisPresentOnAdmission in \"Present On Admission is Yes or Exempt\" )\n    )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 31
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable Obstetrical VTE"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Risk Variable Obstetrical VTE\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses\n        where EncounterDiagnoses.condition.getCondition ( ).code in \"Venous Thromboembolism in Pregnancy\"\n          and ( EncounterDiagnoses.diagnosisPresentOnAdmission in \"Present On Admission is Yes or Exempt\" )\n    )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 32
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable Autoimmune Disease"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Risk Variable Autoimmune Disease\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses\n        where EncounterDiagnoses.condition.getCondition ( ).code in \"Autoimmune Disease\"\n          and ( EncounterDiagnoses.diagnosisPresentOnAdmission in \"Present On Admission is Yes or Exempt\" )\n    )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 33
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable Bariatric Surgery"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Risk Variable Bariatric Surgery\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses\n        where EncounterDiagnoses.condition.getCondition ( ).code in \"Bariatric Surgery\"\n          and ( EncounterDiagnoses.diagnosisPresentOnAdmission in \"Present On Admission is Yes or Exempt\" )\n    )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 34
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable Previous Cesarean"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Risk Variable Previous Cesarean\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses\n        where EncounterDiagnoses.condition.getCondition ( ).code in \"Previous Cesarean\"\n          and ( EncounterDiagnoses.diagnosisPresentOnAdmission in \"Present On Admission is Yes or Exempt\" )\n    )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 35
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SupplementalDataElements"
      },
      {
        "url" : "name",
        "valueString" : "SDE Race"
      },
      {
        "url" : "statement",
        "valueString" : "define \"SDE Race\":\n  Patient.race R\n    return Tuple {\n      codes: R.ombCategory union R.detailed,\n      display: R.text\n    }"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 36
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "SDE Race"
      },
      {
        "url" : "statement",
        "valueString" : "define \"SDE Race\":\n  SDE.\"SDE Race\""
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 37
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable Placenta Previa"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Risk Variable Placenta Previa\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses\n        where EncounterDiagnoses.condition.getCondition ( ).code in \"Placenta Previa\"\n          and ( EncounterDiagnoses.diagnosisPresentOnAdmission in \"Present On Admission is Yes or Exempt\" )\n    )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 38
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SupplementalDataElements"
      },
      {
        "url" : "name",
        "valueString" : "SDE Sex"
      },
      {
        "url" : "statement",
        "valueString" : "define \"SDE Sex\":\n  case\n      when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' }\n      when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' }\n      else null\n    end"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 39
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "SDE Sex"
      },
      {
        "url" : "statement",
        "valueString" : "define \"SDE Sex\":\n  SDE.\"SDE Sex\""
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 40
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable Gestational Diabetes"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Risk Variable Gestational Diabetes\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses\n        where EncounterDiagnoses.condition.getCondition ( ).code in \"Gestational Diabetes\"\n          and ( EncounterDiagnoses.diagnosisPresentOnAdmission in \"Present On Admission is Yes or Exempt\" )\n    )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 41
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses\n        where EncounterDiagnoses.condition.getCondition ( ).code in \"Severe Maternal Morbidity Diagnoses\"\n          and EncounterDiagnoses.diagnosisPresentOnAdmission in \"Present on Admission is No or Unable To Determine\"\n    )\n//EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N')\n      \n      or exists ( [\"Procedure\": \"Severe Maternal Morbidity Procedures\"] EncounterProcedures\n          where EncounterProcedures.status = 'completed'\n            and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )\n      )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 42
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Delivery Encounters with Expiration"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Delivery Encounters with Expiration\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in \"Patient Expired\""
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 43
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Delivery Encounters with Blood Transfusion"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Delivery Encounters with Blood Transfusion\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    with [\"Procedure\": \"Blood Transfusion\"] BloodTransfusion\n      such that BloodTransfusion.status = 'completed'\n        and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 44
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Delivery Encounters with Severe Obstetric Complications"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Delivery Encounters with Severe Obstetric Complications\":\n  \"Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion\"\n    union \"Delivery Encounters with Expiration\"\n    union \"Delivery Encounters with Blood Transfusion\""
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 45
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Numerator"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Numerator\":\n  \"Delivery Encounters with Severe Obstetric Complications\""
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 46
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Stratification Encounter"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Stratification Encounter\":\n  \"Numerator\"\n    except \"Denominator Exclusion\""
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 47
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions\":\n  \"Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion\"\n    union \"Delivery Encounters with Expiration\""
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 48
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Stratum 1"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Stratum 1\":\n  //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication.\n  \n  \"Stratification Encounter\"\n    intersect \"Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions\""
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 49
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable Bleeding Disorder"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Risk Variable Bleeding Disorder\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses\n        where EncounterDiagnoses.condition.getCondition ( ).code in \"Bleeding Disorder\"\n          and ( EncounterDiagnoses.diagnosisPresentOnAdmission in \"Present On Admission is Yes or Exempt\" )\n    )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 50
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable Multiple Pregnancy"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Risk Variable Multiple Pregnancy\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses\n        where EncounterDiagnoses.condition.getCondition ( ).code in \"Multiple Pregnancy\"\n          and ( EncounterDiagnoses.diagnosisPresentOnAdmission in \"Present On Admission is Yes or Exempt\" )\n    )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 51
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable First White Blood Cell Count Lab Test"
      },
      {
        "url" : "statement",
        "valueString" : "//First resulted value 24 hours prior to start of encounter and before time of delivery\n //Report white blood cell count as 10*3/uL\n\n\n\ndefine \"Risk Variable First White Blood Cell Count Lab Test\":\n  First(from\n      \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" Encounter,\n      [\"USCoreLaboratoryResultObservationProfile\": \"White blood cells count lab test\"] WBC\n      where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery())\n        and WBC.status in { 'final', 'amended', 'corrected' }\n      return {\n        EncounterId: Encounter.id,\n        FirstResult: WBC.value as Quantity,\n        Timing: WBC.issued\n      }\n      sort by Timing\n  )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 52
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Denominator"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Denominator\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\""
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 53
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable First Hematocrit Lab Test"
      },
      {
        "url" : "statement",
        "valueString" : "//First resulted value 24 hours prior to start of encounter and before time of delivery\n //Report hematocrit as %\n\n\n\ndefine \"Risk Variable First Hematocrit Lab Test\":\n  First(from\n      \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" Encounter,\n      [\"USCoreLaboratoryResultObservationProfile\": \"Hematocrit lab test\"] Hematocrit\n      where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery())\n        and Hematocrit.status in { 'final', 'amended', 'corrected' }\n      return {\n        EncounterId: Encounter.id,\n        FirstResult: Hematocrit.value as Quantity,\n        Timing: Hematocrit.issued\n      }\n      sort by Timing\n  )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 54
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SupplementalDataElements"
      },
      {
        "url" : "name",
        "valueString" : "SDE Ethnicity"
      },
      {
        "url" : "statement",
        "valueString" : "define \"SDE Ethnicity\":\n  Patient.ethnicity E\n    return Tuple {\n      codes: { E.ombCategory } union E.detailed,\n      display: E.text\n    }"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 55
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "SDE Ethnicity"
      },
      {
        "url" : "statement",
        "valueString" : "define \"SDE Ethnicity\":\n  SDE.\"SDE Ethnicity\""
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 56
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable Anemia"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Risk Variable Anemia\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses\n        where EncounterDiagnoses.condition.getCondition ( ).code in \"Anemia\"\n          and ( EncounterDiagnoses.diagnosisPresentOnAdmission in \"Present On Admission is Yes or Exempt\" )\n    )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 57
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable Severe Preeclampsia"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Risk Variable Severe Preeclampsia\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses\n        where EncounterDiagnoses.condition.getCondition ( ).code in \"Severe Preeclampsia\"\n          and ( EncounterDiagnoses.diagnosisPresentOnAdmission in \"Present On Admission is Yes or Exempt\" )\n    )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 58
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable Cardiac Disease"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Risk Variable Cardiac Disease\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses\n        where EncounterDiagnoses.condition.getCondition ( ).code in \"Cardiac Disease\"\n          and ( EncounterDiagnoses.diagnosisPresentOnAdmission in \"Present On Admission is Yes or Exempt\" )\n    )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 59
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    },
    {
      "extension" : [{
        "url" : "libraryName",
        "valueString" : "SevereObstetricComplicationsFHIR"
      },
      {
        "url" : "name",
        "valueString" : "Risk Variable Long Term Anticoagulant Use"
      },
      {
        "url" : "statement",
        "valueString" : "define \"Risk Variable Long Term Anticoagulant Use\":\n  \"Delivery Encounters At Greater than or Equal to 20 Weeks Gestation\" TwentyWeeksPlusEncounter\n    where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses\n        where EncounterDiagnoses.condition.getCondition ( ).code in \"Long Term Anticoagulant Use\"\n          and ( EncounterDiagnoses.diagnosisPresentOnAdmission in \"Present On Admission is Yes or Exempt\" )\n    )"
      },
      {
        "url" : "displaySequence",
        "valueInteger" : 60
      }],
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
    }],
    "status" : "active",
    "type" : {
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/library-type",
        "code" : "module-definition"
      }]
    },
    "relatedArtifact" : [{
      "type" : "depends-on",
      "display" : "Library PCMaternal",
      "resource" : "Library/PCMaternal|5.10.000"
    },
    {
      "type" : "depends-on",
      "display" : "Library FHIRHelpers",
      "resource" : "Library/FHIRHelpers|4.3.000"
    },
    {
      "type" : "depends-on",
      "display" : "Library QICoreCommon",
      "resource" : "Library/QICoreCommon|1.5.000"
    },
    {
      "type" : "depends-on",
      "display" : "Library CQMCommon",
      "resource" : "Library/CQMCommon|1.4.000"
    },
    {
      "type" : "depends-on",
      "display" : "Library QICoreCommon",
      "resource" : "Library/QICoreCommon|1.5.000"
    },
    {
      "type" : "depends-on",
      "display" : "Library FHIRHelpers",
      "resource" : "Library/FHIRHelpers|4.3.000"
    },
    {
      "type" : "depends-on",
      "display" : "Library QICoreCommon",
      "resource" : "Library/QICoreCommon|1.5.000"
    },
    {
      "type" : "depends-on",
      "display" : "Library SDE",
      "resource" : "Library/SupplementalDataElements|3.4.000"
    },
    {
      "type" : "depends-on",
      "display" : "Library FHIRHelpers",
      "resource" : "Library/FHIRHelpers|4.3.000"
    },
    {
      "type" : "depends-on",
      "display" : "Code system LOINC",
      "resource" : "http://loinc.org"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Encounter Inpatient",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Delivery Procedures",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.59"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Observation Services",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143"
    },
    {
      "type" : "depends-on",
      "display" : "Value set ED Visit and OB Triage",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.369"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Estimated Gestational Age at Delivery",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.26"
    },
    {
      "type" : "depends-on",
      "display" : "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"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Acute or Persistent Asthma",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.271"
    },
    {
      "type" : "depends-on",
      "display" : "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"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Substance Abuse",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.320"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Placental Accreta Spectrum",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.302"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Neuromuscular Disease",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.308"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Renal Disease",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.335"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Gastrointestinal Disease",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.338"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Hypertension",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.332"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Preterm Birth",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.299"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Pulmonary Hypertension",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.281"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Payer Type",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Thyrotoxicosis",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.296"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Mild or Moderate Preeclampsia",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.329"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Economic Housing Instability",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.292"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Placental Abruption",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.305"
    },
    {
      "type" : "depends-on",
      "display" : "Value set COVID 19 Confirmed",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.373"
    },
    {
      "type" : "depends-on",
      "display" : "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"
    },
    {
      "type" : "depends-on",
      "display" : "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"
    },
    {
      "type" : "depends-on",
      "display" : "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"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Morbid or Severe Obesity",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.290"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Preexisting Diabetes",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.275"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Mental Health Disorder",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.314"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Venous Thromboembolism in Pregnancy",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.363"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Autoimmune Disease",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.311"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Bariatric Surgery",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.317"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Previous Cesarean",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.278"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Placenta Previa",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.35"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Gestational Diabetes",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.269"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Severe Maternal Morbidity Diagnoses",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.255"
    },
    {
      "type" : "depends-on",
      "display" : "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"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Severe Maternal Morbidity Procedures",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.256"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Patient Expired",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.309"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Blood Transfusion",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.213"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Bleeding Disorder",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.287"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Multiple Pregnancy",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.284"
    },
    {
      "type" : "depends-on",
      "display" : "Value set White blood cells count lab test",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.129"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Hematocrit lab test",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.114"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Anemia",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.323"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Severe Preeclampsia",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.327"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Cardiac Disease",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.341"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Long Term Anticoagulant Use",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.366"
    }],
    "parameter" : [{
      "name" : "Measurement Period",
      "use" : "in",
      "min" : 0,
      "max" : "1",
      "type" : "Period"
    },
    {
      "name" : "Risk Variable Systolic Blood Pressure",
      "use" : "out",
      "min" : 0,
      "max" : "1",
      "type" : "Resource"
    },
    {
      "name" : "Risk Variable Asthma",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Risk Variable Substance Abuse",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Risk Variable Placental Accreta Spectrum",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Risk Variable Neuromuscular",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Risk Variable Renal Disease",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Risk Variable Gastrointestinal Disease",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Risk Variable Hypertension",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Risk Variable Preterm Birth",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Risk Variable Pulmonary Hypertension",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Variable Calculated Gestational Age",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "SDE Payer",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Risk Variable Thyrotoxicosis",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Risk Variable Other Preeclampsia",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Initial Population",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Risk Variable Economic Housing Instability",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Risk Variable Placental Abruption",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Denominator Exclusion",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Risk Variable HIV",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Risk Variable Morbid Obesity",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Risk Variable Preexisting Diabetes",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Risk Variable Heart Rate",
      "use" : "out",
      "min" : 0,
      "max" : "1",
      "type" : "Resource"
    },
    {
      "name" : "Risk Variable Mental Health Disorder",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Risk Variable Obstetrical VTE",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Risk Variable Autoimmune Disease",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Risk Variable Bariatric Surgery",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Risk Variable Previous Cesarean",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "SDE Race",
      "use" : "out",
      "min" : 0,
      "max" : "1",
      "type" : "Resource"
    },
    {
      "name" : "Risk Variable Placenta Previa",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "SDE Sex",
      "use" : "out",
      "min" : 0,
      "max" : "1",
      "type" : "Coding"
    },
    {
      "name" : "Risk Variable Gestational Diabetes",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Numerator",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Stratum 1",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Risk Variable Bleeding Disorder",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Risk Variable Multiple Pregnancy",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Risk Variable First White Blood Cell Count Lab Test",
      "use" : "out",
      "min" : 0,
      "max" : "1",
      "type" : "Resource"
    },
    {
      "name" : "Denominator",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Risk Variable First Hematocrit Lab Test",
      "use" : "out",
      "min" : 0,
      "max" : "1",
      "type" : "Resource"
    },
    {
      "name" : "SDE Ethnicity",
      "use" : "out",
      "min" : 0,
      "max" : "1",
      "type" : "Resource"
    },
    {
      "name" : "Risk Variable Anemia",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Risk Variable Severe Preeclampsia",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Risk Variable Cardiac Disease",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    },
    {
      "name" : "Risk Variable Long Term Anticoagulant Use",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Resource"
    }],
    "dataRequirement" : [{
      "type" : "Patient",
      "profile" : ["http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient"]
    },
    {
      "type" : "Encounter",
      "profile" : ["http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter"],
      "mustSupport" : ["type", "status", "status.value", "period"],
      "codeFilter" : [{
        "path" : "type",
        "valueSet" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307"
      }]
    },
    {
      "type" : "Encounter",
      "profile" : ["http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter"],
      "mustSupport" : ["type", "period", "status", "status.value"],
      "codeFilter" : [{
        "path" : "type",
        "valueSet" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143"
      }]
    },
    {
      "type" : "Encounter",
      "profile" : ["http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter"],
      "mustSupport" : ["type", "period", "status", "status.value"],
      "codeFilter" : [{
        "path" : "type",
        "valueSet" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.369"
      }]
    },
    {
      "type" : "Encounter",
      "profile" : ["http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter"],
      "mustSupport" : ["type", "period", "status", "status.value"],
      "codeFilter" : [{
        "path" : "type",
        "valueSet" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143"
      }]
    },
    {
      "type" : "Encounter",
      "profile" : ["http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter"],
      "mustSupport" : ["type", "period", "status", "status.value"],
      "codeFilter" : [{
        "path" : "type",
        "valueSet" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.369"
      }]
    },
    {
      "type" : "Procedure",
      "profile" : ["http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure"],
      "mustSupport" : ["code", "status", "status.value", "performed"],
      "codeFilter" : [{
        "path" : "code",
        "valueSet" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.59"
      }]
    },
    {
      "type" : "Encounter",
      "profile" : ["http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter"],
      "mustSupport" : ["type", "status", "status.value", "period"],
      "codeFilter" : [{
        "path" : "type",
        "valueSet" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307"
      }]
    },
    {
      "type" : "Patient",
      "profile" : ["http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient"]
    },
    {
      "type" : "Patient",
      "profile" : ["http://hl7.org/fhir/Patient"],
      "mustSupport" : ["birthDate", "birthDate.value", "gender", "gender.value"]
    },
    {
      "type" : "Observation",
      "profile" : ["http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation"],
      "mustSupport" : ["code", "value", "status", "status.value", "effective"],
      "codeFilter" : [{
        "path" : "code",
        "code" : [{
          "system" : "http://loinc.org",
          "code" : "93857-1",
          "display" : "Date and time of obstetric delivery"
        }]
      }]
    },
    {
      "type" : "Observation",
      "profile" : ["http://hl7.org/fhir/Observation"],
      "mustSupport" : ["value"]
    },
    {
      "type" : "Observation",
      "profile" : ["http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation"],
      "mustSupport" : ["code", "value", "status", "status.value", "effective"],
      "codeFilter" : [{
        "path" : "code",
        "code" : [{
          "system" : "http://loinc.org",
          "code" : "11778-8",
          "display" : "Delivery date Estimated"
        }]
      }]
    },
    {
      "type" : "Observation",
      "profile" : ["http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation"],
      "mustSupport" : ["code", "value", "status", "status.value", "effective"],
      "codeFilter" : [{
        "path" : "code",
        "valueSet" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.26"
      }]
    },
    {
      "type" : "Condition",
      "profile" : ["http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition"],
      "mustSupport" : ["id", "id.value"]
    },
    {
      "type" : "uri",
      "profile" : ["http://hl7.org/fhir/uri"],
      "mustSupport" : ["value"]
    },
    {
      "type" : "string",
      "profile" : ["http://hl7.org/fhir/string"],
      "mustSupport" : ["value"]
    },
    {
      "type" : "Observation",
      "profile" : ["http://hl7.org/fhir/StructureDefinition/bp"],
      "mustSupport" : ["effective", "status", "status.value", "component"]
    },
    {
      "profile" : ["http://hl7.org/fhir/Observation.Component"],
      "mustSupport" : ["value"]
    },
    {
      "type" : "Condition",
      "profile" : ["http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition"],
      "mustSupport" : ["id", "id.value"]
    },
    {
      "type" : "Reference",
      "profile" : ["http://hl7.org/fhir/Reference"],
      "mustSupport" : ["reference", "reference.value"]
    },
    {
      "type" : "Coverage",
      "profile" : ["http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-coverage"],
      "mustSupport" : ["type", "period"],
      "codeFilter" : [{
        "path" : "type",
        "valueSet" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"
      }]
    },
    {
      "type" : "Procedure",
      "profile" : ["http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure"],
      "mustSupport" : ["code", "status", "status.value", "performed"],
      "codeFilter" : [{
        "path" : "code",
        "valueSet" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.379"
      }]
    },
    {
      "type" : "Observation",
      "profile" : ["http://hl7.org/fhir/StructureDefinition/heartrate"],
      "mustSupport" : ["effective", "status", "status.value", "value"]
    },
    {
      "type" : "Patient",
      "profile" : ["http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient"]
    },
    {
      "type" : "Patient",
      "profile" : ["http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient"],
      "mustSupport" : ["url", "extension"]
    },
    {
      "type" : "Patient",
      "profile" : ["http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient"],
      "mustSupport" : ["url", "extension"]
    },
    {
      "type" : "Procedure",
      "profile" : ["http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure"],
      "mustSupport" : ["code", "status", "status.value", "performed"],
      "codeFilter" : [{
        "path" : "code",
        "valueSet" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.256"
      }]
    },
    {
      "type" : "Procedure",
      "profile" : ["http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure"],
      "mustSupport" : ["code", "status", "status.value", "performed"],
      "codeFilter" : [{
        "path" : "code",
        "valueSet" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.213"
      }]
    },
    {
      "type" : "Observation",
      "profile" : ["http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab"],
      "mustSupport" : ["code", "issued", "issued.value", "status", "status.value", "value"],
      "codeFilter" : [{
        "path" : "code",
        "valueSet" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.129"
      }]
    },
    {
      "type" : "Observation",
      "profile" : ["http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab"],
      "mustSupport" : ["code", "issued", "issued.value", "status", "status.value", "value"],
      "codeFilter" : [{
        "path" : "code",
        "valueSet" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.114"
      }]
    },
    {
      "type" : "Patient",
      "profile" : ["http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient"],
      "mustSupport" : ["url", "extension"]
    },
    {
      "type" : "Patient",
      "profile" : ["http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient"],
      "mustSupport" : ["url", "extension"]
    },
    {
      "type" : "Coverage",
      "profile" : ["http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-coverage"],
      "mustSupport" : ["type", "period"],
      "codeFilter" : [{
        "path" : "type",
        "valueSet" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"
      }]
    },
    {
      "type" : "Patient",
      "profile" : ["http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient"],
      "mustSupport" : ["url", "extension"]
    },
    {
      "type" : "Patient",
      "profile" : ["http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient"],
      "mustSupport" : ["url", "extension"]
    }]
  }],
  "extension" : [{
    "id" : "supplementalDataGuidance",
    "extension" : [{
      "url" : "guidance",
      "valueString" : "Patient's Ethnicity:\nHispanic or Latino\nNot Hispanic or Latino Patient's Payer:\nCategories of types of health care payer entities as defined by the US Public Health Data Consortium SOP code system Patient's Race:\nNative Hawaiian or Other Pacific Islander\nAsian\nAmerican Indian or Alaska Native\nOther Race\nWhite\nBlack or African American Patient's Sex:\nGender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.\n 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. \n"
    },
    {
      "url" : "usage",
      "valueCodeableConcept" : {
        "coding" : [{
          "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
          "code" : "supplemental-data",
          "display" : "Supplemental Data"
        }],
        "text" : "Supplemental Data Guidance"
      }
    }],
    "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-supplementalDataGuidance"
  },
  {
    "id" : "riskAdjustmentVariableGuidance",
    "extension" : [{
      "url" : "guidance",
      "valueString" : "The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov).\nLab and Physical Exam Results:\nReport the first resulted value 24 hours prior to start of encounter and before time of delivery in UCUM units specified:\n-\tHeart rate:  {beats}/min\n-\tSystolic blood pressure:  mm[Hg]\n-\tWhite blood cell count:  10*3/uL \n-   Hematocrit:  %  \n\n The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov).\nPre-existing conditions and variables must be present on admission:.    Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data.\n The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov).\nPre-existing conditions and variables must be present on admission:.    Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov).\nPre-existing conditions and variables must be present on admission:.    Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov).\nPre-existing conditions and variables must be present on admission:.    Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov).\nPre-existing conditions and variables must be present on admission:.    Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov).\nPre-existing conditions and variables must be present on admission:.    Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov).\nPre-existing conditions and variables must be present on admission:.    Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov).\nPre-existing conditions and variables must be present on admission:.    Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov).\nPre-existing conditions and variables must be present on admission:.    Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov).\nPre-existing conditions and variables must be present on admission:.    Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov).\nPre-existing conditions and variables must be present on admission:.    Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov).\nPre-existing conditions and variables must be present on admission:.    Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov).\nPre-existing conditions and variables must be present on admission:.    Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov).\nPre-existing conditions and variables must be present on admission:.    Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov).\nPre-existing conditions and variables must be present on admission:.    Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov).\nPre-existing conditions and variables must be present on admission:.    Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov).\nPre-existing conditions and variables must be present on admission:.    Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov).\nPre-existing conditions and variables must be present on admission:.    Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov).\nPre-existing conditions and variables must be present on admission:.    Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov).\nPre-existing conditions and variables must be present on admission:.    Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov).\nPre-existing conditions and variables must be present on admission:.    Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov).\nPre-existing conditions and variables must be present on admission:.    Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov).\nPre-existing conditions and variables must be present on admission:.    Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov).\nPre-existing conditions and variables must be present on admission:.    Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov).\nPre-existing conditions and variables must be present on admission:.    Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov).\nPre-existing conditions and variables must be present on admission:.    Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov).\nPre-existing conditions and variables must be present on admission:.    Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov).\nPre-existing conditions and variables must be present on admission:.    Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov).\nPre-existing conditions and variables must be present on admission:.    Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data.    "
    },
    {
      "url" : "usage",
      "valueCodeableConcept" : {
        "coding" : [{
          "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
          "code" : "risk-adjustment-factor",
          "display" : "Risk Adjustment Factor"
        }],
        "text" : "Risk Adjustment Variable Guidance"
      }
    }],
    "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-supplementalDataGuidance"
  },
  {
    "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-effectiveDataRequirements",
    "valueReference" : {
      "reference" : "#effective-data-requirements"
    }
  }],
  "url" : "http://ecqi.healthit.gov/ecqms/Measure/SevereObstetricComplicationsFHIR",
  "identifier" : [{
    "use" : "usual",
    "type" : {
      "coding" : [{
        "system" : "http://hl7.org/fhir/us/cqfmeasures/CodeSystem/identifier-type",
        "code" : "short-name"
      }]
    },
    "system" : "https://madie.cms.gov/measure/shortName",
    "value" : "CMS1028FHIR"
  },
  {
    "use" : "official",
    "type" : {
      "coding" : [{
        "system" : "http://hl7.org/fhir/us/cqfmeasures/CodeSystem/identifier-type",
        "code" : "version-independent"
      }]
    },
    "system" : "urn:ietf:rfc:3986",
    "value" : "urn:uuid:6cf03fe2-b962-4f83-ac37-26d7477183c7"
  },
  {
    "use" : "official",
    "type" : {
      "coding" : [{
        "system" : "http://hl7.org/fhir/us/cqfmeasures/CodeSystem/identifier-type",
        "code" : "version-specific"
      }]
    },
    "system" : "urn:ietf:rfc:3986",
    "value" : "urn:uuid:2c92808482ead7c5018384daff512547"
  },
  {
    "use" : "official",
    "type" : {
      "coding" : [{
        "system" : "http://hl7.org/fhir/us/cqfmeasures/CodeSystem/identifier-type",
        "code" : "publisher"
      }]
    },
    "system" : "https://madie.cms.gov/measure/cmsId",
    "value" : "1028FHIR",
    "assigner" : {
      "display" : "CMS"
    }
  }],
  "version" : "0.0.007",
  "name" : "SevereObstetricComplicationsFHIR",
  "title" : "Severe Obstetric ComplicationsFHIR",
  "status" : "draft",
  "experimental" : false,
  "date" : "2023-08-08T18:35:06+00:00",
  "publisher" : "The Joint Commission",
  "contact" : [{
    "telecom" : [{
      "system" : "url",
      "value" : "https://www.jointcommission.org/"
    }]
  }],
  "description" : "Patients with severe obstetric complications which occur during the inpatient delivery hospitalization",
  "useContext" : [{
    "code" : {
      "system" : "http://terminology.hl7.org/CodeSystem/usage-context-type",
      "code" : "program"
    },
    "valueCodeableConcept" : {
      "coding" : [{
        "system" : "http://hl7.org/fhir/us/cqfmeasures/CodeSystem/quality-programs",
        "code" : "eh-cah",
        "display" : "EH/CAH"
      }]
    }
  }],
  "purpose" : "UNKNOWN",
  "usage" : "This measure allows for 3 approaches to determine gestational age (GA) in the following order of precedence:\n\n1.  The GA is calculated using the American College of Obstetricians and Gynecologists ReVITALize guidelines.*\n2.  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.\n3.  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.\n\nWherever 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.  \n \n*ACOG ReVITALize Guidelines for Calculating Gestational Age:      \n     \n                                Gestational Age = (280-(Estimated Due Date minus Reference Date))/7\n\n--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) \n--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.   \n\nNote however the calculation may yield a non-whole number and gestational age should be rounded off to the nearest completed week. For example, an infant born on the 5th day of the 36th week (35 weeks and 5/7 days) is at a gestational age of 35 weeks, not 36 weeks.\n\nDefinition:\nFor 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).\n\nThis eCQM is an episode-based measure. An episode is defined as each inpatient hospitalization or encounter that ends during the measurement period.\n\nThis FHIR-based measure has been derived from the QDM-based measure CMS1028v2.\n\nPlease refer to the HL7 QI-Core Implementation Guide (http://hl7.org/fhir/us/qicore/index.html) for more information on QI-Core and mapping recommendations from QDM to QI-Core 4.1.1 (http://hl7.org/fhir/us/qicore/qdm-to-qicore.html).",
  "copyright" : "Measure specifications are in the Public Domain.\n\nLOINC(R) copyright 2004-2022 Regenstrief Institute, Inc. This material contains SNOMED Clinical Terms(R) (SNOMED CT[R]) copyright 2004-2022 International Health Terminology Standards Development Organisation. ICD-10 copyright 2022 World Health Organization. All Rights Reserved.",
  "approvalDate" : "2023-08-21",
  "lastReviewDate" : "2023-08-21",
  "effectivePeriod" : {
    "start" : "2024-01-01",
    "end" : "2024-12-31"
  },
  "author" : [{
    "name" : "The Joint Commission",
    "telecom" : [{
      "system" : "url",
      "value" : "https://www.jointcommission.org/"
    }]
  },
  {
    "name" : "Centers for Medicare & Medicaid Services (CMS)",
    "telecom" : [{
      "system" : "url",
      "value" : "https://www.cms.gov/"
    }]
  },
  {
    "name" : "Yale New Haven Health Service Corporation/ Center for Outcomes Research and Evaluation",
    "telecom" : [{
      "system" : "url",
      "value" : "https://medicine.yale.edu/core/"
    }]
  }],
  "library" : ["http://ecqi.healthit.gov/ecqms/Library/SevereObstetricComplicationsFHIR"],
  "disclaimer" : "These performance measures are not clinical guidelines and do not establish a standard of medical care, and have not been tested for all potential applications. The measures and specifications are provided without warranty.",
  "rationale" : "The United States (US) experiences higher rates of maternal morbidity and mortality than most other developed countries. These rates have continued to trend upward in recent decades (CDC, n.d.). Research indicates that the overall rate of severe maternal morbidity (SMM) increased by almost 200% between 1993 and 2014 to 144 per 10,000 delivery hospitalizations (CDC, n.d.), with more than 25,000 women per year experiencing obstetric complications (U.S. Department of Health and Human Services, 2020). Recent maternal mortality data from 2018 reveal that 658 women in the US died from maternal causes, resulting in a rate of 17.4 deaths per 100,000 live births, with 77% of the deaths attributed to direct obstetric causes like hemorrhage, preeclampsia, obstetric embolism, and other complications (Hoyert & Minino, 2018). 144 per 10,000 women hospitalized for delivery have experienced SMM, including hemorrhage, embolism, hypertension, stroke, and other serious complications (CDC,2020). Racial and ethnic disparities for Black women and Hispanic women are at a significantly higher risk for developing these complications than are Non-Hispanic White women (Leonard et al., 2019). Increasing rates of SMM are resulting in increased healthcare costs, longer hospitalization stays and impacts on a woman's health. \n\nThere is limited national evaluation of hospitals' performance on maternal morbidity and mortality although SMM is widely used at the population level. SMM is linked to maternal mortality, varies significantly among hospitals, and has significant racial/ethnic and urban/rural disparities. SMM is a cost driver for both Medicaid and commercial plans. This measure is important as it will assist in the discovery and understanding of SMM patterns which can lead to improvements in the safety and quality of maternal care necessary to reduce SMM rates.",
  "clinicalRecommendationStatement" : "Healthy People 2030 Measure (MICH-05): Reduce severe maternal complications identified during delivery hospitalizations\n\nThe American College of Obstetricians and Gynecologists (the College) and the Society for Maternal-Fetal Medicine (SMFM) recommend identifying potential cases of severe maternal morbidity for further review, with a focus on outcomes and complications, and consider this an important step toward promoting safe obstetric care.",
  "group" : [{
    "id" : "638907ab4ba3d47c885c02fd",
    "extension" : [{
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-scoring",
      "valueCodeableConcept" : {
        "coding" : [{
          "system" : "http://terminology.hl7.org/CodeSystem/measure-scoring",
          "code" : "proportion",
          "display" : "Proportion"
        }]
      }
    },
    {
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-populationBasis",
      "valueCode" : "Encounter"
    },
    {
      "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-type",
      "valueCodeableConcept" : {
        "coding" : [{
          "system" : "http://terminology.hl7.org/CodeSystem/measure-type",
          "code" : "outcome",
          "display" : "Outcome"
        }]
      }
    }],
    "population" : [{
      "id" : "8D56845B-BA26-4F6A-8D23-BBFD696C9450",
      "code" : {
        "coding" : [{
          "system" : "http://terminology.hl7.org/CodeSystem/measure-population",
          "code" : "initial-population",
          "display" : "Initial Population"
        }]
      },
      "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 that ends during the measurement period",
      "criteria" : {
        "language" : "text/cql-identifier",
        "expression" : "Initial Population"
      }
    },
    {
      "id" : "8542DE86-6114-4575-9A2B-D09A0FA7C671",
      "code" : {
        "coding" : [{
          "system" : "http://terminology.hl7.org/CodeSystem/measure-population",
          "code" : "denominator",
          "display" : "Denominator"
        }]
      },
      "description" : "Inpatient hospitalizations for patients delivering stillborn or live birth with greater than or equal to 20 weeks, 0 days gestation completed",
      "criteria" : {
        "language" : "text/cql-identifier",
        "expression" : "Denominator"
      }
    },
    {
      "id" : "16605347-8AF3-47AA-B230-65B7208909B9",
      "code" : {
        "coding" : [{
          "system" : "http://terminology.hl7.org/CodeSystem/measure-population",
          "code" : "denominator-exclusion",
          "display" : "Denominator Exclusion"
        }]
      },
      "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",
      "criteria" : {
        "language" : "text/cql-identifier",
        "expression" : "Denominator Exclusion"
      }
    },
    {
      "id" : "05AD3648-8C60-4938-96C4-82385B9C4F91",
      "code" : {
        "coding" : [{
          "system" : "http://terminology.hl7.org/CodeSystem/measure-population",
          "code" : "numerator",
          "display" : "Numerator"
        }]
      },
      "description" : "Inpatient hospitalizations for patients with severe obstetric complications (not present on admission that occur during the current delivery encounter) including the following: \n-  Severe maternal morbidity diagnoses (see list below)\n-  Severe maternal morbidity procedures (see list below)\n-  Discharge disposition of expired\nPlease note that present on admission codes may be those entered by coding staff, extracted from billing/claims data.\n\nSevere Maternal Morbidity Diagnoses:\n-  Cardiac\n\t          Acute heart failure \n\t          Acute myocardial infarction\n\t          Aortic aneurysm\n\t          Cardiac arrest/ventricular fibrillation\n\t          Heart failure/arrest during procedure or surgery\n-  Hemorrhage\n\t          Disseminated intravascular coagulation\n\t          Shock\n-  Renal\n                  Acute renal failure\n-  Respiratory\n\t          Adult respiratory distress syndrome\n\t          Pulmonary edema\n-  Sepsis\n-  Other OB\n\t          Air and thrombotic embolism\n\t          Amniotic fluid embolism\n\t          Eclampsia\n\t          Severe anesthesia complications\n-  Other Medical\n\t          Puerperal cerebrovascular disorder\n\t          Sickle cell disease with crisis\n\n\nSevere Maternal Morbidity Procedures:\n-  Blood transfusion\n-  Conversion of cardiac rhythm\n-  Hysterectomy\n-  Temporary tracheostomy\n-  Ventilation",
      "criteria" : {
        "language" : "text/cql-identifier",
        "expression" : "Numerator"
      }
    },
    {
      "id" : "e29f29ee-889e-4314-983c-e0ddc189a16c",
      "code" : {
        "coding" : [{
          "system" : "http://terminology.hl7.org/CodeSystem/measure-population",
          "code" : "numerator-exclusion",
          "display" : "Numerator Exclusion"
        }]
      },
      "criteria" : {
        "language" : "text/cql-identifier"
      }
    },
    {
      "id" : "f2f492ff-b304-4d26-9df1-69162493ddc1",
      "code" : {
        "coding" : [{
          "system" : "http://terminology.hl7.org/CodeSystem/measure-population",
          "code" : "denominator-exception",
          "display" : "Denominator Exception"
        }]
      },
      "criteria" : {
        "language" : "text/cql-identifier"
      }
    }],
    "stratifier" : [{
      "id" : "75faa812-7f77-45d4-bed1-a5d92837e8f4",
      "extension" : [{
        "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-appliesTo",
        "valueCodeableConcept" : {
          "coding" : [{
            "system" : "http://terminology.hl7.org/CodeSystem/measure-population",
            "code" : "initial-population",
            "display" : "Initial Population"
          }]
        }
      }],
      "description" : "Stratum1: Delivery hospitalizations with severe obstetric complications excluding hospitalizations where transfusion was the only severe obstetric complication.\n\nAdditionally, this measure will be stratified by race and ethnicity after measure submission.",
      "criteria" : {
        "language" : "text/cql-identifier",
        "expression" : "Stratum 1"
      }
    },
    {
      "id" : "f08626ef-90df-4c81-9651-f6206e05d480",
      "extension" : [{
        "url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-appliesTo",
        "valueCodeableConcept" : {
          "coding" : [{
            "system" : "http://terminology.hl7.org/CodeSystem/measure-population",
            "code" : "initial-population",
            "display" : "Initial Population"
          }]
        }
      }],
      "criteria" : {
        "language" : "text/cql-identifier"
      }
    }]
  }],
  "supplementalData" : [{
    "id" : "sde-ethnicity",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "supplemental-data"
      }]
    }],
    "description" : "SDE Ethnicity",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "SDE Ethnicity"
    }
  },
  {
    "id" : "sde-payer",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "supplemental-data"
      }]
    }],
    "description" : "SDE Payer",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "SDE Payer"
    }
  },
  {
    "id" : "sde-race",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "supplemental-data"
      }]
    }],
    "description" : "SDE Race",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "SDE Race"
    }
  },
  {
    "id" : "sde-sex",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "supplemental-data"
      }]
    }],
    "description" : "SDE Sex",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "SDE Sex"
    }
  },
  {
    "id" : "variable-calculated-gestational-age",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "supplemental-data"
      }]
    }],
    "description" : "Variable Calculated Gestational Age",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Variable Calculated Gestational Age"
    }
  },
  {
    "id" : "risk-variable-lab-and-physical-exam-results",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable Lab and Physical Exam Results",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable Lab and Physical Exam Results"
    }
  },
  {
    "id" : "risk-variable-anemia",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable Anemia",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable Anemia"
    }
  },
  {
    "id" : "risk-variable-asthma",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable Asthma",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable Asthma"
    }
  },
  {
    "id" : "risk-variable-autoimmune-disease",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable Autoimmune Disease",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable Autoimmune Disease"
    }
  },
  {
    "id" : "risk-variable-bariatric-surgery",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable Bariatric Surgery",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable Bariatric Surgery"
    }
  },
  {
    "id" : "risk-variable-bleeding-disorder",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable Bleeding Disorder",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable Bleeding Disorder"
    }
  },
  {
    "id" : "risk-variable-morbid-obesity",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable Morbid Obesity",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable Morbid Obesity"
    }
  },
  {
    "id" : "risk-variable-cardiac-disease",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable Cardiac Disease",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable Cardiac Disease"
    }
  },
  {
    "id" : "risk-variable-economic-housing-instability",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable Economic Housing Instability",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable Economic Housing Instability"
    }
  },
  {
    "id" : "risk-variable-gastrointestinal-disease",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable Gastrointestinal Disease",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable Gastrointestinal Disease"
    }
  },
  {
    "id" : "risk-variable-gestational-diabetes",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable Gestational Diabetes",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable Gestational Diabetes"
    }
  },
  {
    "id" : "risk-variable-hiv",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable HIV",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable HIV"
    }
  },
  {
    "id" : "risk-variable-hypertension",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable Hypertension",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable Hypertension"
    }
  },
  {
    "id" : "risk-variable-long-term-anticoagulant-use",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable Long Term Anticoagulant Use",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable Long Term Anticoagulant Use"
    }
  },
  {
    "id" : "risk-variable-mental-health-disorder",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable Mental Health Disorder",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable Mental Health Disorder"
    }
  },
  {
    "id" : "risk-variable-multiple-pregnancy",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable Multiple Pregnancy",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable Multiple Pregnancy"
    }
  },
  {
    "id" : "risk-variable-neuromuscular",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable Neuromuscular",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable Neuromuscular"
    }
  },
  {
    "id" : "risk-variable-obstetrical-vte",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable Obstetrical VTE",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable Obstetrical VTE"
    }
  },
  {
    "id" : "risk-variable-placenta-previa",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable Placenta Previa",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable Placenta Previa"
    }
  },
  {
    "id" : "risk-variable-placental-abruption",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable Placental Abruption",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable Placental Abruption"
    }
  },
  {
    "id" : "risk-variable-placental-accreta-spectrum",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable Placental Accreta Spectrum",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable Placental Accreta Spectrum"
    }
  },
  {
    "id" : "risk-variable-preexisting-diabetes",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable Preexisting Diabetes",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable Preexisting Diabetes"
    }
  },
  {
    "id" : "risk-variable-previous-cesarean",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable Previous Cesarean",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable Previous Cesarean"
    }
  },
  {
    "id" : "risk-variable-pulmonary-hypertension",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable Pulmonary Hypertension",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable Pulmonary Hypertension"
    }
  },
  {
    "id" : "risk-variable-renal-disease",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable Renal Disease",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable Renal Disease"
    }
  },
  {
    "id" : "risk-variable-severe-preeclampsia",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable Severe Preeclampsia",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable Severe Preeclampsia"
    }
  },
  {
    "id" : "risk-variable-substance-abuse",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable Substance Abuse",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable Substance Abuse"
    }
  },
  {
    "id" : "risk-variable-thyrotoxicosis",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable Thyrotoxicosis",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable Thyrotoxicosis"
    }
  },
  {
    "id" : "risk-variable-other-preeclampsia",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable Other Preeclampsia",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable Other Preeclampsia"
    }
  },
  {
    "id" : "risk-variable-preterm-birth",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable Preterm Birth",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable Preterm Birth"
    }
  },
  {
    "id" : "risk-variable-first-hematocrit-lab-test",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable First Hematocrit Lab Test",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable First Hematocrit Lab Test"
    }
  },
  {
    "id" : "risk-variable-first-white-blood-cell-count-lab-test",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable First White Blood Cell Count Lab Test",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable First White Blood Cell Count Lab Test"
    }
  },
  {
    "id" : "risk-variable-heart-rate",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable Heart Rate",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable Heart Rate"
    }
  },
  {
    "id" : "risk-variable-systolic-blood-pressure",
    "usage" : [{
      "coding" : [{
        "system" : "http://terminology.hl7.org/CodeSystem/measure-data-usage",
        "code" : "risk-adjustment-factor"
      }]
    }],
    "description" : "Risk Variable Systolic Blood Pressure",
    "criteria" : {
      "language" : "text/cql-identifier",
      "expression" : "Risk Variable Systolic Blood Pressure"
    }
  }]
}

```
