Methodology

Draft of the Methods section for a forthcoming paper on elderly-care alarm fatigue and AI-assisted nurse-call triage. Comments to the project lead are welcome — see the ethics page for the contact channel.

1. Data source

The ring platform records every nurse-call event into a per-call document in a Firebase Firestore collection (calls). Each document carries:

  • createdAt — server timestamp (UTC) of when the patient initiated the call (via gaze or voice).
  • priority — integer 1–5 from the AI triage engine (see app/api/chat/route.ts: prompts, fallback rules, and the local rule-based safety net are open source).
  • reasonCodes — normalized English category labels (lib/calls/reasons.ts).
  • hospitalId — internal identifier, used only to count unique participating facilities; never published.
  • responseTimeSec — optional, when measured: seconds between call creation and nurse acknowledgement.

2. Anonymization pipeline

A nightly Cloud-Function job (/api/cron/aggregate-phil, scheduled at 00:05 UTC) reads the previous UTC day's calls via the Firebase Admin SDK and applies the following pipeline before writing anything to the public phil_aggregates collection:

  1. PII strip: only createdAt, priority, reasonCodes, hospitalId, and responseTimeSec are read. Free-text fields (transcripts, summaries, sender names, notes) are never loaded into the aggregator.
  2. Counting: we compute per-priority counts, hourly UTC histograms, and reason-category counts.
  3. k-anonymity (k=5): any reason category with fewer than 5 observations on the day is removed from the published bucket; its members are aggregated into a single __suppressed__ entry that exposes only the total count of suppressed members.
  4. Statistical envelopes: binomial proportions (emergency rate, AI-completion rate) are reported with their Wilson 95% confidence intervals. Response-time stats are reported as median, p90, p95.
  5. Sample-size flag: documents with fewer than 30 observations are marked insufficient_sample: true, and the public dashboard hides point estimates from these rows.
  6. Hospital identifiers:only the cardinality of the participating-facilities set is published. Hospital IDs are held only in the cron job's transient memory and never written to the public document.

3. Statistical methods

  • Binomial CIs: Wilson (1927) score interval, as recommended by Newcombe (1998) for small samples and proportions near 0 or 1. Implementation in lib/stats/confidenceInterval.ts.
  • Percentiles: Hyndman–Fan type 7 (linear interpolation), matching NumPy / R defaults. Implementation in lib/stats/percentile.ts.
  • Trend tests (planned): Cochran–Armitage trend test for ordered priority distributions over time, once a ≥90-day window is available.

4. Known limitations

  • Selection bias: the participating facilities are early adopters of gaze / voice nurse-call interfaces; their patient mix is unlikely to be representative of all nursing-care populations. We will publish facility-level characteristics in aggregate form once enough partners join (n ≥ 10).
  • Triage measurement:the priority value is produced by an AI triage model (Gemini 2.5 Flash by default, with a hand-coded fallback). The “1.5% emergency” headline should therefore be read as “the proportion of calls the triage engine classified as priority ≥ 4.” Validation against clinician adjudication is a planned follow-up study.
  • Response time: currently only reported when partner facilities instrument acknowledgement events. Coverage is partial.
  • Diurnal effects: we publish hourly histograms in UTC; consumers should shift to local time when interpreting.

5. Ethics

See the dedicated ethics and governance page for the consent template, partner-hospital policy, and the data-deletion request channel.

6. Reproducibility

All aggregation code, statistical helpers, and the public API handler are open source in the ring-core repository under the following paths:

  • lib/phil/aggregate.ts — pure aggregator
  • lib/stats/confidenceInterval.ts — Wilson CIs
  • lib/stats/quality.ts — k-anonymity + reliability flags
  • app/api/cron/aggregate-phil/route.ts — daily writer
  • app/api/v1/insights/aggregates/route.ts — public JSON API