Validation of pregnancy date estimation from outpatient electronic health record data Authors: Kristin Lyon-Scott, Jenine Dankovchik, Jenna Donovan, Jennifer Hauschildt, Kimberly K Vesco, Janne Boone-Heinonen, Teresa Schmidt Published: 2026 ABSTRACT AbstractObjectivesElectronic health record (EHR) data can enrich investigation of maternal health and pregnancy in large populations. However, many outpatient care settings lack data infrastructure to record pregnancy start and end dates, limiting the reach of EHR-based research. We examined the accuracy of pregnancy dates estimated from outpatient EHR data, compared to linked state birth certificate data.Materials and MethodsWe examined 47 515 pregnancies delivered in OR and CA from the PROMISE study. Pregnancy start and end dates were estimated from outpatient encounter data (procedures, diagnoses), pregnancy episode records (delivery date, gestational age at birth), last menstrual period, estimated due date (EDD), and linkage of clinical records for parents and children. We validated these EHR-derived dates against linked state birth certificates.ResultsWhen estimating pregnancy dates from all available EHR fields, start dates differed from birth certificates by an average of 3.7 days and end dates by 0.2 days. Pregnancy episode data and linked child birthdates enabled most estimates; without these sources, only 490 pregnancies were estimable, which had lower accuracy in end dates (>38 days difference). Estimated start dates were most accurate when based on gestational age and EDD (<1 day, <4 days difference, respectively). Estimated end dates were most accurate when based on child birthdates and episode delivery dates (<1 day difference).ConclusionIn outpatient EHR data, pregnancy episode records and linked child birthdates provide the most accurate estimates of pregnancy timing. For research not requiring precise dating, isolated diagnosis and procedure codes may suffice.Keywords: pregnancy trimesters, electronic health record data, data accuracy, community health centers Background and significance Health-care data sources, such as administrative claims and electronic health records (EHRs), offer great potential for studying maternal health, pregnancy, birth outcomes, and early child development. These sources provide detailed, longitudinal information on care delivery and clinical outcomes during and after pregnancy. Electronic health records, in particular, capture repeated measures on characteristics such as body weight and insurance coverage1 throughout pregnancy, which are often misreported in questionnaires and birth certificate data.2 Many areas of retrospective reproductive health research require longitudinal measures from a pregnancy that are well resourced from EHR data—for example, prenatal care utilization, exposure to vaccines or medications, and conditions such as gestational diabetes or hypertension.3 Accurate pregnancy start and end dates are essential for these studies, yet determining them can be challenging. While the expected duration of pregnancy is 280 days, the actual duration varies widely and can be difficult to ascertain precisely, especially when outcomes are unknown or involve early loss (eg, miscarriage or ectopic pregnancy). Perinatal studies using EHR data often depend on delivery information to date pregnancies. Delivery dates provide relative certainty about the end date of a pregnancy, and when both onset and outcome dates are known, gestational age at delivery can be calculated. Conversely, if outcome date and gestational age at birth are available, pregnancy onset can be derived. Including these data in pregnancy algorithms is increasingly standard for maternal studies on vaccine and medication safety.4–6 However, some obstetric care settings do not provide delivery services—particularly those within the nation’s safety net (eg, Indian Health System, community health centers)7–11—and therefore may lack direct access to delivery dates or gestational age at birth. Fragmentation of prenatal care and delivery is common in the United States, even outside the safety net. Outpatient prenatal clinics and hospital-based delivery settings often use separate EHR systems, and even affiliated clinics may not share unified maternal records. This results in siloed data with limited interchange, as noted in national guidance documents and implementation reports.8,10 Consequently, researchers often rely on outpatient or inpatient datasets in isolation rather than data reflecting a complete continuum of care. Some EHR systems include obstetrics modules, such as Epic Stork, allowing outpatient providers to document pregnancies as “episodes of care” with summary details like gestational age and links to relevant diagnoses, procedures, and encounters. When these episodes are updated with external delivery records, they provide reliable information for pregnancy dating in research. In the absence of episode-level data, researchers must rely on outpatient prenatal and postnatal encounters to estimate pregnancy end dates, without the benefit of records grouped under distinct pregnancies. To date pregnancies, studies using only outpatient data typically leverage temporal patterns in diagnosis codes, procedure codes, and other clinical observations throughout a pregnancy or between sequential pregnancies. One study reviewed existing pregnancy dating algorithms and developed a high-performing methodology that estimates delivery dates from a combination of inpatient and outpatient records.12 However, to our knowledge, no prior studies have developed a pregnancy dating algorithm using only data from outpatient care settings and systematically validated it against an external data source. Building on these gaps, our objective was to validate an algorithm for estimating live birth pregnancy dates from outpatient EHR data by comparing estimated dates against linked state birth certificate records. Specifically, we aimed to (1) identify outpatient EHR fields that accurately estimate pregnancy start and end dates and (2) assess when each type of record (eg, diagnosis codes) tends to be documented during pregnancy. We examined data from a large national network of community-based health-care organizations that provide outpatient care. Our goal is to support retrospective public health research on maternal and early childhood health using outpatient EHR data, particularly in settings where inpatient delivery records are unavailable or incomplete, including populations at higher risk for complications such as those lacking adequate health insurance and low-income groups. Materials and methods Study population We examined data from the PROMISE cohort, which was derived from OCHIN Epic EHR. As a national nonprofit health IT consultancy, OCHIN provides a fully hosted EHR platform shared by more than 33 000 providers to support connected, whole-patient care for more than 6 million people in rural and medically underserved communities nationwide. We also used a table with parent-child linkage information13 from the Accelerating Data Value Across a National Community Health Center Network (ADVANCE) Clinical Research Network, which is led by OCHIN as a member of PCORnet. ADVANCE integrates outpatient EHR data and geocoded community-level data into a common data model, providing the nation’s most comprehensive set of health care and outcomes data for patients using community health organization services. This study was approved by the Institutional Review Board at Oregon Health & Science University. We included pregnancies identified using the PROMISE pregnancy algorithm14 (summarized below) that were probabilistically linked to a birth certificate from CA or OE. These two states were selected because they represented the largest proportion of pregnancies in the cohort (63%). Our final sample included 25 467 pregnancies from CA and 22 048 from OR, for a total of 47 515 pregnancies among 38 763 patients. Pregnancy start dates, drawn from linked birth certificate data, ranged from March 25, 2007 to July 16, 2019. Information used to identify pregnancies We developed a hierarchical method to identify pregnancies of 20-42 weeks gestation using discrete fields from the OCHIN outpatient EHR.14 This method prioritized fields that we anticipated to be most accurate for estimating pregnancy start and end dates. All pregnancy-related dating fields were extracted from Epic’s Clarity database, which houses structured clinical data. Parent-child EHR linkages were obtained from the ADVANCE data warehouse. Only pregnancies with estimable start and end dates were included in our study. We estimated pregnancy end dates from several fields in order of preference. First, we used child birthdates from parent-child EHR linkages in ADVANCE—these linkages are inferred algorithmically from account information, such as shared insurance plans or the child’s emergency contact information.13,15 If linked birthdates were unavailable, we used delivery dates from pregnancy “episodes of care” (described above in the “Background and Significance” section). Lastly, when neither of the above sources were available, we relied on encounter diagnosis and procedure codes indicating labor or delivery. These included standard codes such as the International Classification of Diseases (ICD-9 and ICD-10), Current Procedural Terminology (CPT), Healthcare Common Procedure Coding System (HCPCS), and select internal Epic codes—mainly lab and referral codes used by clinicians when standard options do not fully capture clinical documentation needs.5 If multiple pre- or postdelivery codes were present, we used the last predelivery or first postdelivery code to estimate the pregnancy end date. When both pre- and postdelivery codes were available, we used their midpoint to reduce bias, as either may be recorded one or more days off from the actual delivery. We also estimated pregnancy start dates using a hierarchy of EHR fields. First, we used pregnancy episode records, subtracting gestational age at birth (in days) from the delivery date. If unavailable, we used the last-recorded estimated due date (EDD)—which is typically based on the patient’s last menstrual period (LMP) and updated with the earliest ultrasound—subtracting 280 days. If no EDD was available, we used the last-recorded LMP. Finally, if none of these were available, we used the last encounter diagnosis code indicating gestational week,6 subtracting the number of weeks plus a 3-day offset. This offset assumes the midpoint of the gestational week, as ICD-10 Z3A codes represent a full 1-week range (eg, Z3A.12 is relevant from 12 weeks 0 days to 12 weeks 6 days). We tested alternative offsets (eg, 0 and 6 days) and found minimal impact on overall accuracy, supporting the use of the midpoint. When multiple gestational age codes were present, we used the last-recorded code, as it typically reflects the most updated estimate. Pregnancy date validation We used linked birth certificate records from OR and CA to validate pregnancy dates estimated from the EHR. Birth certificate records were probabilistically linked to OCHIN pregnancies using Link Plus,16 with methods described in detail elsewhere.14 Briefly, we matched the personal identifiers of the pregnant patient (eg, name, date of birth) and their child (eg, name, sex), from our EHR to state birth records. Linkages that did not match identically on all key identifiers were manually reviewed by 2 analysts to determine whether they matched. Following linkage, end-date estimates were validated against child birthdates, as recorded on the linked birth certificate, and start date estimates were validated against a date calculated from 2 birth certificate variables: delivery date minus the gestational age at birth (in days). We excluded 24 linked pregnancies because gestational age was missing on the birth record. Of the remaining sample, 25 467 of 30 829 (82.6%) EHR pregnancies from CA (2006-2019) and 22 048 of 24 617 (89.6%) EHR pregnancies from OR (2008-2019) were linked to birth records, yielding 47 515 pregnancies among 38 763 patients. Sociodemographic and clinical characteristics Sociodemographic and clinical characteristics of each pregnancy were extracted from the EHR to contextualize the study population and support generalizability. For all time-varying pregnancy characteristics, we relied on start and end dates from birth certificate records to define the pregnancy episode. Variables included the pregnant patient’s age at pregnancy start, the number of face-to-face encounters within the OCHIN network during each pregnancy, and the medical insurance type listed during the last pregnancy encounter, categorized as Public (Medicaid or Medicare), other public, private (employer-based or marketplace insurance), other private (eg, worker’s compensation, auto insurance, etc), or uninsured. We created a combined race and ethnicity variable in 2 steps: First, we identified patients as Hispanic if they self-reported being Hispanic/Latino or, if ethnicity was not disclosed, listed Spanish or Castilian as their preferred language. Individuals not identified as Hispanic were further classified by self-reported race as non-Hispanic (NH) American Indian/Alaskan Native (AI/AN), NH Asian, NH Native Hawaiian/Other Pacific Islander (NH/OPI), NH Multiple (indicating identification with more than 1 race), or unknown. Many OCHIN clinics are federally qualified health centers (FQHCs), which collect household income and family size for federal reporting and to determine eligibility for a sliding payment scale. We used this income information to characterize pregnancy-level income as a percentage of the federal poverty level (FPL), categorized as always ≤138%, always >138%, sometimes over and under 138%, or always unknown. Statistical analysis We compared pregnancy start and end dates estimated from the EHR with those recorded on linked birth certificates, using the absolute difference in days as our measure of accuracy. We assessed the accuracy of different EHR fields in 2 ways. First, we calculated disagreement when using the best available EHR fields according to our algorithm hierarchies for start and end dates, then systematically removed preferred fields from each hierarchy to evaluate the degree of increase in disagreement. This approach allowed us to assess the relative impact of each data source on the accuracy and precision of pregnancy date estimates. Second, for pregnancies where a specific EHR field was available, we calculated the absolute difference between the date estimated from that field and the date on the birth certificate. Lastly, we characterized each pregnancy-related diagnosis and procedure code5 based on when it first appeared during the pregnancies in our study. To assess how consistently codes were used within specific phases of pregnancy, we calculated the percentage of times each code appeared in each trimester or within the first 6 weeks postpartum. Additionally, for each code, we calculated the average number of days into a pregnancy (gestational age), the number of days prior to delivery, and the number of days after delivery when it was first recorded, to evaluate its accuracy for estimating a pregnancy start and end date. Results Our study included 47 515 pregnancies among 38 763 patients (Table 1). Over half of pregnancies were from CA (53.6%), the mean age at pregnancy start was 27 years, and the mean number of encounters during the pregnancy was 14.6. Most pregnancies were among patients who identified as Hispanic (62%) or NH White (27%), with smaller percentages among patients who identified as other races. Most pregnancies were among patients with an income level under 138% of the FPL for all measures during pregnancy (51%), and 82% of patients had public insurance coverage (ie, Medicaid or Medicare) at their last pregnancy encounter within the OCHIN network. Table 1Sociodemographic and clinical characteristics of pregnancies in the study.CharacteristicPregnancies, n (%) Age at pregnancy start (Mean, SD) 27 (6.1) Number of encounters (Mean, SD) 14.6 (7.5) State California 25 467 (53.6) Oregon 22 048 (46.4) Race/ethnicity Hispanic 29 266 (61.6) NH AI/AN 250 (0.5) NH Asian 1617 (3.4) NH Black 1689 (3.6) NH Multiple 438 (0.9) NH NH/OPI 271 (0.6) NH White 12 846 (27.0) Unknown 1138 (2.4) Income as percentage FPL during pregnancy Always ≤138 24 218 (51.0) Always >138 4887 (10.3) Over and under 5533 (11.6) Missing 12 877 (27.1) Last known payer during pregnancy Public (Medicaid or Medicare) 38 761 (81.6) Private (marketplace or employer) 4703 (9.9) Uninsured 3857 (8.1) Other public (eg, local programs) 135 (0.3) Other private (eg, worker’s comp) 59 (0.1)Abbreviations: AI/AN, American Indian/Alaskan Native; FPL, federal poverty level; NH, non-Hispanic; NH/OPI, Native Hawaiian/Other Pacific Islander. Sociodemographic and clinical characteristics of pregnancies in the study. Abbreviations: AI/AN, American Indian/Alaskan Native; FPL, federal poverty level; NH, non-Hispanic; NH/OPI, Native Hawaiian/Other Pacific Islander. Table 2 summarizes the accuracy of EHR-estimated pregnancy dates using our hierarchical algorithm. With all preferred fields available (step 1), start dates differed from birth certificates by an average of 3.7 days and end dates by 0.2 days. Removing child birthdates (step 2) excluded 8448 pregnancies; among the remaining, start dates differed by 3.6 days and end dates by 0.6 days. Excluding pregnancy episodes (step 3) left only 490 pregnancies, with start dates differing by 4.6 days and end dates by 38.4 days. Steps 4 and 5 removed EDD and LMP, further reducing the number of pregnancies with estimable dates, with larger differences from birth certificates in their estimated start and end dates. Table 2Accuracy of EHR-estimated pregnancy start and end dates, compared to state birth certificates, during stepwise removal of preferred EHR fields.Algorithm evaluation stepNumber of pregnancies with EHR-estimable start/end datesDays off from birth certificate on start date (mean, SD)Days off from birth certificate on end date (mean, SD) Step 1: Include all pregnancies in study, using the best fields available for date estimates End-date hierarchy: (1) child’s EHR birthdate when EHR charts are linked in ADVANCE, (2) delivery date from pregnancy episode, (3) pregnancy outcome codes. Start date hierarchy: (1) delivery date minus gestational age from pregnancy episode, (2) EDD minus 280 days, (3) LMP, (4) subtraction of weeks gestation listed on diagnosis codes 47 5153.7 (8.2)0.2 (3.7) Step 2: Recalculate start dates without using child’s EHR birthdate End-date hierarchy resorts to (1) delivery date from pregnancy episode or (3) pregnancy outcome codes. Start date hierarchy remains the same as above 39 0673.6 (6.3)0.6 (7.8) Step 3: Recalculate start and end dates without using pregnancy episode info End-date hierarchy resorts to (1) pregnancy outcome codes. Start date hierarchy resorts to (1) EDD minus 280 days, (2) LMP, and (3) subtraction of weeks gestation listed on diagnosis codes 4904.6 (9.4)38.4 (56.7) Step 4: Recalculate start and end dates without using EDD info End-date hierarchy remains the same as above. Start date hierarchy resorts to (1) LMP and (2) subtraction of weeks gestation listed on diagnosis codes 4378.1 (13.8)40.6 (58.4) Step 5: Recalculate start and end dates without using LMP info End-date hierarchy remains the same as above. Start date hierarchy resorts to (1) subtraction of weeks gestation listed on diagnosis codes 8215.3 (54.3)17.4 (42.2)Beyond step 5, our algorithm cannot estimate date ranges for any pregnancies.Abbreviations: EDD, estimated due date; EHR, electronic health record; LMP, last menstrual period. Accuracy of EHR-estimated pregnancy start and end dates, compared to state birth certificates, during stepwise removal of preferred EHR fields. Step 1: Include all pregnancies in study, using the best fields available for date estimates Step 1: Include all pregnancies in study, using the best fields available for date estimates End-date hierarchy: (1) child’s EHR birthdate when EHR charts are linked in ADVANCE, (2) delivery date from pregnancy episode, (3) pregnancy outcome codes. Start date hierarchy: (1) delivery date minus gestational age from pregnancy episode, (2) EDD minus 280 days, (3) LMP, (4) subtraction of weeks gestation listed on diagnosis codes End-date hierarchy: (1) child’s EHR birthdate when EHR charts are linked in ADVANCE, (2) delivery date from pregnancy episode, (3) pregnancy outcome codes. Start date hierarchy: (1) delivery date minus gestational age from pregnancy episode, (2) EDD minus 280 days, (3) LMP, (4) subtraction of weeks gestation listed on diagnosis codes Step 2: Recalculate start dates without using child’s EHR birthdate Step 2: Recalculate start dates without using child’s EHR birthdate End-date hierarchy resorts to (1) delivery date from pregnancy episode or (3) pregnancy outcome codes. Start date hierarchy remains the same as above End-date hierarchy resorts to (1) delivery date from pregnancy episode or (3) pregnancy outcome codes. Start date hierarchy remains the same as above Step 3: Recalculate start and end dates without using pregnancy episode info Step 3: Recalculate start and end dates without using pregnancy episode info End-date hierarchy resorts to (1) pregnancy outcome codes. Start date hierarchy resorts to (1) EDD minus 280 days, (2) LMP, and (3) subtraction of weeks gestation listed on diagnosis codes End-date hierarchy resorts to (1) pregnancy outcome codes. Start date hierarchy resorts to (1) EDD minus 280 days, (2) LMP, and (3) subtraction of weeks gestation listed on diagnosis codes Step 4: Recalculate start and end dates without using EDD info Step 4: Recalculate start and end dates without using EDD info End-date hierarchy remains the same as above. Start date hierarchy resorts to (1) LMP and (2) subtraction of weeks gestation listed on diagnosis codes End-date hierarchy remains the same as above. Start date hierarchy resorts to (1) LMP and (2) subtraction of weeks gestation listed on diagnosis codes Step 5: Recalculate start and end dates without using LMP info Step 5: Recalculate start and end dates without using LMP info End-date hierarchy remains the same as above. Start date hierarchy resorts to (1) subtraction of weeks gestation listed on diagnosis codes End-date hierarchy remains the same as above. Start date hierarchy resorts to (1) subtraction of weeks gestation listed on diagnosis codes Beyond step 5, our algorithm cannot estimate date ranges for any pregnancies. Abbreviations: EDD, estimated due date; EHR, electronic health record; LMP, last menstrual period. In Table 3, we assessed the accuracy of each EHR source and the number of pregnancies that could be estimated when that field was available in our algorithm, using the subset of pregnancies for which the field was present. For pregnancy start dates, the most accurate source was subtracting gestational age from the delivery date recorded in EHR pregnancy episodes, which applied to all 47 515 pregnancies and differed from birth certificates by an average of only 0.3 days (SD 0.4). Start dates estimated from last-recorded EDD were available for 46 722 pregnancies and differed by an average of 3.5 days (SD 8.2), while LMP was present for 41 949 pregnancies with an average difference of 6.9 days (SD 14.9). Diagnosis codes indicating gestational week were far less common (9199 pregnancies) and less accurate, averaging 6.5 days off (SD 12.8). Table 3Accuracy of individual EHR pregnancy fields compared to state birth certificates.EHR data sourceNumber of pregnancies with estimable start and end datesAbsolute difference from birth certificates (in days) mean (SD) Start date source Delivery date minus gestational age, calculated as the last-recorded EDD minus 280 days 47 5150.3 (0.4) Last-recorded EDD minus 280 days 46 7223.5 (8.2) LMP 41 9496.9 (14.9) Encounter diagnosis codes indicating weeks gestation 91996.5 (12.8) End date source Child’s birthdate from parent-child EHR linkage 26 7690.5 (10.2) Delivery date from pregnancy episode 47 5150.8 (0.4) Encounter diagnosis and procedure codes for delivery 49038.4 (56.7)Abbreviations: EDD, estimated due date; EHR, electronic health record; LMP, last menstrual period. Accuracy of individual EHR pregnancy fields compared to state birth certificates. Abbreviations: EDD, estimated due date; EHR, electronic health record; LMP, last menstrual period. For pregnancy end dates, child birthdates from EHR parent-child linkages were highly accurate (0.5 days difference, SD 10.2) and available for 26 769 pregnancies. Delivery dates from pregnancy episodes were nearly as accurate (0.8 days difference, SD 0.4) and applied to all 47 515 pregnancies. By contrast, end-date estimates based on diagnosis and procedure codes for pregnancy outcomes were both rare (490 pregnancies) and least accurate, averaging 38 days different from birth certificates (SD 56.7). Code-specific evaluations Table 4 lists 60 pregnancy-related diagnosis and procedure codes that met several criteria to be considered more accurate for pregnancy dating. Each code was observed (1) in at least 100 pregnancies, (2) at least 75% of the time in 1 phase (a trimester or during the first 6 weeks postpartum), (3) less than 20% of the time in any other phase, and (4) had an SD of <15 days around the average day it was first observed. A complete list of the 560 codes evaluated is provided in the supplemental materials. Table 4Measures of timing for first occurrence of select pregnancy codes during pregnancy.CodeCode setCode descriptionPregnancies with codeTrimester 1 (%)Trimester 2 (%)Trimester 3 (%)Postpartum (%)Days gestational ageaDays prior to deliverybDays after deliveryb n MeanSDMeanSDMeanSD Codes useful for dating the start of a pregnancy Z3A.08ICD-10-CM8 weeks gestation of pregnancy501-1000 99.00 0.860.14—58.2210.11214.9716.26Z3A.09ICD-10-CM9 weeks gestation of pregnancy501-1000 98.94 1.06——64.398.42208.8115.13Z3A.01ICD-10-CMLess than 8 weeks gestation of pregnancy>1000 98.59 1.220.090.0946.1013.92226.4818.04Z3A.10ICD-10-CM10 weeks gestation of pregnancy501-1000 95.84 4.020.14—72.4412.00201.4316.73Z3A.11ICD-10-CM11 weeks gestation of pregnancy501-1000 93.88 6.12——78.5610.76194.7917.1276813CPTUltrasound, pregnant uterus>1000 90.92 8.880.20—79.8713.95193.9118.70Z3A.12ICD-10-CM12 weeks gestation of pregnancy501-1000 86.30 13.70——85.799.73187.8814.84Z3A.14ICD-10-CM14 weeks gestation of pregnancy501-10004.82 95.02 0.16—100.4810.59171.9815.81Z3A.15ICD-10-CM15 weeks gestation of pregnancy501-10004.00 96.00 ——107.2310.22166.3714.39Z3A.17ICD-10-CM17 weeks gestation of pregnancy501-10001.84 98.03 0.13—120.8411.17151.7616.74Z3A.16ICD-10-CM16 weeks gestation of pregnancy501-10001.75 98.25 ——113.989.65158.6216.27Z3A.18ICD-10-CM18 weeks gestation of pregnancy501-10001.61 98.10 0.29—127.8513.06145.3316.59V28.81ICD-9-CMEncounter for fetal anatomic survey501-10000.97 97.85 1.18—136.6814.76136.5717.71Z3A.19ICD-10-CM19 weeks gestation of pregnancy501-10000.70 98.74 0.56—134.9610.58137.5316.53Z3A.20ICD-10-CM20 weeks gestation of pregnancy501-10000.34 99.20 0.46—142.639.90131.2514.44Z3A.23ICD-10-CM23 weeks gestation of pregnancy501-10000.27 98.52 1.21—163.3011.36110.2715.13Z3A.26ICD-10-CM26 weeks gestation of pregnancy501-10000.22 95.21 4.57—183.4310.9190.0314.42Z3A.21ICD-10-CM21 weeks gestation of pregnancy501-1000— 99.73 0.27—149.328.46124.1114.14Z3A.22ICD-10-CM22 weeks gestation of pregnancy501-1000— 99.31 0.69—156.389.62117.0214.77Z3A.24ICD-10-CM24 weeks gestation of pregnancy501-1000— 99.30 0.70—168.988.74104.9613.31Z3A.25ICD-10-CM25 weeks gestation of pregnancy501-1000— 97.42 2.58—176.889.4896.2614.87Z3A.27ICD-10-CM27 weeks gestation of pregnancy501-1000— 85.86 14.14—191.078.3182.9412.32 Prenatal codes useful for dating the start and/or end of a pregnancy Z3A.37ICD-10-CM37 weeks gestation of pregnancy>1000—0.08 99.92 —260.616.4015.707.55Z3A.36ICD-10-CM36 weeks gestation of pregnancy>1000—0.04 99.92 0.04253.866.6521.488.39Z3A.34ICD-10-CM34 weeks gestation of pregnancy>1000—0.12 99.88 —239.937.0634.629.92Z3A.38ICD-10-CM38 weeks gestation of pregnancy>10000.050.09 99.77 0.09267.098.6110.588.59645.1ICD-9-CMPost term pregnancy, unspecified as to episode of care or not applicable101-500—— 99.76 0.24281.826.155.353.75Z3A.39ICD-10-CM39 weeks gestation of pregnancy>1000—0.07 99.73 0.21273.637.107.226.19Z3A.32ICD-10-CM32 weeks gestation of pregnancy>1000—0.31 99.69 —226.037.0648.2510.22Z3A.33ICD-10-CM33 weeks gestation of pregnancy>1000—0.37 99.63 —232.827.6841.1310.56Z3A.35ICD-10-CM35 weeks gestation of pregnancy>10000.050.33 99.56 0.05246.828.9727.6410.65Z3A.40ICD-10-CM40 weeks gestation of pregnancy501-10000.15— 99.54 0.31279.489.805.008.45Z3A.41ICD-10-CM41 weeks gestation of pregnancy101-500—0.66 99.34 —283.8712.553.212.50Z3A.31ICD-10-CM31 weeks gestation of pregnancy>1000—0.75 99.25 —219.227.2254.3211.39O48.0ICD-10-CMPost-term pregnancy101-500—0.51 98.71 0.77280.5811.534.997.15Z3A.30ICD-10-CM30 weeks gestation of pregnancy>1000—1.82 98.18 —211.877.4862.2011.24Z3A.29ICD-10-CM29 weeks gestation of pregnancy>1000—4.13 95.87 —205.107.9768.9712.44 Postnatal codes useful for dating the end of a pregnancy O92.5ICD-10-CMSuppressed lactation101-500——— 100.00 13.919.8259430CPTCare after delivery101-500——— 100.00 24.4914.95Z39.0ICD-10-CMEncounter for care and examination of mother immediately after delivery101-500——0.45 99.55 16.9113.42O90.89ICD-10-CMOther complications of the puerperium, not elsewhere classified101-500——0.58 99.42 11.5510.16Z6208HCPCSPostpartum nutritional assessment>10000.030.300.47 99.19 21.3111.81Z6414HCPCSPostpartum health education assessment>10000.080.320.53 99.07 10.479.27Z1038HCPCSPostpartum>10000.200.220.52 99.06 30.3213.23O92.79ICD-10-CMOther disorders of lactation101-500—0.280.85 98.87 9.668.88V24.0ICD-9-CMPostpartum care and examination immediately after delivery501-10000.320.210.64 98.82 10.889.19Z6308HCPCSPostpartum psychosocial assessment>10000.130.430.65 98.79 18.1712.16Z39.2ICD-10-CMEncounter for routine postpartum follow-up>10000.460.930.68 97.93 14.8211.88676.34ICD-9-CMOther and unspecified disorder of breast associated with childbirth, postpartum condition, or complication101-5000.571.151.72 96.55 11.119.47V24.1ICD-9-CMPostpartum care and examination of lactating mother>10000.950.761.77 96.51 12.869.95676.8ICD-9-CMOther disorders of lactation, unspecified as to episode of care or not applicable101-5000.921.830.92 96.33 5.713.86648.24ICD-9-CMAnemia of mother, postpartum condition, or complication101-500—2.212.21 95.59 15.1912.59V24.2ICD-9-CMRoutine postpartum follow-up>10002.541.431.10 94.92 15.4111.76O99.345ICD-10-CMOther mental disorders complicating the puerperium101-5002.702.250.45 94.59 22.3612.76O92.29ICD-10-CMOther disorders of breast associated with pregnancy and the puerperium101-5001.064.231.06 93.65 11.2210.44O90.81ICD-10-CMAnemia of the puerperium101-500—1.914.78 93.30 18.2612.95Z39.1ICD-10-CMEncounter for care and examination of lactating mother>10000.481.035.49 93.00 14.5311.20669.71ICD-9-CMCesarean delivery, without mention of indication, delivered, with or without mention of antepartum condition101-5002.632.634.21 90.53 12.778.18676.9ICD-9-CMUnspecified disorder of lactation, unspecified as to episode of care or not applicable101-5005.362.681.79 90.18 16.1910.97648.44ICD-9-CMMental disorders of mother, postpartum condition, or complication101-5009.193.593.14 84.08 21.2012.20Abbreviations: CPT, Current Procedural Terminology; HCPCS, Healthcare Common Procedure Coding System; ICD-9, International Classification of Diseases, Ninth Revision, Clinical Modification.Note: Bold values indicate the highest percentage within each row.aGestational age was based on the date at which the code was first documented compared to the birth certificate start date.bDays prior to/after delivery was based on the code’s documentation date compared to the birth certificate delivery date. Measures of timing for first occurrence of select pregnancy codes during pregnancy. Abbreviations: CPT, Current Procedural Terminology; HCPCS, Healthcare Common Procedure Coding System; ICD-9, International Classification of Diseases, Ninth Revision, Clinical Modification. Note: Bold values indicate the highest percentage within each row. Gestational age was based on the date at which the code was first documented compared to the birth certificate start date. Days prior to/after delivery was based on the code’s documentation date compared to the birth certificate delivery date. The most accurate codes for estimating pregnancy start dates were ICD-10 Z-codes specifying gestational weeks. Although these Z-codes appeared in only 6% of pregnancy encounters, they were the most precise indicators when present. Early pregnancy ultrasounds and prenatal screening tests, typically performed at specific gestational ages, also provided reasonably accurate estimates of pregnancy start dates. For pregnancy end dates, the most accurate codes were also ICD-10 Z-codes specifying gestational weeks. Intrapartum codes related to labor and delivery, as well as postpartum codes—such as those for lactation issues or routine postpartum follow-up visits—may also help estimate the end date of a pregnancy. However, SDs for these codes were often greater than 10 days, meaning they were within 10 days of the true start or end date in about 68.2% of pregnancies but off by up to 20 days in an additional 27.2%. Discussion In this validation study, we found that the most accurate source for estimating pregnancy start and end dates in outpatient EHR data was pregnancy “episodes of care.” This source of information showed strong agreement with state birth certificate dates, with an average difference of less than 1 day. Estimated due dates and child birthdates—when pregnant patients could be linked to their children in the EHR—also provided reasonably precise estimates, with an average difference of fewer than 4 days. By contrast, estimates based on procedure and diagnosis codes were often different by a week or more. Our findings align with prior studies showing similar levels of accuracy.12 Previous pregnancy-dating algorithms using EHR data have typically relied on direct access to delivery outcome data from inpatient records.5,12,17,18 For example, strong concordance has been reported when using average gestational ages based on delivery outcomes.17 Even in our study, which was restricted to outpatient settings, the most accurate source of information was pregnancy episodes reconciled with external delivery records. The availability of these external records has likely improved through advances in data sharing technologies, such as Care Everywhere, which enables providers to access EHR data from other organizations using Epic. When reconciled delivery dates were available, our estimated pregnancy end dates differed from birth certificate dates by less than 1 day. In contrast, accuracy dropped sharply when reconciled delivery information was not available. Only 490 pregnancies could be dated using diagnosis and procedure codes alone, and the average end-date error rose to 38 days. This decline in accuracy reflects the inherent challenge of dating pregnancies using outpatient data alone where definitive delivery markers are often missing, as documented in prior studies.19 It may also reflect errors introduced during chart reconciliation, such as when staff enter external records from Care Everywhere. If the original diagnosis or procedure date cannot be captured—due to data entry errors or interoperability issues, records may be inadvertently attributed to the reconciliation date, which could occur months after delivery. Together, our findings illustrate a key tradeoff between coverage and accuracy: outpatient EHRs provide broad longitudinal coverage of prenatal care, enabling many pregnancies to be identified, but only a subset of those pregnancies can be dated with high accuracy unless reconciled delivery information or linked child data are available. Despite these challenges, several outpatient EHR fields provided relatively accurate estimates of pregnancy dates. That is, even without inpatient delivery records, start and end dates could be estimated within 1 week using EDD, LMP, diagnosis codes indicating gestational age, and child birthdates when parent-child relationships were linked in the EHR. Other studies have also leveraged additional outpatient data by incorporating hierarchical, layered sources—such as lab results and imaging—alongside diagnosis codes.19,20 Our findings add evidence that parent-child linkages and other supplemental fields can enhance pregnancy date estimation. Limitations There are limitations to be considered when interpreting these results. We acknowledge that our validation work is based on linkages to live birth certificates from OR and CA, and therefore our results may not be generalizable to miscarriages, stillbirths, or other regions. Other researchers report lower accuracy for identifying fetal losses and stillbirths, compared to live births, and for preterm vs full-term pregnancies,20,21 suggesting that validation of estimated pregnancy start and end dates for nonlive birth pregnancies compared to manual chart reviews or other methods is an important next step. Additionally, birth certificates provide a robust external source for validation, but they have their own limitations. Gestational age on birth certificates is often assessed as a count of completed weeks, or as a simple subtraction between the delivery date and a patient’s LMP. Birth certificates can also contain transcription errors by administrative staff. We also observed that end-date estimates based on child birthdates showed slightly more variation than those from pregnancy episode delivery dates, potentially indicating errors in parent-child EHR linkages. The parent-child linkage algorithm has previously been found to have 97.7%-99.8% accuracy,15 but can occasionally make mistakes like misattributing a child to another adult female in the household. Our study is also limited to pregnancies with sufficient EHR documentation to estimate start and end dates, which may reflect both strengths and limitations of data capture in safety-net clinic settings. Many OCHIN clinics are FQHCs, which are required to report pregnancy outcomes and often dedicate staff time to reconciling external delivery records. As a result, EHR data in OCHIN Epic may contain more complete pregnancy documentation than other outpatient EHRs. However, it is also possible that patients who are uninsured or underinsured may have reduced access to prenatal care, resulting in fewer documented encounters and less complete pregnancy data, making it less feasible to estimate their dates of pregnancy. Future directions This study highlights the need for further investigation into the use and accuracy of diagnostic codes in the context of pregnancy. For example, we occasionally found diagnostic codes for early miscarriages during pregnancies, even after attempting to select only live birth pregnancies and probabilistically linking pregnant patients to state birth certificates. These codes may have been intended to capture a history of early miscarriage or there could be other factors contributing to potential misclassification. Future research is needed to understand how providers use these codes and any barriers to entering accurate codes. Furthermore, pregnancy dating algorithms in the future may benefit from incorporating additional sources of discrete data. Lab results, such as human chorionic gonadotropin (hCG) levels, and prescription medications for early pregnancy may help to inform whether a pregnancy is occurring and its approximate gestational age. Incorporation of these data may help to improve the accuracy of pregnancy date estimates when combined with other sources of data. Future research should also examine whether the accuracy of pregnancy date estimates varies by timing of prenatal care receipt, to better distinguish between clinical uncertainty and data quality limitations. Conclusion Through systematic comparisons to state birth certificate data from 2 US states, we found that the most accurate data sources for estimating live birth pregnancy start and end dates in our outpatient EHR were from pregnancy episode data. Pregnancy end dates were also accurately estimated from child birthdates, when pregnant patients could be linked their children in the EHR, and pregnancy start dates were accurately estimated from EDD, LMP, and diagnosis codes with gestational age information. Most diagnosis and procedure codes were inaccurate indicators of pregnancy dates, with few exceptions such as ICD-10-CM Z-codes that specify a specific gestational age. For research questions that only require identifying a general time frame of pregnancy occurrence, intrapartum and postpartum diagnosis and procedure codes may suffice.5 However, we recommend caution when estimating pregnancy date ranges from isolated diagnosis and procedure codes in outpatient EHR systems. For investigations that require precise information on pregnancy timing, our findings highlight several other outpatient data fields—LMP, EDD, and child birthdates from parent-child relationships in the EHR—that would be beneficial to incorporate into live birth pregnancy dating. We suggest that hierarchical approaches to integrate clinical information may further improve the accuracy of pregnancy date estimation from EHR data. Supplementary Material Acknowledgments The research reported in this work was powered by PCORnet. PCORnet has been developed with funding from the Patient-Centered Outcomes Research Institute (PCORI) and conducted with the Accelerating Data Value Across a National Community Health Center Network (ADVANCE) Clinical Research Network. ADVANCE is a Clinical Research Network in PCORnet led by OCHIN in partnership with Health Choice Network, Fenway Health, University of Washington, and Oregon Health & Science University. ADVANCE’s participation in PCORnet is funded through the PCORI Award RI-OCHIN-01-MC. The PROMISE Study is supported by the National Institute of Diabetes and Digestive and Kidney Diseases (R01DK118484). Contributor Information Kristin Lyon-Scott, OCHIN, Inc., Portland, OR, 97201, United States. Jenine Dankovchik, OCHIN, Inc., Portland, OR, 97201, United States. Jenna Donovan, OCHIN, Inc., Portland, OR, 97201, United States. Jennifer Hauschildt, OCHIN, Inc., Portland, OR, 97201, United States. Kimberly K Vesco, Kaiser Permanente Center for Health Research, Portland, OR, 97227, United States. Janne Boone-Heinonen, Oregon Health and Science University, Portland, OR, 97239, United States; University of California, San Francisco, San Francisco, CA, 94158, United States. Teresa Schmidt, OCHIN, Inc., Portland, OR, 97201, United States. Author contributions Kristin Lyon-Scott (Conceptualization, Data curation, Formal analysis, Investigation, Methodology, Validation, Writing—original draft, Writing—review & editing), Jenine Dankovchik (Conceptualization, Data curation, Formal analysis, Investigation, Methodology, Writing—original draft, Writing—review & editing), Jenna Donovan (Conceptualization, Data curation, Writing—review & editing), Jennifer Hauschildt (Conceptualization, Data curation, Validation, Writing—review & editing), Kimberly K. Vesco (Conceptualization, Investigation, Methodology, Writing—review & editing), Janne Boone-Heinonen (Conceptualization, Funding acquisition, Investigation, Methodology, Resources, Supervision, Writing—original draft, Writing—review & editing), and Teresa Schmidt (Conceptualization, Data curation, Investigation, Methodology, Supervision, Validation, Writing—original draft, Writing—review & editing) Supplementary material Supplementary material is available at JAMIA Open online. Conflicts of interest The authors declare no competing interests. Funding PCORnet has been developed with funding from the Patient-Centered Outcomes Research Institute (PCORI) and conducted with the Accelerating Data Value Across a National Community Health Center Network (ADVANCE) Clinical Research Network. ADVANCE is a Clinical Research Network in PCORnet led by OCHIN in partnership with Health Choice Network, Fenway Health, University of Washington, and Oregon Health & Science University. ADVANCE’s participation in PCORnet is funded through the PCORI Award RI-OCHIN-01-MC. The PROMISE Study is supported by the National Institute of Diabetes and Digestive and Kidney Diseases (R01DK118484). The funding bodies had no involvement in the design and collection, analysis, or interpretation of the data or in writing the manuscript. Data availability The datasets generated and analyzed during this study are not publicly available due to sourcing patient-level data from multiple health systems, which have restrictions regarding the availability and rerelease of data under cross-institution agreements. Data are available from the corresponding author on reasonable request and with permission of all relevant parties. References Associated Data Supplementary Materials Data Availability Statement The datasets generated and analyzed during this study are not publicly available due to sourcing patient-level data from multiple health systems, which have restrictions regarding the availability and rerelease of data under cross-institution agreements. Data are available from the corresponding author on reasonable request and with permission of all relevant parties.