Id: SevereObstetricComplicationsFHIR Url: http://ecqi.healthit.gov/ecqms/Library/SevereObstetricComplicationsFHIR Version: 0.0.007 Identifier: value: SevereObstetricComplicationsFHIR Name: SevereObstetricComplicationsFHIR Title: SevereObstetricComplicationsFHIR Status: active Experimental: false Type: system: http://terminology.hl7.org/CodeSystem/library-type code: logic-library Date: 2023-08-21T20:21:19+00:00 Description: SevereObstetricComplicationsFHIR Use Context: code value display program eh-cah EH/CAH Related Artifacts: Dependencies Data Requirements: Type Profile MS Code Filter Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient Encounter http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter ;;;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307 Encounter http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter ;;;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143 Encounter http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter ;;;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.369 Encounter http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter ;;;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143 Encounter http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter ;;;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.369 Procedure http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure ;;;; code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.59 Encounter http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter ;;;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307 Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient Patient http://hl7.org/fhir/Patient ;;;; Observation http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation ;;;;; code filter: path: code system: http://loinc.org code: 93857-1 display: Date and time of obstetric delivery Observation http://hl7.org/fhir/Observation ; Observation http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation ;;;;; code filter: path: code system: http://loinc.org code: 11778-8 display: Delivery date Estimated Observation http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation ;;;;; code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.26 Condition http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition ;; uri http://hl7.org/fhir/uri ; string http://hl7.org/fhir/string ; Observation http://hl7.org/fhir/StructureDefinition/bp ;;;; http://hl7.org/fhir/Observation.Component ; Condition http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition ;; Reference http://hl7.org/fhir/Reference ;; Coverage http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-coverage ;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591 Procedure http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure ;;;; code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.379 Observation http://hl7.org/fhir/StructureDefinition/heartrate ;;;; Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient ;; Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient ;; Procedure http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure ;;;; code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.256 Procedure http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure ;;;; code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.213 Observation http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab ;;;;;; code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.129 Observation http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab ;;;;;; code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.114 Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient ;; Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient ;; Coverage http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-coverage ;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591 Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient ;; Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient ;; Content: text/cql library SevereObstetricComplicationsFHIR version '0.0.007'#xD; #xD; using QICore version '4.1.1'#xD; #xD; include CQMCommon version '1.4.000' called CQMCommon#xD; include FHIRHelpers version '4.3.000' called FHIRHelpers#xD; include SupplementalDataElements version '3.4.000' called SDE#xD; include PCMaternal version '5.10.000' called PCMaternal#xD; include QICoreCommon version '1.5.000' called QICoreCommon#xD; #xD; codesystem "LOINC": 'http://loinc.org'#xD; codesystem "SNOMEDCT": 'http://snomed.info/sct'#xD; codesystem "PresentOnAdmission": 'https://www.cms.gov/Medicare/Medicare-Fee-for-Service-Payment/HospitalAcqCond/Coding'#xD; #xD; valueset "20 to 42 Plus Weeks Gestation": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.67'#xD; valueset "Acute or Persistent Asthma": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.271'#xD; valueset "Anemia": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.323'#xD; valueset "Autoimmune Disease": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.311'#xD; valueset "Bariatric Surgery": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.317'#xD; valueset "Bleeding Disorder": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.287'#xD; valueset "Blood Transfusion": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.213'#xD; valueset "Cardiac Disease": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.341'#xD; valueset "COVID 19 Confirmed": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.373'#xD; valueset "Delivery Procedures": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.59'#xD; valueset "Economic Housing Instability": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.292'#xD; valueset "ED Visit and OB Triage": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.369'#xD; valueset "Emergency Department Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292'#xD; valueset "Gastrointestinal Disease": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.338'#xD; valueset "Gestational Diabetes": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.269'#xD; valueset "Hematocrit lab test": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.114'#xD; valueset "HIV in Pregnancy Childbirth and Puerperium": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.272'#xD; valueset "Hypertension": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.332'#xD; valueset "Long Term Anticoagulant Use": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.366'#xD; valueset "Mental Health Disorder": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.314'#xD; valueset "Mild or Moderate Preeclampsia": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.329'#xD; valueset "Morbid or Severe Obesity": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.290'#xD; valueset "Multiple Pregnancy": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.284'#xD; valueset "Neuromuscular Disease": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.308'#xD; valueset "Observation Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143'#xD; valueset "Patient Expired": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.309'#xD; valueset "Placenta Previa": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.35'#xD; valueset "Placental Abruption": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.305'#xD; valueset "Placental Accreta Spectrum": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.302'#xD; valueset "Preexisting Diabetes": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.275'#xD; valueset "Present on Admission is No or Unable To Determine": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.370'#xD; valueset "Present On Admission is Yes or Exempt": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.63'#xD; valueset "Preterm Birth": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.299'#xD; valueset "Previous Cesarean": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.278'#xD; valueset "Pulmonary Hypertension": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.281'#xD; valueset "Renal Disease": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.335'#xD; valueset "Respiratory Conditions Related to COVID 19": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.376'#xD; valueset "Respiratory Support Procedures Related to COVID 19": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.379'#xD; valueset "Severe Maternal Morbidity Diagnoses": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.255'#xD; valueset "Severe Maternal Morbidity Procedures": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.256'#xD; valueset "Severe Preeclampsia": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.327'#xD; valueset "Substance Abuse": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.320'#xD; valueset "Thyrotoxicosis": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.296'#xD; valueset "Venous Thromboembolism in Pregnancy": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.363'#xD; valueset "White blood cells count lab test": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.129'#xD; #xD; parameter "Measurement Period" Interval<DateTime>#xD; #xD; context Patient#xD; #xD; define "Initial Population":#xD; PCMaternal."Delivery Encounter with Age Range"#xD; #xD; define "SDE Ethnicity":#xD; SDE."SDE Ethnicity"#xD; #xD; define "SDE Payer":#xD; SDE."SDE Payer"#xD; #xD; define "SDE Race":#xD; SDE."SDE Race"#xD; #xD; define "SDE Sex":#xD; SDE."SDE Sex"#xD; #xD; define "Stratification Encounter":#xD; "Numerator"#xD; except "Denominator Exclusion"#xD; #xD; define "Denominator Exclusion":#xD; "Delivery Encounters with COVID and Respiratory Condition or Procedure"#xD; #xD; 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.#xD; #xD; "Stratification Encounter"#xD; intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"#xD; #xD; define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions":#xD; "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion"#xD; union "Delivery Encounters with Expiration"#xD; #xD; define "Numerator":#xD; "Delivery Encounters with Severe Obstetric Complications"#xD; #xD; define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks":#xD; PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter#xD; where DeliveryEncounter.calculatedGestationalAge ( ) >= 20#xD; #xD; define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks":#xD; PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter#xD; where DeliveryEncounter.calculatedGestationalAge ( ) is null#xD; and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )#xD; #xD; 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. #xD; #xD; PCMaternal."Variable Calculated Gestational Age"#xD; #xD; define "Denominator":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"#xD; #xD; define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation":#xD; "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks"#xD; union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks"#xD; union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"#xD; #xD; define "Delivery Encounters with Expiration":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"#xD; #xD; define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding":#xD; PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter#xD; let CGA: DeliveryEncounter.calculatedGestationalAge ( ),#xD; EGA: DeliveryEncounter.lastEstimatedGestationalAge ( )#xD; where CGA is null#xD; and EGA is null#xD; and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis#xD; where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation"#xD; )#xD; #xD; define "Delivery Encounters with Severe Obstetric Complications":#xD; "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion"#xD; union "Delivery Encounters with Expiration"#xD; union "Delivery Encounters with Blood Transfusion"#xD; #xD; define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses#xD; where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses"#xD; and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine"#xD; ) //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N')#xD; #xD; or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures#xD; where EncounterProcedures.status = 'completed'#xD; and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )#xD; )#xD; #xD; define "Delivery Encounters with COVID and Respiratory Condition or Procedure":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis#xD; where EncounterDiagnosis.code in "COVID 19 Confirmed"#xD; )#xD; and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis#xD; where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19"#xD; )#xD; or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures#xD; where EncounterProcedures.status = 'completed'#xD; and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )#xD; )#xD; )#xD; #xD; define "Risk Variable Anemia":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses#xD; where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia"#xD; and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )#xD; )#xD; #xD; define "Risk Variable Asthma":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses#xD; where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma"#xD; and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )#xD; )#xD; #xD; define "Risk Variable Autoimmune Disease":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses#xD; where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease"#xD; and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )#xD; )#xD; #xD; define "Risk Variable Bariatric Surgery":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses#xD; where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery"#xD; and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )#xD; )#xD; #xD; define "Risk Variable Bleeding Disorder":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses#xD; where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder"#xD; and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )#xD; )#xD; #xD; define "Risk Variable Morbid Obesity":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses#xD; where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity"#xD; and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )#xD; )#xD; #xD; define "Risk Variable Cardiac Disease":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses#xD; where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease"#xD; and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )#xD; )#xD; #xD; define "Risk Variable Economic Housing Instability":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses#xD; where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability"#xD; and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )#xD; )#xD; #xD; define "Risk Variable Gastrointestinal Disease":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses#xD; where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease"#xD; and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )#xD; )#xD; #xD; define "Risk Variable Gestational Diabetes":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses#xD; where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes"#xD; and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )#xD; )#xD; #xD; define "Risk Variable HIV":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses#xD; where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium"#xD; and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )#xD; )#xD; #xD; define "Risk Variable Hypertension":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses#xD; where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension"#xD; and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )#xD; )#xD; #xD; define "Risk Variable Long Term Anticoagulant Use":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses#xD; where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use"#xD; and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )#xD; )#xD; #xD; define "Risk Variable Mental Health Disorder":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses#xD; where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder"#xD; and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )#xD; )#xD; #xD; define "Risk Variable Multiple Pregnancy":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses#xD; where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy"#xD; and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )#xD; )#xD; #xD; define "Risk Variable Neuromuscular":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses#xD; where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease"#xD; and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )#xD; )#xD; #xD; define "Risk Variable Obstetrical VTE":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses#xD; where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy"#xD; and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )#xD; )#xD; #xD; define "Risk Variable Placenta Previa":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses#xD; where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa"#xD; and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )#xD; )#xD; #xD; define "Risk Variable Placental Abruption":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses#xD; where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption"#xD; and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )#xD; )#xD; #xD; define "Risk Variable Placental Accreta Spectrum":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses#xD; where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum"#xD; and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )#xD; )#xD; #xD; define "Risk Variable Preexisting Diabetes":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses#xD; where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes"#xD; and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )#xD; )#xD; #xD; define "Risk Variable Previous Cesarean":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses#xD; where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean"#xD; and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )#xD; )#xD; #xD; define "Risk Variable Pulmonary Hypertension":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses#xD; where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension"#xD; and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )#xD; )#xD; #xD; define "Risk Variable Renal Disease":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses#xD; where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease"#xD; and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )#xD; )#xD; #xD; define "Risk Variable Severe Preeclampsia":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses#xD; where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia"#xD; and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )#xD; )#xD; #xD; define "Risk Variable Substance Abuse":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses#xD; where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse"#xD; and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )#xD; )#xD; #xD; define "Risk Variable Thyrotoxicosis":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses#xD; where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis"#xD; and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )#xD; )#xD; #xD; define "Risk Variable Other Preeclampsia":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses#xD; where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia"#xD; and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )#xD; )#xD; #xD; define "Risk Variable Preterm Birth": /* CGA = Calculated Gestational Age. EGA = Estimated Gestational Age. */#xD; #xD; ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter#xD; let CGA: DeliveryEncounter.calculatedGestationalAge ( ),#xD; EGA: DeliveryEncounter.lastEstimatedGestationalAge ( )#xD; where CGA in Interval[20, 36]#xD; or ( CGA is null#xD; and ( EGA >= 20 weeks#xD; and EGA <= 36 weeks#xD; )#xD; )#xD; )#xD; union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter#xD; let CGA: DeliveryEncounter.calculatedGestationalAge ( ),#xD; EGA: DeliveryEncounter.lastEstimatedGestationalAge ( )#xD; where CGA is null#xD; and EGA is null#xD; and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses#xD; where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth"#xD; and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )#xD; )#xD; )#xD; #xD; define "Delivery Encounters with Blood Transfusion":#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter#xD; with ["Procedure": "Blood Transfusion"] BloodTransfusion#xD; such that BloodTransfusion.status = 'completed'#xD; and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( ) //First resulted value 24 hours prior to start of encounter and before time of delivery //Report hematocrit as %#xD; #xD; #xD; #xD; define "Risk Variable First Hematocrit Lab Test":#xD; First(from#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter,#xD; ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit#xD; where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery())#xD; and Hematocrit.status in { 'final', 'amended', 'corrected' }#xD; return {#xD; EncounterId: Encounter.id,#xD; FirstResult: Hematocrit.value as Quantity,#xD; Timing: Hematocrit.issued#xD; }#xD; sort by Timing#xD; ) //First resulted value 24 hours prior to start of encounter and before time of delivery //Report white blood cell count as 10*3/uL#xD; #xD; #xD; #xD; define "Risk Variable First White Blood Cell Count Lab Test":#xD; First(from#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter,#xD; ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC#xD; where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery())#xD; and WBC.status in { 'final', 'amended', 'corrected' }#xD; return {#xD; EncounterId: Encounter.id,#xD; FirstResult: WBC.value as Quantity,#xD; Timing: WBC.issued#xD; }#xD; sort by Timing#xD; ) //First resulted value 24 hours prior to start of encounter and before time of delivery //Report heart rate as beats/min#xD; #xD; #xD; #xD; define "Risk Variable Heart Rate":#xD; First(from#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter,#xD; ["observation-heartrate"] HeartRate#xD; where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery())#xD; and HeartRate.status in { 'final', 'amended', 'corrected' }#xD; return {#xD; EncounterId: Encounter.id,#xD; FirstResult: HeartRate.value as Quantity,#xD; Timing: HeartRate.effective.earliest()#xD; }#xD; sort by Timing#xD; ) //First resulted value 24 hours prior to start of encounter and before time of delivery //Report systolic blood pressure as mm[Hg]#xD; #xD; #xD; #xD; define "Risk Variable Systolic Blood Pressure":#xD; First(from#xD; "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter,#xD; ["observation-bp"] BP#xD; where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery())#xD; and BP.status in { 'final', 'amended', 'corrected' }#xD; return {#xD; EncounterId: Encounter.id,#xD; FirstResult: BP.SystolicBP.value as Quantity,#xD; Timing: BP.effective.earliest()#xD; }#xD; sort by Timing#xD; ) Content: application/elm+xml Encoded data (685536 characters) Content: application/elm+json Encoded data (965460 characters)
Value set HIV in Pregnancy Childbirth and Puerperium
Value set Present on Admission is No or Unable To Determine
Value set Present On Admission is Yes or Exempt
Value set Respiratory Conditions Related to COVID 19
Value set Respiratory Support Procedures Related to COVID 19
Value set Severe Maternal Morbidity Diagnoses
Value set Severe Maternal Morbidity Procedures
Value set Venous Thromboembolism in Pregnancy
Value set White blood cells count lab test
Value set Estimated Gestational Age at Delivery
Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
Delivery Encounters with Blood Transfusion
Delivery Encounters with Severe Obstetric Complications
Delivery Encounters with COVID and Respiratory Condition or Procedure
Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
Risk Variable Economic Housing Instability
Risk Variable Long Term Anticoagulant Use
Risk Variable Placental Accreta Spectrum
Risk Variable First White Blood Cell Count Lab Test
Error attempting to determine filter value: toFhirValue not implemented for Subtract