
- Client
- Gauss Surgical
- Role
- Sole engineer, contracted through Fresh.
- Timeline
- August 2020 to October 2021
- Tags
-
- iOS
- Apple Watch
- UIKit
- SwiftUI
- Healthcare
- Push Notifications
- Firebase
- JavaScript
- Node.js
TritonView is a blood loss monitoring app for Gauss Surgical. It shows surgical teams the latest blood loss for each operating room on iPhone. When blood loss crosses a critical threshold, it alerts them on iPhone and Apple Watch. The hospital’s data is polled once a minute. When a new reading arrives, the iPhone app updates instantly.
Fresh contracted me for the project. I worked closely with their designer and was the only engineer. I built the iPhone and Apple Watch apps, plus the Firebase backend that connects them to Gauss’s existing monitoring system. We piloted the app at Brigham and Women’s Hospital in Boston.
The Problem
Gauss already had a system that measures blood loss during surgery. TritonView’s job was to get that data to the surgical team, on devices they already carry, as soon as it was available.
An operating room is a hard environment for an app for several reasons. Hands are busy, and attention is on the patient. Hospital networks aren’t always reliable. Alerts must be hard to miss, and the app must handle dropped connections.
What the App Does
- Shows the latest blood loss for each operating room on iPhone
- Shows the 10 most recent unarchived alerts on Apple Watch
- Sends a push notification when blood loss crosses into a more serious stage
- Delivers alerts to a cellular Apple Watch even when the phone is out of reach
- Uses haptics and visual alerts designed with the operating room in mind
How It Works
Gauss’s system measures blood loss in each operating room and exposes it through an API. Every minute, a scheduled Firebase Cloud Function, written in JavaScript on Node.js, polls that API and writes a snapshot of each room to Firebase Realtime Database. A database trigger then decides whether anyone needs an alert. The iPhone app listens to the database for live changes. The Apple Watch app loads recent alerts from the same database when it becomes active. Only the backend talks to the Gauss API.
Two design decisions had the biggest effect on how the system works.
Decision 1: Put Firebase in Front of the Hospital API
With Firebase between the devices and the Gauss API, the iPhones and Apple Watches don’t need to poll it. Cloud Functions handle polling, registration and alerts, so there’s no server to run.
A scheduled function polls once a minute and writes the results to the database. The rest of the system builds on that:
- The iPhone app subscribes to database updates instead of polling. A new reading shows up on screen the moment the poller writes it.
- Fetching data and sending alerts are separate. The poller only writes data, and a database trigger decides whether to alert. A useful side effect: I could test an alert by editing a value in the Firebase console.
- The watch uses Firebase’s REST API instead of a live listener. When I built the watch app, Firebase’s database SDK didn’t support watchOS. The app fetches the latest alerts over HTTPS after sign-in and whenever the app becomes active. Both apps access the database through the same protocol, so the UI code doesn’t need to know which transport it’s using.
- The iPhone and the watch register for push notifications separately. With a cellular Apple Watch, alerts arrive even when the phone isn’t nearby.
There are trade-offs. Because the hospital data is polled once a minute, a reading can be up to about a minute old by the time it reaches the apps. Once it’s in the database, the iPhone app shows it instantly. On the watch, a push notifies the user but doesn’t refresh the alert list. The new alert appears in the list the next time the app becomes active.
Decision 2: Alert Only When Things Get Worse
Blood loss data arrives every minute. A simple “above the threshold, send an alert” rule would push the same alert to every phone and watch, every minute, for the whole bleed. Clinicians would learn to ignore it fast.
Instead, alerts work in stages. The server stores the highest stage it has alerted on for each room. It only sends a push when blood loss crosses into a higher stage. That means a small number of alerts per procedure, and each one means “this just got worse.” The stage resets for each new case.
Gauss defined the alert stages and thresholds, which vary by department. I implemented them on the server.
Since the poller rewrites every room every minute, the trigger exits early if nothing relevant has changed. The alert logic only runs when something moved.
The trade-off: the thresholds were built for one hospital. Adding another would mean making them configurable.
The iPhone and Apple Watch Apps
The iPhone app is built with UIKit using MVC and dependency injection. Dependencies are passed in rather than created inside view controllers, which made the code easier to test and maintain. The Apple Watch app is built with SwiftUI.
Fresh’s designer designed the interface for a high-stress environment. On Apple Watch, haptics help an alert get noticed even when nobody is looking at the screen.
Testing and Reliability
I set up the Firebase emulator with test data, so I could run the whole pipeline locally, from API data to push notification, without waiting on a live procedure. I also wrote unit and integration tests for the parts that had to work during a procedure.
Hospital Wi-Fi can drop at any time, so I added error handling and recovery for lost connections to the iPhone app. It keeps previously loaded data available offline. Live data and alerts require a connection.
We also tested the app with medical professionals to make sure it was usable under surgical conditions.
Result
TritonView was piloted at Brigham and Women’s Hospital in Boston and distributed through TestFlight. It was never published on the App Store. The pilot included the iPhone and Apple Watch apps and the Firebase backend connected to Gauss’s monitoring system, giving surgical teams up-to-the-minute blood loss data on iPhone and alerts on both devices.
The project ended when Stryker acquired Gauss Surgical. I finished my work on it in October 2021.