  Objective: To develop a rule-based algorithm that detects temporal
information of clinical events during pregnancy for women with COVID-19 by
inferring gestational weeks and delivery dates from Electronic Health Records
(EHR) from the National COVID Cohort Collaborate (N3C). Materials and Methods:
The EHR are normalized by the Observational Medical Outcomes Partnership (OMOP)
Clinical Data Model (CDM). EHR phenotyping resulted in 270,897 pregnant women
(2018-06-01 to 2021-05-31). We developed a rule-based algorithm and performed a
multi-level evaluation to test content validity and clinical validity of the
algorithm; and extreme value analysis for individuals with <150 or >300 days of
gestation. Results: The algorithm identified 296,194 pregnancies (16,659
COVID-19 174 and 744 without COVID-19 peri-pandemic) in 270,897 pregnant women.
For inferring gestational age, 95% cases (n=40) have moderate-high accuracy
(Cohen Kappa = 0.62); 100% cases (n=40) have moderate-high granularity of
temporal information (Cohen Kappa = 1). For inferring delivery dates, the
accuracy is 100% (Cohen Kappa = 1). Accuracy of gestational age detection for
extreme length of gestation is 93.3% (Cohen Kappa = 1). Mothers with COVID-19
showed higher prevalence in obesity (35.1% vs. 29.5%), diabetes (17.8% vs.
17.0%), chronic obstructive pulmonary disease (COPD) (0.2% vs. 0.1%),
respiratory distress syndrome (ARDS) (1.8% vs. 0.2%). Discussion: We explored
the characteristics of pregnant women by different timing of COVID-19 with our
algorithm: the first to infer temporal information from complete antenatal care
and detect the timing of SARS-CoV-2 infection for pregnant women using N3C.
Conclusion: The algorithm shows excellent validity in inferring gestational age
and delivery dates, which supports national EHR cohorts on N3C studying the
impact of COVID-19 on pregnancy.
