services/preop does two jobs: it turns FinchNode’s synthetic health records into surgical cases, and it runs Scalpal, the voice coach in the operating room.
Patient cases
Every synthetic patient gets an authored surgical scenario that fits their chart. A 78-year-old on apixaban with kidney disease gets an urgent cholecystectomy. A 9-year-old with asthma gets an appendectomy. The chart is real FinchNode data, and the acute story is authored fiction, labeled as such.- Risks are rules, not a model. Flags come from coded data (RxNorm, LOINC, SNOMED), each with the record entries behind it. Missing data is reported as unknown, never as none.
- Everything renders in Unity. Every payload maps one to one onto the C# DTOs in
apps/quest/Assets/Scalpal/Exercises/Data/. - No dead ends. Every response carries
actions, and every failure renders a state with a way forward.
ck_test_...) to run FinchNode’s real consent flow on synthetic patients.
Office interview (no Scalpal)
The office is a 1:1 interview with the patient voice: a tool-less ElevenLabs agent embodying the patient’s committedpatient.md. After each patient turn the learner picks the next clinician move from four choices (one correct, at most one partial), by tap or by voice. Spoken answers are transcribed by ElevenLabs and matched to a choice by Claude Haiku. The rounds, grades and score live on the server and are the same every run. Content for each patient (patient.md, patient_status.md, interview.json) is under services/preop/content/patients/. See office interview.
Scalpal in the operating room
Scalpal is the only AI that talks. He first speaks in the operating room, runs the Time-Out, then coaches live. He is fed by analyzers that do not talk:- State tracker: tools in each hand, tool contact, every measured cut, clamp and tie, the checklist and what the next step still needs, in plain words.
- Patient condition: simulated vitals from blood loss on the shared ATLS model (chart baseline in VR, Presage baseline in AR), injuries outside the surgical field (head, neck, chest, limbs), and the outcome, including death.
- Alarms: pre-rendered clips play instantly for safety warnings (a cut neck, falling pressure, an uncontrolled bleed past 30 s); Scalpal explains after.
- Stall hints escalate at about 15, 25, 40 and 60 s.
- Vision: POV screenshots summarized by Claude, plus OWLv2 tool boxes from the camera. Vision supports the state but never decides it.
sim_log for the dashboard’s Live logs panel.
Environment
See the API reference for every route.