diff --git a/apps/Frontend/src/components/settings/ai-chat-settings-card.tsx b/apps/Frontend/src/components/settings/ai-chat-settings-card.tsx
index ba7d86e1..b9cf2ecf 100644
--- a/apps/Frontend/src/components/settings/ai-chat-settings-card.tsx
+++ b/apps/Frontend/src/components/settings/ai-chat-settings-card.tsx
@@ -280,259 +280,331 @@ function LangGraphFlow() {
);
}
-// ─── New Patient / After-Hours flow diagram ───────────────────────────────────
+// ─── New Patient flow diagram (updated) ──────────────────────────────────────
function NewPatientFlow() {
// ── Canvas ───────────────────────────────────────────────────────────────
- const W = 760;
- const cx = 380; // top-node horizontal center
- const nW = 220;
- const nx = cx - nW / 2; // 270
+ const W = 900;
+ const cx = 450;
- // ── Sequential top nodes ─────────────────────────────────────────────────
- const n1y = 15, n1h = 58;
- const n2y = 115, n2h = 58;
- const n3y = 215, n3h = 58;
- const n4y = 315, n4h = 60;
+ // ── Coordinates ──────────────────────────────────────────────────────────
+ const nW = 240; const nx = cx - nW / 2;
- // ── Main fork ────────────────────────────────────────────────────────────
- const forkHY = n4y + n4h + 20; // 395
- const lcx = 165; // New Patient branch center
- const rcx = 590; // Existing Patient branch center
- const brW = 200;
+ // Top sequence
+ const n1y = 14; const n1h = 84;
+ const n2y = n1y + n1h + 14; const n2h = 52;
+ const forkHY = n2y + n2h + 18;
- // ── Main branch nodes ─────────────────────────────────────────────────────
- const brY = forkHY + 50; // 445
- const brH = 62;
+ // Main branch centres
+ const lcx = 210; // New Patient
+ const rcx = 690; // Existing Patient
+ const brW = 210;
- // ── Sub-forks ─────────────────────────────────────────────────────────────
- const sfHY = brY + brH + 18; // 525
- const llcx = 100; const lrcx = 230; // New Patient sub-branches (centered on 165)
- const rlcx = 510; const rrcx = 660; // Existing Patient sub-branches
+ // ── NEW PATIENT layout ────────────────────────────────────────────────────
+ // insurance question
+ const npInsY = forkHY + 44; const npInsH = 52;
+ // sub-fork 1: has-ins / no-ins
+ const npSf1Y = npInsY + npInsH + 18;
+ const lhcx = 140; // has insurance
+ const lncx = 325; // no insurance
+ // no-ins leaf
+ const npNoInsY = npSf1Y + 20; const npNoInsH = 76; const npNoInsW = 130;
+ // what kind?
+ const npWkY = npSf1Y + 20; const npWkH = 52; const npWkW = 192;
+ // sub-fork 2: masshealth / other
+ const npSf2Y = npWkY + npWkH + 18;
+ const mhcx = 82; // masshealth
+ const othcx = 210; // other
+ // other ins leaf
+ const npOthY = npSf2Y + 20; const npOthH = 76; const npOthW = 130;
+ // masshealth consent node
+ const npMhY = npSf2Y + 20; const npMhH = 76; const npMhW = 155;
+ // selenium
+ const npSelY = npMhY + npMhH + 18; const npSelH = 66; const npSelW = 148;
+ // active / inactive fork
+ const npResHY = npSelY + npSelH + 14;
+ const npActCx = 40; const npInaCx = 140;
+ const npResY = npResHY + 22;
+ // active result
+ const npActH = 76; const npActW = 110;
+ // inactive → other insurance?
+ const npInaH = 52; const npInaW = 110;
+ // other-insurance-after-inactive
+ const npOins2Y = npResY + Math.max(npActH, npInaH) + 16;
+ const npOins2H = 52; const npOins2W = 150;
+ // final: yes=transfer / no=contact info
+ const npFinalY = npOins2Y + npOins2H + 18;
+ const npTxCx = npInaCx - 44; const npCiCx = npInaCx + 46;
+ const npTxH = 44; const npTxW = 86;
+ const npCiH = 64; const npCiW = 132;
- // ── Leaf nodes ────────────────────────────────────────────────────────────
- const leafY = sfHY + 46; // 571
- const leafW = 118;
- const leafH = 80;
+ const totalH_np = npFinalY + npCiH + 18;
- // ── New patient: Selenium chain (below LL at cx=100) ─────────────────────
- const npSelY = leafY + leafH + 34; // 685 — Selenium node top
- const npSelW = 140;
- const npSelH = 56;
- const npResHY = npSelY + npSelH + 16; // 757 — result fork y
- const npActCx = 52; // ACTIVE result center (100-48)
- const npInaCx = 148; // INACTIVE result center (100+48)
- const npResY = npResHY + 34; // 791
- const npResW = 80;
- const npResH = 72;
+ // ── EXISTING PATIENT layout ───────────────────────────────────────────────
+ const epInsY = forkHY + 44; const epInsH = 64; const epInsW = 210;
+ const epSf1Y = epInsY + epInsH + 18;
+ const epSameCx = 638; const epDiffCx = 760;
+ // no-same (transfer)
+ const epDiffY = epSf1Y + 20; const epDiffH = 52; const epDiffW = 130;
+ // same confirmed
+ const epSameY = epSf1Y + 20; const epSameH = 52; const epSameW = 192;
+ // sub-fork 2: masshealth / other
+ const epSf2Y = epSameY + epSameH + 18;
+ const epMhCx = 586; const epOthCx = 706;
+ // other ins leaf
+ const epOthY = epSf2Y + 20; const epOthH = 76; const epOthW = 130;
+ // mh auto-check
+ const epMhY = epSf2Y + 20; const epMhH = 62; const epMhW = 175;
+ // selenium
+ const epSelY = epMhY + epMhH + 18; const epSelH = 66; const epSelW = 148;
+ // active / inactive
+ const epResHY = epSelY + epSelH + 14;
+ const epActCx = 534; const epInaCx = 648;
+ const epResY = epResHY + 22;
+ const epActH = 76; const epActW = 110;
+ const epInaH = 64; const epInaW = 120;
- // ── Existing patient: YES → MassHealth auto-check (below RL at cx=510) ──
- const exForkHY = leafY + leafH + 26; // 677
- const exMhCx = 445; // MassHealth sub-branch center
- const exOtherCx = 558; // Other insurance center
- const exCheckY = exForkHY + 34; // 711
- const exCheckW = 116;
- const exCheckH = 52;
- const exSelY = exCheckY + exCheckH + 18; // 781
- const exSelW = 128;
- const exSelH = 52;
- const exResHY = exSelY + exSelH + 16; // 849
- const exActCx = 401; // (445-44)
- const exInaCx = 489; // (445+44)
- const exLeafY = exResHY + 34; // 883
- const exLeafW = 80;
- const exLeafH = 62;
+ const totalH_ep = epResY + Math.max(epActH, epInaH) + 18;
- const totalH = Math.max(npResY + npResH, exLeafY + exLeafH) + 22;
+ const totalH = Math.max(totalH_np, totalH_ep) + 10;
return (
);
}
@@ -974,7 +1046,7 @@ export function AiChatSettingsCard() {
Reminder & Reschedule Flow
- New Patient / After-Hours Flow
+ New Patient Flow