Supplementary methods

S1. Clinical identification and analysis population

Adults aged at least 18 years were screened using the inherited clinical rules. MIMIC-IV traumatic brain injury (TBI) identification used ICD-9 850–854 or ICD-10 S06 codes with an initial-encounter suffix A. Subarachnoid haemorrhage (SAH), intracerebral haemorrhage (ICH), and ischaemic stroke used 430/I60, 431/I61, and I63 or infarction-designated 433x1/434x1 codes, respectively. Other intracranial haemorrhage, unspecified stroke, non-initial S06 codes, and isolated skull-fracture codes were retained as uncertain unless another qualifying code existed. eICU identification combined structured diagnosis paths, admission labels, and available ICD codes. Composite labels potentially including unruptured aneurysms were insufficient by themselves. The complete executable vocabulary is retained in inherited_clinical_codes.py.

Recorded cardiac-arrest, anoxic-injury, or ECMO flags excluded the corresponding hospital admissions in MIMIC and ICU stays in eICU. Absence of a detected flag did not establish absence of these conditions; eICU ECMO ascertainment was particularly incomplete. Subtypes could overlap. Neither diagnosis onset nor recognition before sampling was established, and no independent clinical adjudication was performed. The reference group had no detected ABI code under these rules and was not a clinically confirmed ABI-free group. Eligibility did not require mechanical ventilation, complete FiO2, neurological scores, or treatment records. Observations were restricted to the first 72 hours of each ICU stay and to actual accepted, pairable blood-gas measurements.

S2. Specimen evidence, measurement pairing, and availability

MIMIC pO2 item 50821 was linked by specimen_id to specimen-type item 52033; ART, ART., or ARTERIAL was required. Missing, conflicting, venous, mixed-venous, and capillary designations were excluded. eICU required the arterial-named paO2 test, labtypeid 7, and compatible pressure units. Its stay/draw-time key is a specimen proxy, not an individual specimen identifier. Recorded arterial evidence therefore differed between databases, and neither source constituted independently witnessed sampling.

Accepted pressure units were mmHg, torr, or kPa, with kPa multiplied by 7.50061683. Conflicting eICU interface/system units were rejected. PaO2 had to be finite, positive, and no greater than 800 mmHg; censored, cancelled, or error-labelled results were excluded. Values below 20 or above 600 mmHg were flagged without automatic deletion. Exact duplicates were collapsed; conflicting values, specimen labels, or sample times at the same key were excluded. No record was removed because it disagreed with SpO2 or a model estimate.

The primary pair used the latest valid SpO2 measured at or before sampling, within 10 minutes, from the same stay. SpO2 had to be finite and within (0,100], with explicit percentage units in MIMIC. No fractional rescaling, future observation, interpolation, or oxygen-value imputation was used. eICU vitalPeriodic.saO2 denotes archived monitor SpO2, represented by five-minute medians. Same-time conflicting monitor values were excluded.

Historical eligibility required a distinct earlier paired sample in the same stay. Its final PaO2 and, for MIMIC, specimen-type information had to be recorded strictly before the current draw, with valid non-negative recording delays; its paired SpO2 had to be recorded by the current draw. The most recent eligible prior sample was selected. Final duplicate availability used the latest relevant recording time. Current blood-gas analytes were never predictors.

The secondary MIMIC information-system analysis first filtered monitor records to measurement time ≤ entry time ≤ current draw, then selected the latest valid timestamp within the unchanged 10-minute window. Only records already known at the draw determined duplicate conflicts. Identical records could establish visibility at their earliest entry; a conflicting timestamp was skipped. Histories were rebuilt from these pairs. A separate calculation changed current selection while retaining original historical inputs. eICU had only an observation-time availability proxy. These analyses did not reconstruct every laboratory revision or validate real-time clinical access.

S3. Partitioning, model specification, and reproducibility

MIMIC admission-era intervals were calculated by adding ICU-admission year minus anchor_year to both anchor_year_group endpoints. Patients were early if their latest interval endpoint was before 2020, late if their earliest endpoint was at least 2020, and otherwise boundary-spanning. All encounters of a patient remained together. Boundary-spanning patients were descriptive only. Among early patients, the first eight hexadecimal digits of SHA256("oxygen-v1|" + patient_id), modulo five equal to zero, assigned calibration; others formed training.

