|
| 1 | +# MIMIC-IV-ED timing caveats |
| 2 | + |
| 3 | +Researchers sometimes see `ed.pyxis.charttime` or `hosp.prescriptions.starttime` |
| 4 | +values that fall **before** `ed.edstays.intime` for the same stay. That pattern |
| 5 | +is expected in the raw data and is usually **not** a join bug. |
| 6 | + |
| 7 | +This note summarizes how those clocks differ and how to treat them. It does not |
| 8 | +change any ETL scripts — only documents behavior already present in the public |
| 9 | +files. See also [issue #1910](https://github.com/MIT-LCP/mimic-code/issues/1910). |
| 10 | + |
| 11 | +## Clocks involved |
| 12 | + |
| 13 | +| Source | Column(s) | What it usually represents | |
| 14 | +|--------|-----------|----------------------------| |
| 15 | +| `ed.edstays` | `intime` / `outtime` | ED stay registration window from the ADT / ED tracking system | |
| 16 | +| `ed.pyxis` | `charttime` | Pyxis (automated dispensing cabinet) event time | |
| 17 | +| `hosp.prescriptions` | `starttime` / `stoptime` | Order start/stop as recorded in the pharmacy / order system | |
| 18 | +| `ed.medrecon` | `charttime` | Medication reconciliation documentation time | |
| 19 | +| `ed.vitalsign` | `charttime` | Documented vital-sign observation time | |
| 20 | + |
| 21 | +These systems are **not** forced onto a single synchronized clock in the |
| 22 | +released tables. Small negative offsets (event slightly before `intime`) are |
| 23 | +common; large offsets need case-by-case review. |
| 24 | + |
| 25 | +## Why events can precede `edstays.intime` |
| 26 | + |
| 27 | +Common, non-exclusive explanations: |
| 28 | + |
| 29 | +1. **Registration lag.** Care (triage meds, Pyxis pulls) can start before the |
| 30 | + ED stay row is fully registered, so ADT `intime` is later than the clinical |
| 31 | + action. |
| 32 | +2. **System clocks differ.** Pyxis, pharmacy, and ADT may stamp with different |
| 33 | + device or server times; MIMIC does not re-align them. |
| 34 | +3. **Order times ≠ administration times.** `prescriptions.starttime` is an |
| 35 | + **order** time. It can be entered retrospectively, copied from prior orders, |
| 36 | + or set for a planned start that is not the first Pyxis dispense. |
| 37 | +4. **Linkage across modules.** Joining ED stays to `hosp.prescriptions` via |
| 38 | + `subject_id` / `hadm_id` can pull hospital-ward orders that are temporally |
| 39 | + near the ED window but not strictly inside it. |
| 40 | + |
| 41 | +None of these are labeled in the public schema as "manual" vs "automatic" — the |
| 42 | +tables do not expose that provenance flag. |
| 43 | + |
| 44 | +## Practical guidance |
| 45 | + |
| 46 | +- Treat `edstays.intime`/`outtime` as the **administrative** ED window, not a |
| 47 | + hard clinical filter that every charted event must satisfy. |
| 48 | +- Prefer `ed.pyxis.charttime` when studying **dispensing** in the ED; prefer |
| 49 | + `prescriptions` when studying **orders**; do not assume they agree. |
| 50 | +- If you need "events during the ED stay," decide explicitly whether to: |
| 51 | + - keep events with `charttime < intime` within a small tolerance (e.g. 1–2 h), |
| 52 | + - drop them, or |
| 53 | + - flag them for sensitivity analysis. |
| 54 | +- Do **not** rewrite `intime` from the earliest Pyxis time without documenting |
| 55 | + the rule — that invents a derived stay definition. |
| 56 | + |
| 57 | +## Related reading |
| 58 | + |
| 59 | +- PhysioNet MIMIC-IV ED module overview: <https://mimic.mit.edu/docs/iv/modules/ed/> |
| 60 | +- Table pages for `edstays` and `pyxis` under that module |
| 61 | +- Analogous ICU charting lag is discussed for `chartevents` (events after |
| 62 | + `outtime` / before `intime` appear in raw ICU data as well) |
0 commit comments