MyDoc90: clinic software where AI drafts the prescription and the doctor decides
- Client
- Loay Elghitany
- Role
- Sole engineer, freelance: architecture, back end, front end, AI and deployment
- Dates
- 08/2026 – now (development 27 Aug to 5 Nov 2026)
- Stack
- TypeScript, React, Express, PostgreSQL, Drizzle, Azure OpenAI, Azure Container Apps, PostgreSQL Flexible Server
- clinics use it
- 10
- automated tests
- 1,195
- prescription fields extracted correctly on 10 of 10 runs
- 31/31
- on staging, zero errors up to 150 users at once
- 248 req/s
The problem
MyDoc90 replaced a set of hackathon prototypes. Loay Elghitany’s clinics needed one system for the front desk and the doctor: the patient queue, records, prescriptions and payments, in Arabic and English. Doctors also wanted to dictate prescriptions the way they actually speak, switching between Arabic and English mid-sentence.
Constraints
- Medical records: a wrong dose is worse than a missing one, so the AI may never write to a prescription on its own.
- Two languages and right-to-left layouts, down to 320px phone screens.
- One small server to start, so every limit has to hold on a single replica.
What I built
The front desk books and reorders the queue, records payments and opens the patient’s history. The doctor writes notes and prescriptions; private clinical notes are kept apart from what the patient can see.
The AI assistant does four things, and the doctor approves every one:
- 01DictationThe doctor speaks; the assistant turns the transcript into prescription rows: medicine, dose, frequency, duration, instructions.
- 02AlternativesFor each medicine it suggests alternatives the doctor can swap in.
- 03Common medicinesIt offers the medicines doctors in that specialty prescribe most.
- 04Doctor reviewNothing reaches the prescription until the doctor ticks “I have reviewed every medication”. Anything not dictated is marked “Not dictated — complete manually” instead of guessed.



Architecture
Business rules live in a domain package with no database or web code. The API runs use cases against those rules; the React app and the API ship as one container on Azure Container Apps, backed by PostgreSQL Flexible Server.
Decisions
The doctor always decides.
The assistant drafts; it never saves. I considered auto-filling the prescription and letting the doctor edit it, but an unnoticed wrong dose is the worst failure here, so the draft stays separate until the doctor confirms every line. It costs the doctor one click.
Choose the model by measuring it.
I gave Gemini and Azure OpenAI the identical prompt and the same four fictional dictations, and scored a value only if it landed in the right field of the right row. Azure OpenAI got 31 of 31 fields on 10 of 10 runs; Gemini dropped the duration in 3 of 5 runs. Neither invented a medicine. The assistant now runs on Azure OpenAI.
Move to Azure one variable at a time.
I rehearsed the move on a staging copy, load-tested it, and wrote a runbook where every step has an expected result. During the cut-over only the hosting changed; file storage and the AI provider each moved to Azure later in a step of their own, so any failure had one cause. Today everything runs on Azure. Production runs one replica on purpose: rate limits live in memory, and a second copy would silently double them.
A retry must never create a second prescription.
If a save succeeded but the reply was lost, retrying used to create a duplicate. The editor now reuses an operation ID, and the prescription and its receipt are written in one transaction, so a retry returns the first prescription.
Results
| Result | How it was measured |
|---|---|
| 10 clinics use MyDoc90 | Client |
| 1,195 automated tests, 118 of them against a real disposable PostgreSQL | Test suites in CI |
| 17 browser scenarios pass in both languages on 320px screens | Playwright on the production image |
| 248 requests/s peak; zero errors up to 150 concurrent users; p95 182 ms at 20 | Load test on Azure staging, 21 Oct 2026, one 0.5 vCPU replica |
| 31/31 prescription fields on 10 of 10 runs | Extraction benchmark, identical prompt |
| Mixed-language dictation: clinical fields captured rose from 5 of 7 to 6 of 7 with a phrase list | Speech-to-text study |
| 104 merged pull requests, zero known dependency advisories | GitHub, CI audit |
What I’d do next
Measure dictation on real clinic recordings, with the clinic’s consent; my benchmark used fictional dictations. Then move rate limits to a shared store so the app can run a second replica.