Skip to content

How the operation end time was charted

The charted operation end time is a mixture of 4 ways of writing a clock time (floor_30min, floor_10min, floor_5min, clock_minute), modelled as an offset from a device time.

Date 2026-10-18
Status current
Methods Rounding, heaping and value resolution, Clinical and laboratory times
Variables Operation end time, Operation end to anaesthesia end, Operation duration

Background

  • Op end is a charted event time with a 1-minute chronon.
  • About one in twelve op ends appears to have been set from the recording itself rather than from the record (see the imputed-times study).

Data

  • 5,850 op ends, after excluding the 537 imputed from the recording (598–604 s before it ends; status imputed) and case 1563 (a 1900 admission date makes every time in it invalid).
  • 92 op ends do not share the sub-minute offset of the other charted times in their case and are flagged clock_offset_mismatch.
  • 52 op ends come after anaesthesia end and 108 equal it (anaesthesia ends with placeholder dates left out; 53 with them; screens.py timestamp-imputed-and-conformance). Leaving out the imputed op ends (7 and 1 of them), the library flags 45 (order_violation) and 107 (same_time).

Method

  • The true op end is modelled relative to the recording end with a log-spline offset (K = 12, chosen by BIC).
  • Nearest, floor and ceiling anchors were compared, along with 10- and 30-minute modes.
  • Posteriors were compared across K, because the latent is narrow relative to the grid.

Commands (vitaldb-resolution, with $R the VitalDB folder): its parameters are those fitted on 13 October by a fitter not kept in the repository; v2 re-evaluated only the fit statistics. python tools/fit_timestamps.py $R/clinical_data.csv opend refits it with the library likelihood for comparison (add --write to replace the model). VITALDB_DATA=$R python -m pytest tests/test_fit_consistency.py -k opend checks that the stored fit statistics equal the library's own evaluation (fitcheck).

Results

Bar chart of charted times by minute past the hour, with tall bars on multiples of five.
The minute past the hour of every charted time: the heaps on multiples of 5, and at the standard first-case times, are the rounding modes the model fits.
  • The anchor is floor (nearest is 173 BIC points worse, ceiling 312): op ends are written as the 5-minute mark at or before the true end.
  • This is the opposite of anaesthesia end, which is written up to the next mark.
  • The true op end is on average about 2.5 min after the charted one, so charted op durations run about 2.5 min short.
  • The package reproduces the stored log-likelihood within 0.14.

Discussion

  • Related times are rounded in opposite directions, so the anchor is fitted per variable and never assumed shared.
  • The imputed op ends mark the patient's disconnection from the monitors, not the end of the operation: recordings end 10 minutes after the SpO₂ and the ECG heart rate stop (Lee 2026). Excluding them is right.
  • Intervals inherit both biases: charted emergence (op end to anaesthesia end) is inflated by about 6 min (median 6.0 min, How the anesthesia end time was charted).

Observations it supports

Observation Status Summary
Op end was filled in from the recording end in 537 cases established In 537 cases (8.4%) the op end is exactly 10 minutes before the end of the recording. Recordings end 10 minutes after the SpO₂ and the ECG heart rate stop (Lee 2026), so these op ends are the moment the patient was disconnected, filled in where none was charted. These cases are concentrated in thoracic surgery and under sedation or spinal anaesthesia.

Limitations

  • The latent has two narrow peaks (13 and 17 min before the recording ends). With most values on a 5-minute grid, fine structure in a narrow latent is hard to separate from rounding, so these peaks should not be read as real.

Open questions

  • Where the imputed op ends are (next step). Mapped on 18 October: thoracic surgery and cases under sedation or spinal anaesthesia have far more imputed op ends than the rest (Op end was filled in from the recording end in 537 cases). The model already excludes them; analyses that use op end should check whether their subgroup is one of these.

Model

Model file: …/models/opend.model.json. Read from the pinned snapshot of vitaldb-resolution at commit bb03ddfc8a (2026-10-18).

How a true value becomes the recorded one. The rules are tried in order: a record not taken by an earlier rule is taken by this one with the probability shown (where its condition holds); the last rule takes the rest. With no conditions, the shares follow directly.

Order Rule Rounds to Probability if reached Share of records
1 floor_30min 30 clock minute (floor) 0.3 % 0.3 %
2 floor_10min 10 clock minute (floor) 4.1 % 4.1 %
3 floor_5min 5 clock minute (floor) 95.8 % 91.5 %
4 clock_minute 1 clock minute (floor) the rest 4.1 %
Recorded resolution 1 min (chronon) (modelled at 1)
True-value density reference_offset_spline
Covariates ref
Fitted on 5,850 records (clinical_data.csv)
BIC 18,944
Fitted 2026-10-18

Code

Tags: generated, vitaldb-resolution