Skip to main content

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 / NameFamily · SubscriptionAge · DOB · SexNotes
sofia Sofia MartinezMartinez · monthly $295 (Lisa Martinez)7y · 03/14/2019 · FPeanut allergy (severe), tree nuts (mod), Epi-pen Jr
(sib) Diego MartinezMartinez3y · 08/02/2022 · MEczema
Aisha BrockBrock · monthly $295 (Janelle Brock)5y · 11/22/2020 · FNKDA
Ethan BrockBrock2y · 06/10/2023 · MNKDA
Liam ChenChen · quarterly $885 (Wei Chen)4y · 09/15/2021 · MAsthma; dust mites/cat
Maya ChenChen7y · 02/28/2019 · FNKDA
jaden Jaden PatelPatel · monthly $295 (Priya Patel)8y · 01/04/2018 · MADHD · Concerta 36mg (CII)
Riya PatelPatel6y · 04/19/2020 · FNKDA
Olivia KimKim10y · 07/30/2015 · FNKDA · Well-visit 4 mo overdue
Theo KimKim12y · 03/02/2014 · MNKDA
Noah WilliamsWilliams (new family · enrolling Thu)3y · 05/12/2022 · MTransfer record pending
Emma WilliamsWilliams5y · 10/08/2020 · FNew patient
mai Mai NguyenNguyen1d · 05/03/2026 · FTERM 39+2 · vaginal · 3.42 kg — HOME VISIT
Bao NguyenNguyen3y · 11/04/2022 · MNKDA
Chiamaka OkaforOkafor14y · 09/12/2011 · FPHQ-9 / GAD-7 due
mateo Mateo Rodriguez-HayesRodriguez-Hayes16y · 02/21/2010 · MT1D pump+CGM · A1c 6.9
camila Camila Rodriguez-HayesRodriguez-Hayes9y · 08/25/2016 · FAsthma EIA · PCN allergy
eli Eli GoldbergGoldberg11d · 04/23/2026 · MTERM 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 from patient.age_in_days and 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' }.

IDTitleDateStatusSource
today-sick-draftSick visit · cough × 4 daysToday 5/4/2026draft (94% confidence)AI scribe
wcc-6yWell-child · 6 year annual6/12/2025signedHand-written
eczema-followupFollow-up · eczema flare2/14/2026signedHand-written
otitis-2024Sick visit · ear infection11/4/2024signedHand-written
wcc-5y-KWell-child · 5y kindergarten physical7/22/2024signedHand-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 }.

IDTypeSubject
smsText threadLisa Martinez — "Sofia coughing 4 days"
apptAppointmentToday 10:30 AM sick visit · 30 min · booked from SMS
noteSigned SOAPWell-child 6/12/2025 (Sofia at 6y)
rx-epiRx detailEpi-pen Jr 0.15 mg/0.15 mL · 1 refill · H-E-B Pharmacy · DoseSpot Rx ID 20250612-EPI-001
immImmunizations4 vaccines from 6y well-child (DTaP #5 / IPV #4 / MMR #2 / Varicella #2) with lot numbers
icd-J069ICD-10J06.9 · Acute upper respiratory infection (with cross-references)
icd-R059ICD-10R05.9 · Cough
icd-Z00121ICD-10Z00.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 keywordResponse 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 visitChart context recap → ask points → differential dx → flag well-visit overdue + Epi-pen 47-day expiry
draft replies to all unread messages7 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 week15 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):

nCaption
1Step 1 of 5 Sofia just arrived. Yogini reviews her chart — last visit, allergies, what's overdue.
2Step 2 of 5 Yogini taps record. Whisper transcribes the conversation in real time.
3Step 3 of 5 Recording stopped. Claude drafted a SOAP note in 18 seconds. Yogini reviews + edits.
4Step 4 of 5 Note signed. Action plan fires: Rx routes via DoseSpot, follow-up task auto-creates, billing event logs.
5Step 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.

Cadence2-kid ratePer 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 entityImplementation hook
Family + Guardian + Patient rosterThree-table schema, Family owns Stripe customer, Guardian owns auth, Patient is medical record. Split-billing flag on Family.
NOTE_DATA provenanceSection table per-note with tag, confidence, original_ai_version_id for diff/regenerate.
DETAIL_CONTENT modalsCommon drawer renderer keyed by entity type; one query per type.
AI_RESPONSESProduction Claude prompt templates with chart-RAG; same action-link contract.
AI panel ctxByViewPer-view view_context emitter on the client.
CMD_ITEMSCommand palette feed = views + patients + AI commands; pluggable per role.
HOME_VISIT_PATIENTS setReplaced by encounter.type === 'newborn_home_visit' check at chart open.
State-machine captionsTutorial / onboarding overlay copy.