Blue
Turns an inbound referral — often still a fax — into a booked appointment, over text.
- Role
- Architect, engineer, and operator
- Years
- Ongoing
- Status
- In production
- Stack
- Next.js, Laravel, ECS Fargate, Aurora MySQL, SQS, AWS
The problem
A specialty practice gets new patients from a handful of places: a referral from another physician, a contact form, a quiz on a website. The referral usually arrives as a fax, because that is still how much of American healthcare moves documents. Someone on staff reads it, keys the patient into a system, and tries to reach them by phone.
Most of the loss happens in that last step. The patient does not answer an unknown number, the callback never lands, and a referral that a physician already approved quietly expires. The practice never sees the patient it was sent.
Constraints that shaped the design
Every interesting decision here came from a constraint rather than a preference.
The input is unstructured and low quality. A faxed referral is an image of a document that was probably printed from a different system. Extraction has to work on that, not on clean structured input.
Messaging patients is regulated on several axes at once. TCPA governs whether you are allowed to send the message and requires a consent chain you can produce later. 10DLC governs the carrier registration behind the number you send it from. HIPAA governs what may appear in the message body. These are not a compliance review at the end — they determine the data model.
The work is bursty. A practice sends a stack of referrals at once, and document extraction and audio transcription are slow and CPU-hungry compared to serving a web request.
What I decided
I split the system along the axis of how long work takes. Anything a person waits on is served by Laravel behind a Next.js frontend. Anything that is slow or spiky — document extraction, audio transcription — runs as a worker on ECS Fargate, pulled off SQS. Queue depth absorbs the burst, and a slow document never occupies a web worker.
Consent is modelled as an append-only chain rather than a boolean on the patient record. A flag tells you the current state; it cannot tell you how you got there. For TCPA the second thing is the one that matters, because the question is always "what were you permitted to send, at the time you sent it, and on what basis". Every state transition is a row.
AI does the extraction, not the decision. The model reads the document and proposes structured fields. What it produces is a candidate, and the pipeline treats it as one — nothing reaches a patient because a model was confident.
What I own
The architecture, the application code, the infrastructure, the queue topology, and what happens at three in the morning when a worker starts failing. Being the only engineer on a system makes a specific kind of design pressure: you cannot ship anything you are not willing to operate.
- The architecture behind this platform is the subject of US 12,592,322 B2, "Multi-modal digital communication architecture for patient engagement", granted March 2026 and assigned to Nemedic Inc.. I am a co-inventor.