Categories were ordered below80, 80to120, above120, with 80 and 120 included in the middle category. Let s denote current SpO2, u hours since ICU admission, z=log(prior PaO2/100), and h=log(1+hours since prior sampling). B used s, max(s−90,0), max(s−94,0), max(s−96,0), max(s−98,0), age capped at 90, and log(1+u). P used z, z², h, and zh. C combined the B and P features and prior paired SpO2. P, B, and C used identical historical-eligible training observations. B_all used the B features on all eligible training pairs. Missing age was replaced by the training median, calculated separately within each cross-validation training fold. Final age medians were 62 years for P/B/C and 63 for B_all.

Models used standardisation followed by L2-penalised multinomial logistic regression (lbfgs; maximum 5,000 iterations; tolerance 10⁻⁸), with unweighted observations and no class balancing. Three-fold patient-grouped cross-validation selected inverse regularisation strength from 0.01, 0.1, 1, and 10 by minimum pooled out-of-fold multiclass Brier score; ties favoured stronger regularisation. Selected values were 10 for P/B/C and 1 for B_all. Models were refitted on their respective training sets only. No held-out recalibration occurred.

For each class, the linear predictor is its intercept plus the sum of standardised features multiplied by the corresponding coefficients. Standardise each feature by subtracting its training-set mean and dividing by its training-set standard deviation. Exponentiate the three class linear predictors and divide each exponential by their sum to obtain the class probabilities. The training code is provided in Additional file 2; fitted objects and complete reconstruction parameters are excluded, as explained in the main data-availability statement. A assigns one-hot categories using SpO2 <94, 94–98, and >98%; P0 carries forward the prior PaO2 category. Neither is a calibrated probability model.

S4. In-target decisions and threshold selection

Ordinary decisions used the maximum-probability category. A false in-target decision meant actual PaO2 <80 or >120 mmHg among observations assigned to the middle category. Coverage was the fraction assigned in target, reported within historical-eligible observations and separately among all main pairs. Missing history was not an in-target result.

Selective thresholds for P/B/C were evaluated only in the MIMIC historical-eligible calibration set, with B_all evaluated separately in all calibration pairs. Candidates required p(in target) ≥t for t=0.50–0.99 in increments of 0.01, at least 30 selected pairs from 20 patients, and empirical false-in-target proportion ≤5%. The qualifying threshold with greatest coverage would be retained, breaking ties towards the higher threshold. None qualified. Null thresholds therefore produced zero selective coverage and undefined error proportions in subsequent datasets. The criterion concerned empirical calibration-set error, not a confidence-bound risk guarantee. Descriptive test-set curves were not used to select replacement thresholds.

S5. Uncertainty, heterogeneity, and sensitivity analyses

Multiclass Brier score was the mean sum of three squared probability errors, without division by three. The primary contrast was C−B in eICU. Negative differences favoured C. Confidence intervals used 1,000 patient-cluster bootstrap replicates with seed 20261007 and percentile limits. All observations of each sampled patient shared a multiplicity, including observations across hospitals. Models remained fixed; intervals therefore excluded development uncertainty and hospital-population sampling uncertainty. Patient-equal and hospital-equal summaries were secondary. Hospitals with at least 20 historical-eligible patients were displayed individually; smaller centres were pooled, and leave-one-hospital-out contrasts were descriptive.

Calibration used ten fixed probability bins and one-versus-rest logistic calibration intercepts/slopes, clipping probabilities to [10⁻⁶,1−10⁻⁶] for logit calculations. AUROCs and calibration coefficients were descriptive point estimates. Information-age curves fitted restricted cubic splines to C−B losses against log(1+hours), with knots at 1, 6, 12, and 24 hours and patient-cluster bands. Prespecified strata were (0,6], (6,12], (12,24], and (24,72] hours.

Frozen models were applied without refitting to five-minute preceding pairs, eICU pairs recorded 5–10 minutes before sampling, and corrected MIMIC availability pairs. Alternative PaO2 bounds of 60–120 and 80–150 mmHg were descriptive fixed-rule reclassifications. Subtype and unmatched reference-group summaries were descriptive. These analyses estimated neither safe sampling intervals nor treatment effects, and no fairness evaluation was performed.
