Hardcoded Data Models
The JS literals embedded in the prototype's /visit/ source define the v1 schema Deepak has in mind. Treat them as the planning surface for our DB models, not as demo dressing.
Patient roster (18 patients · 10 families · 1 doctor)
Provider: Yogini Prajapati MD. The Atlas account that backs this roster reports 81 active patients in production; the prototype demos 18.
| Patient ID / Name | Family · Subscription | Age · DOB · Sex | Notes |
|---|---|---|---|
sofia Sofia Martinez | Martinez · monthly $295 (Lisa Martinez) | 7y · 03/14/2019 · F | Peanut allergy (severe), tree nuts (mod), Epi-pen Jr |
| (sib) Diego Martinez | Martinez | 3y · 08/02/2022 · M | Eczema |
| Aisha Brock | Brock · monthly $295 (Janelle Brock) | 5y · 11/22/2020 · F | NKDA |
| Ethan Brock | Brock | 2y · 06/10/2023 · M | NKDA |
| Liam Chen | Chen · quarterly $885 (Wei Chen) | 4y · 09/15/2021 · M | Asthma; dust mites/cat |
| Maya Chen | Chen | 7y · 02/28/2019 · F | NKDA |
jaden Jaden Patel | Patel · monthly $295 (Priya Patel) | 8y · 01/04/2018 · M | ADHD · Concerta 36mg (CII) |
| Riya Patel | Patel | 6y · 04/19/2020 · F | NKDA |
| Olivia Kim | Kim | 10y · 07/30/2015 · F | NKDA · Well-visit 4 mo overdue |
| Theo Kim | Kim | 12y · 03/02/2014 · M | NKDA |
| Noah Williams | Williams (new family · enrolling Thu) | 3y · 05/12/2022 · M | Transfer record pending |
| Emma Williams | Williams | 5y · 10/08/2020 · F | New patient |
mai Mai Nguyen | Nguyen | 1d · 05/03/2026 · F | TERM 39+2 · vaginal · 3.42 kg — HOME VISIT |
| Bao Nguyen | Nguyen | 3y · 11/04/2022 · M | NKDA |
| Chiamaka Okafor | Okafor | 14y · 09/12/2011 · F | PHQ-9 / GAD-7 due |
mateo Mateo Rodriguez-Hayes | Rodriguez-Hayes | 16y · 02/21/2010 · M | T1D pump+CGM · A1c 6.9 |
camila Camila Rodriguez-Hayes | Rodriguez-Hayes | 9y · 08/25/2016 · F | Asthma EIA · PCN allergy |
eli Eli Goldberg | Goldberg | 11d · 04/23/2026 · M | TERM 38+5 · C-section · 3.21 kg — newborn 2-wk today |
Schema implications baked into this roster:
- Family / Household is a first-class entity. Subscription tier (monthly $295, quarterly $885, annual implied) belongs to the Family, not the Patient. One Stripe customer per family, not per patient.
- Guardian linkage — each family row names a responsible parent (Lisa Martinez, Janelle Brock, Wei Chen, Priya Patel, Tasha Williams).
- Routing rule is hard-coded:
HOME_VISIT_PATIENTS = new Set(['mai']). The newborn home-visit flow is selected by patient ID in the demo; in production it should derive frompatient.age_in_daysand an active home-visit encounter. - Practice constants surfaced elsewhere: 81 active patients on the real panel, +20.9% YoY, $4,752 May MTD charges, 100% Stripe, 1 doctor, 0 in-house dispensing.
Note bank (5 SOAP notes · NOTE_DATA)
Each entry is { title, meta, status, statusLabel, confidence, readonly, signed, sections[] }. Each section is { label, tag, conf, html } where tag ∈ { 'AI', 'auto', 'user' } and conf ∈ { 'high', 'med', 'low' }.
| ID | Title | Date | Status | Source |
|---|---|---|---|---|
today-sick-draft | Sick visit · cough × 4 days | Today 5/4/2026 | draft (94% confidence) | AI scribe |
wcc-6y | Well-child · 6 year annual | 6/12/2025 | signed | Hand-written |
eczema-followup | Follow-up · eczema flare | 2/14/2026 | signed | Hand-written |
otitis-2024 | Sick visit · ear infection | 11/4/2024 | signed | Hand-written |
wcc-5y-K | Well-child · 5y kindergarten physical | 7/22/2024 | signed | Hand-written |
The three-way provenance tag (AI / auto / user) is the v1 contract for note authorship. It enables:
- Per-section "View AI original" + "↻ Regenerate" buttons.
- Inline diff highlighting (
<span class="ne-edited">mint) when Yogini edits an AI section. - Confidence chips ("High confidence" / "Medium · review") shown next to AI sections.
A signed note carries an signed audit string (e.g. "Electronically signed by Yogini Prajapati MD · 06/12/2025 at 11:42 AM · IP 192.168.1.84") and is readonly: true. Amendments to signed notes require an audit-logged amendment workflow.
Detail-drawer modals (8 entries · DETAIL_CONTENT)
Opened by openDetail(id) from anywhere on the chart. Slides in from the right. Each entry: { icon, cls, title, body }.
| ID | Type | Subject |
|---|---|---|
sms | Text thread | Lisa Martinez — "Sofia coughing 4 days" |
appt | Appointment | Today 10:30 AM sick visit · 30 min · booked from SMS |
note | Signed SOAP | Well-child 6/12/2025 (Sofia at 6y) |
rx-epi | Rx detail | Epi-pen Jr 0.15 mg/0.15 mL · 1 refill · H-E-B Pharmacy · DoseSpot Rx ID 20250612-EPI-001 |
imm | Immunizations | 4 vaccines from 6y well-child (DTaP #5 / IPV #4 / MMR #2 / Varicella #2) with lot numbers |
icd-J069 | ICD-10 | J06.9 · Acute upper respiratory infection (with cross-references) |
icd-R059 | ICD-10 | R05.9 · Cough |
icd-Z00121 | ICD-10 | Z00.121 · Routine well-child exam |
AI canned responses (6 entries · AI_RESPONSES)
Keyed by lowercased question (substring fallback). Define the quality bar for production Claude calls.
| Trigger keyword | Response gist |
|---|---|
what should i prioritize this morning? | Top-3 ranked: Sofia 10:30 sick visit · Camila refill · Eli newborn 2-wk + home-visit prep ready note |
prep for sofia's 10:30 sick visit | Chart context recap → ask points → differential dx → flag well-visit overdue + Epi-pen 47-day expiry |
draft replies to all unread messages | 7 of 9 auto-drafted, HEEADSSS-confidential threads excluded, batch send option |
anything overdue i should book today? | 2 well-visits overdue · window-opening Rx alerts · Friday CII handling |
drug interactions on sofia? | Cross-check active meds (Epi-pen Jr + Cetirizine 5mg) against likely cough Rx; warn diphenhydramine + pseudoephedrine |
summarize this week | 15 visits · 1 home visit · 1 prospect call · ~4.2 hrs AI scribe savings · MTD charges $4,752 |
All responses include <span class="ai-action" onclick="..."> deep-links back into the app (openPatient('sofia'), showView('rx'), etc). The contract: AI replies should be action-linked, not just informational.
AI panel context
updateAiContext() runs on every view change. The "I see X" pill below the assistant follows the user's screen automatically:
today → Today screen · 4 visits · 2 AI flags
list → Patients list · 18 patients · 10 families
calendar → Calendar · this week · 15 visits booked
chart → Sofia Martinez chart · sick visit today 10:30
home → Mai Nguyen home visit · 1 day old · birth history loaded
docs → Documents · 8 unfiled · 79% AI auto-routed
inbox → Inbox · 9 unread · 2 urgent · 7 AI replies drafted
rx → Prescriptions · 2 refills awaiting sign-off
billing → Billing · May $4,752 charged · MRR $2,863
reports → Reports · clinical-quality · 78% Bright Futures
marketing→ Marketing · 47 leads · 2.1% conversion
Engineering implication: every screen must emit a view_context blob (currentView, filters, selectedPatientId, etc.) so the AI panel and ambient features can RAG against the same context the user sees.
Command palette (22 entries · CMD_ITEMS)
Each entry: { label, icon, action }. Triggered by ⌘K. Typing > switches to AI mode.
⌂ Today
👥 Patients (18)
📅 Calendar · this week
✉️ Inbox (9 unread)
📎 Documents (8 unfiled)
💊 Prescriptions (2 awaiting sign-off)
💳 Billing · May 2026
📊 Reports · clinical-quality
📣 Marketing · pipeline
🩺 Sofia Martinez · 7y · sick visit today
👶 Mai Nguyen · 1d · home visit Tue
👶 Eli Goldberg · 11d · newborn 2-week today
🩺 Mateo Rodriguez-Hayes · 16y · T1D follow-up Thu
💊 Camila Rodriguez-Hayes · 9y · refill pending
🩺 Jaden Patel · 8y · ADHD med review
🎙️ Start visit · AI scribe (on current chart)
💊 Send Rx (on current chart)
⚡ AI: draft note for current visit
⚡ AI: summarize this week
⚙️ Settings · Office Hours
⌨️ Keyboard shortcuts
🚪 Sign out
This is the v1 keyboard-shortcut surface. Pressing ? shows: ⌘K = command palette · g+t = today · g+p = patients · g+c = calendar · ESC = close.
State machine captions (STATE_CAPTIONS)
Office scribe setState(n):
| n | Caption |
|---|---|
| 1 | Step 1 of 5 Sofia just arrived. Yogini reviews her chart — last visit, allergies, what's overdue. |
| 2 | Step 2 of 5 Yogini taps record. Whisper transcribes the conversation in real time. |
| 3 | Step 3 of 5 Recording stopped. Claude drafted a SOAP note in 18 seconds. Yogini reviews + edits. |
| 4 | Step 4 of 5 Note signed. Action plan fires: Rx routes via DoseSpot, follow-up task auto-creates, billing event logs. |
| 5 | Step 5 of 5 Lisa's phone buzzes. Plain-language summary in the parent app — what we did, what to do at home, when to call. |
These read like spec text and are perfect for production tutorial overlays / onboarding tooltips.
Hardcoded summary stats
Sprinkled throughout — treat as v1 demo data, not configuration:
- Marketing: 47 leads / week · 2.1% conversion (industry avg DPC peds 1.4%).
- Inbox: 38% inbound auto-replied · 12 min avg response · under-1-hr SLA.
- Reports: 78% Bright Futures completion · 94% immunization compliance · 100% asthma action plans · 100% T1D A1c-in-target.
- AI time savings (per week): 32 min/day SOAP scribe + 8 min/day message triage + 3 min/day eRx + 30s × 5 refills = ~4.2 hrs.
- Billing (May 2026): $4,752 charged · $450 outstanding (Williams first charge fires Thu 5/7) · $0 overdue · 100% Stripe · MRR $2,863.
- ARPU: $286 (Starlight family-level) vs $264 Atlas kid-level.
Plan pricing (canonical from this prototype)
For a 2-child family. Reconcile the Onboarding rate ($140/mo for 2 kids) vs the Patient-list family rate ($295/mo) before committing — likely intro-pricing vs steady-state.
| Cadence | 2-kid rate | Per kid implied |
|---|---|---|
| Monthly | $140/mo | $70/mo |
| Quarterly | $385 / 3 mo ($128.33/mo) | $64.17/mo |
| Annual | $1,440/yr ($120/mo) | $60/mo |
Implications for our codebase
| Hardcoded entity | Implementation hook |
|---|---|
| Family + Guardian + Patient roster | Three-table schema, Family owns Stripe customer, Guardian owns auth, Patient is medical record. Split-billing flag on Family. |
NOTE_DATA provenance | Section table per-note with tag, confidence, original_ai_version_id for diff/regenerate. |
DETAIL_CONTENT modals | Common drawer renderer keyed by entity type; one query per type. |
AI_RESPONSES | Production Claude prompt templates with chart-RAG; same action-link contract. |
AI panel ctxByView | Per-view view_context emitter on the client. |
CMD_ITEMS | Command palette feed = views + patients + AI commands; pluggable per role. |
HOME_VISIT_PATIENTS set | Replaced by encounter.type === 'newborn_home_visit' check at chart open. |
| State-machine captions | Tutorial / onboarding overlay copy. |