How the anesthesia end time was charted¶
The charted anesthesia end time is a mixture of 4 ways of writing a clock time (ceiling_30min, ceiling_10min, ceiling_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 | Anaesthesia end time, Anaesthesia duration, Operation end to anaesthesia end |
Background¶
- Anaesthesia end is a charted event time with a 1-minute chronon.
- It is almost entirely rounded: 95% fall on a 5-minute clock mark, with clear 10-minute preference.
Data¶
- Anaesthesia ends from
clinical_data.csv, modelled against the recording end. - Excluded: the anaesthesia ends derived from an imputed op end (stored with floating-point noise), the 1900 placeholder in case 4476, and two values outside the model range, case 3980 (+720 min, probably a 12-hour clock error) and case 4959 (+1,441 min, probably a date error); and case 1563, whose 1900 admission date makes every time in it invalid. 6,254 are modelled.
- 2,037 of the 6,388 anaesthesia ends (32%) fall after the end of recording. This is plausible, since monitors come off before handover, but these cannot be checked against the signals.
Method¶
- Anaesthesia end = recording end + G, with G a log-spline density (K = 8).
- Nearest, floor and ceiling anchors were compared by BIC.
- Modes at 5, 10, 30 minutes and the clock minute were fitted. Hour of day, emergency status and department were tested as covariates.
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 aneend 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 aneend checks that the stored fit
statistics equal the library's own evaluation
(fitcheck).
Results¶
- Minutes :00, :10, :20, :30, :40 and :50 have 706–872 cases each, against 192–271 at the 5s. :00 and :30 are slightly higher (872 each).
- Rounded ends are written up to the next mark: ceiling beats nearest by 168 BIC points and floor by 782. An end charted as 11:30 means "finished by 11:30".
- Hour, emergency status and department made no difference.
- The true end is a median 3.4 min before the charted end (p10–p90 2.1–6.0 min), so anaesthesia durations computed from charted times run long by a few minutes.
- Since vitaldb-resolution v0.6.0 (18 October; model version 2): the two out-of-range records are excluded (not corrected), and the stored and recomputed log-likelihoods now agree: the whole gap came from those two records. The parameters are unchanged.
Discussion¶
- Ceiling rounding for anaesthesia end and floor rounding for op end together inflate charted emergence by about 6 min (median 6.0 min, p10–p90 4.3–8.6;
spread.json). - Correction: an earlier fit did not exclude the derived ends, because their noise (about 10⁻⁶ s) slipped under the test threshold. The model was refitted without them and with a wider offset range; the conclusions are unchanged.
- Before v0.6.0 the package's log-likelihood differed from the stored one by +1,381.5: the two out-of-range records had been left in the fit at probability 10⁻³⁰⁰ (−690.8 each). They are constants, so the parameters were unaffected; model version 2 excludes them and the two now agree.
Observations it supports¶
| Observation | Status | Summary |
|---|---|---|
| Anaesthesia record times on 5-minute marks are rounded up | established | An anaesthesia start or end entered on a 5-minute mark was rounded up to it: the event happened in the 5 minutes before, and on average a little earlier still. Clear for anaesthesia end; for anaesthesia start the margin is small, and the value model (How the anesthesia start time was charted) prefers rounding to the nearest mark. |
Limitations¶
- Ends charted after the recording stops cannot be validated against the signals.
Open questions¶
- Two out-of-range end times as 12-hour or date errors (weakly supported hypothesis). Two anaesthesia-end records lie at 720 and 1,441 minutes, outside the modelled range. A 12-hour clock slip and a one-day date error are the obvious explanations; neither is confirmed.
Model¶
Model file: …/models/aneend.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 | ceiling_30min | 30 clock minute (ceiling) | 1.8 % | 1.8 % |
| 2 | ceiling_10min | 10 clock minute (ceiling) | 52.1 % | 51.1 % |
| 3 | ceiling_5min | 5 clock minute (ceiling) | 87.1 % | 41.0 % |
| 4 | clock_minute | 1 clock minute (floor) | the rest | 6.1 % |
| Recorded resolution | 1 min (chronon) (modelled at 1) |
| True-value density | reference_offset_spline |
| Covariates | ref (recording end clock, minutes) |
| Fitted on | 6,254 records (clinical_data.csv) |
| BIC | 23,456 |
| Fitted | 2026-10-18 |
Worked examples¶
| Example | Side | Status | Summary |
|---|---|---|---|
| A regression that carries rounding uncertainty through | value | current | Acute kidney injury after surgery against intraoperative urine output (mL/kg/h), fitted once on the recorded numbers and once per draw from the true-value distributions: the rounding moves 14% of cases across the oliguria threshold, but widens the confidence interval of the cohort's regression by at most 4%. |
| Oliguria labels for a prediction model | value | current | One label per patient, oliguric or not, from three rounded numbers: 10% of labels are uncertain and 2.6% are expected to be wrong, which sets a floor under the error any model can be measured to have. A typical model is barely affected; a good one is. |
| Urine output in mL/kg/h as a distribution | value | current | Intraoperative urine output per kilogram per hour, from three rounded inputs, as a probability distribution per case: one case in ten cannot be placed confidently on either side of 0.5 mL/kg/h. |
Code¶
- vitaldb-resolution:
tools/fit_timestamps.py,tests/test_fit_consistency.py,vitaldb_resolution/engine.py
Tags: generated, vitaldb-resolution