feat: update new patient LangGraph flow diagram to reflect current AI flow

Replaces the old after-hours/new-patient SVG with an accurate diagram of
the current conversation flow: 3-message TwiML entry → insurance check →
MassHealth consent + ID/DOB → Selenium eligibility → ACTIVE/INACTIVE paths,
inactive branch asks for other insurance then collects contact info, and
office-hours-validated date/time scheduling with appointment creation.
Existing patient branch shows same-insurance confirmation, MassHealth
auto-check (stored ID+DOB), and Selenium result paths.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Gitead
2026-05-15 00:26:09 -04:00
parent c71624f7e7
commit 69919e1eca

View File

@@ -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 (
<svg
viewBox={`0 0 ${W} ${totalH}`}
className="w-full max-w-2xl mx-auto"
className="w-full max-w-3xl mx-auto"
role="img"
aria-label="New patient conversation flow diagram"
aria-label="New patient AI conversation flow diagram"
>
<defs>
<marker id="nph" markerWidth="10" markerHeight="7"
<marker id="nph2" markerWidth="10" markerHeight="7"
refX="9" refY="3.5" orient="auto" markerUnits="userSpaceOnUse">
<polygon points="0 0, 10 3.5, 0 7" fill="#9CA3AF" />
<polygon points="0 0,10 3.5,0 7" fill="#9CA3AF" />
</marker>
</defs>
{/* ═══════════ TOP SEQUENCE ═══════════════════════════════════ */}
{/* ═══════════ ENTRY — 3-message flow ═════════════════════════ */}
<rect x={nx} y={n1y} width={nW} height={n1h} rx={8} fill="#EFF6FF" stroke="#3B82F6" strokeWidth={1.5} />
<text x={cx} y={n1y+22} textAnchor="middle" fontSize={12} fontWeight="600" fill="#1D4ED8">Patient texts after hours</text>
<text x={cx} y={n1y+38} textAnchor="middle" fontSize={10} fill="#93C5FD">or staff selects</text>
<text x={cx} y={n1y+50} textAnchor="middle" fontSize={10} fill="#93C5FD">"Schedule a New Patient"</text>
<text x={cx} y={n1y+18} textAnchor="middle" fontSize={12} fontWeight="600" fill="#1D4ED8">Patient texts the office number</text>
<text x={cx} y={n1y+34} textAnchor="middle" fontSize={10} fontWeight="600" fill="#3B82F6">AI sends 3 messages (TwiML, guaranteed order):</text>
<text x={cx} y={n1y+50} textAnchor="middle" fontSize={9} fill="#6B7280"> Self-intro (New Patient Greeting template)</text>
<text x={cx} y={n1y+64} textAnchor="middle" fontSize={9} fill="#6B7280"> Empathetic ack · "New or existing patient?"</text>
<line x1={cx} y1={n1y+n1h} x2={cx} y2={n2y-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph)" />
<line x1={cx} y1={n1y+n1h} x2={cx} y2={n2y-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph2)" />
<rect x={nx} y={n2y} width={nW} height={n2h} rx={8} fill="#ECFDF5" stroke="#10B981" strokeWidth={1.5} />
<text x={cx} y={n2y+22} textAnchor="middle" fontSize={12} fontWeight="600" fill="#065F46">AI sends New Patient Greeting</text>
<text x={cx} y={n2y+40} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">"Hi! My name is Lisa..."</text>
<line x1={cx} y1={n2y+n2h} x2={cx} y2={n3y-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph)" />
<rect x={nx} y={n3y} width={nW} height={n3h} rx={8} fill="#F9FAFB" stroke="#D1D5DB" strokeWidth={1.5} />
<text x={cx} y={n3y+22} textAnchor="middle" fontSize={12} fontWeight="600" fill="#374151">Patient replies</text>
<text x={cx} y={n3y+40} textAnchor="middle" fontSize={9} fill="#9CA3AF" fontStyle="italic">"I want an appointment / cleaning"</text>
<line x1={cx} y1={n3y+n3h} x2={cx} y2={n4y-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph)" />
<rect x={nx} y={n4y} width={nW} height={n4h} rx={8} fill="#ECFDF5" stroke="#10B981" strokeWidth={1.5} />
<text x={cx} y={n4y+24} textAnchor="middle" fontSize={12} fontWeight="600" fill="#065F46">AI: New or existing patient?</text>
<text x={cx} y={n4y+42} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">"Are you a new or existing patient?"</text>
<text x={cx} y={n2y+20} textAnchor="middle" fontSize={12} fontWeight="600" fill="#065F46">AI classifies patient reply</text>
<text x={cx} y={n2y+38} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">"new patient" / "existing" / "old patient" / </text>
{/* ═══════════ MAIN FORK ══════════════════════════════════════ */}
<line x1={cx} y1={n4y+n4h} x2={cx} y2={forkHY} stroke="#9CA3AF" strokeWidth={1.5} />
<line x1={cx} y1={n2y+n2h} x2={cx} y2={forkHY} stroke="#9CA3AF" strokeWidth={1.5} />
<line x1={lcx} y1={forkHY} x2={rcx} y2={forkHY} stroke="#9CA3AF" strokeWidth={1.5} />
<line x1={lcx} y1={forkHY} x2={lcx} y2={brY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph)" />
<line x1={rcx} y1={forkHY} x2={rcx} y2={brY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph)" />
<line x1={lcx} y1={forkHY} x2={lcx} y2={npInsY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph2)" />
<line x1={rcx} y1={forkHY} x2={rcx} y2={epInsY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph2)" />
<rect x={lcx-42} y={forkHY-13} width={84} height={24} rx={12} fill="#EEF2FF" stroke="#6366F1" strokeWidth={1.5} />
<rect x={lcx-44} y={forkHY-13} width={88} height={24} rx={12} fill="#EEF2FF" stroke="#6366F1" strokeWidth={1.5} />
<text x={lcx} y={forkHY+4} textAnchor="middle" fontSize={10} fontWeight="700" fill="#4338CA">New Patient</text>
<rect x={rcx-50} y={forkHY-13} width={100} height={24} rx={12} fill="#F5F3FF" stroke="#8B5CF6" strokeWidth={1.5} />
<rect x={rcx-52} y={forkHY-13} width={104} height={24} rx={12} fill="#F5F3FF" stroke="#8B5CF6" strokeWidth={1.5} />
<text x={rcx} y={forkHY+4} textAnchor="middle" fontSize={10} fontWeight="700" fill="#6D28D9">Existing Patient</text>
{/* ═══════════ LEFT BRANCH — NEW PATIENT ══════════════════════ */}
{/* ═══════════ NEW PATIENT BRANCH ═════════════════════════════ */}
<rect x={lcx-brW/2} y={brY} width={brW} height={brH} rx={8} fill="#EEF2FF" stroke="#6366F1" strokeWidth={1.5} />
<text x={lcx} y={brY+22} textAnchor="middle" fontSize={11} fontWeight="600" fill="#3730A3">Do you have any</text>
<text x={lcx} y={brY+38} textAnchor="middle" fontSize={11} fontWeight="600" fill="#3730A3">dental insurance?</text>
{/* Insurance? */}
<rect x={lcx-brW/2} y={npInsY} width={brW} height={npInsH} rx={8} fill="#EEF2FF" stroke="#6366F1" strokeWidth={1.5} />
<text x={lcx} y={npInsY+20} textAnchor="middle" fontSize={11} fontWeight="600" fill="#3730A3">Do you have dental insurance?</text>
<text x={lcx} y={npInsY+38} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">"Yes" / "No" / "MassHealth" / </text>
<line x1={lcx} y1={brY+brH} x2={lcx} y2={sfHY} stroke="#9CA3AF" strokeWidth={1.5} />
<line x1={llcx} y1={sfHY} x2={lrcx} y2={sfHY} stroke="#9CA3AF" strokeWidth={1.5} />
<line x1={llcx} y1={sfHY} x2={llcx} y2={leafY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph)" />
<line x1={lrcx} y1={sfHY} x2={lrcx} y2={leafY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph)" />
{/* Sub-fork 1 */}
<line x1={lcx} y1={npInsY+npInsH} x2={lcx} y2={npSf1Y} stroke="#9CA3AF" strokeWidth={1.5} />
<line x1={lhcx} y1={npSf1Y} x2={lncx} y2={npSf1Y} stroke="#9CA3AF" strokeWidth={1.5} />
<line x1={lhcx} y1={npSf1Y} x2={lhcx} y2={npWkY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph2)" />
<line x1={lncx} y1={npSf1Y} x2={lncx} y2={npNoInsY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph2)" />
<rect x={llcx-36} y={sfHY-11} width={72} height={22} rx={11} fill="#ECFDF5" stroke="#10B981" strokeWidth={1.5} />
<text x={llcx} y={sfHY+4} textAnchor="middle" fontSize={10} fontWeight="700" fill="#065F46">MassHealth</text>
<rect x={lrcx-32} y={sfHY-11} width={64} height={22} rx={11} fill="#FFF7ED" stroke="#F97316" strokeWidth={1.5} />
<text x={lrcx} y={sfHY+4} textAnchor="middle" fontSize={10} fontWeight="700" fill="#C2410C">No ins.</text>
<rect x={lhcx-20} y={npSf1Y-11} width={40} height={22} rx={11} fill="#ECFDF5" stroke="#10B981" strokeWidth={1.5} />
<text x={lhcx} y={npSf1Y+4} textAnchor="middle" fontSize={10} fontWeight="700" fill="#065F46">Yes</text>
<rect x={lncx-24} y={npSf1Y-11} width={48} height={22} rx={11} fill="#FFF7ED" stroke="#F97316" strokeWidth={1.5} />
<text x={lncx} y={npSf1Y+4} textAnchor="middle" fontSize={10} fontWeight="700" fill="#C2410C">No ins.</text>
{/* NP: MassHealth leaf — ask for ID+DOB */}
<rect x={llcx-leafW/2} y={leafY} width={leafW} height={leafH} rx={8} fill="#ECFDF5" stroke="#10B981" strokeWidth={1.5} />
<text x={llcx} y={leafY+18} textAnchor="middle" fontSize={10} fontWeight="600" fill="#065F46">Check MassHealth</text>
<text x={llcx} y={leafY+34} textAnchor="middle" fontSize={9} fill="#9CA3AF" fontStyle="italic">"Text me your</text>
<text x={llcx} y={leafY+48} textAnchor="middle" fontSize={9} fill="#9CA3AF" fontStyle="italic">Member ID &amp; DOB"</text>
{/* No insurance → schedule */}
<rect x={lncx-npNoInsW/2} y={npNoInsY} width={npNoInsW} height={npNoInsH} rx={8} fill="#F0FDF4" stroke="#22C55E" strokeWidth={1.5} />
<text x={lncx} y={npNoInsY+16} textAnchor="middle" fontSize={10} fontWeight="600" fill="#15803D">No insurance</text>
<text x={lncx} y={npNoInsY+32} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">Ask preferred date &amp; time</text>
<text x={lncx} y={npNoInsY+48} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">Office hours check</text>
<text x={lncx} y={npNoInsY+64} textAnchor="middle" fontSize={9} fill="#047857" fontWeight="600"> Appointment created</text>
{/* NP: No insurance leaf */}
<rect x={lrcx-leafW/2} y={leafY} width={leafW} height={leafH} rx={8} fill="#F0FDF4" stroke="#22C55E" strokeWidth={1.5} />
<text x={lrcx} y={leafY+18} textAnchor="middle" fontSize={10} fontWeight="600" fill="#15803D">Schedule</text>
<text x={lrcx} y={leafY+34} textAnchor="middle" fontSize={9} fill="#9CA3AF" fontStyle="italic">"When would</text>
<text x={lrcx} y={leafY+48} textAnchor="middle" fontSize={9} fill="#9CA3AF" fontStyle="italic">you like to come?"</text>
{/* What kind? */}
<rect x={lhcx-npWkW/2} y={npWkY} width={npWkW} height={npWkH} rx={8} fill="#EEF2FF" stroke="#6366F1" strokeWidth={1.5} />
<text x={lhcx} y={npWkY+20} textAnchor="middle" fontSize={11} fontWeight="600" fill="#3730A3">What kind of insurance?</text>
<text x={lhcx} y={npWkY+38} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">"MassHealth" / "Blue Cross" / </text>
{/* NP: Selenium check (patient texts ID+DOB) */}
<line x1={llcx} y1={leafY+leafH} x2={llcx} y2={npSelY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph)" />
<rect x={llcx-npSelW/2} y={npSelY} width={npSelW} height={npSelH} rx={8}
{/* Sub-fork 2 */}
<line x1={lhcx} y1={npWkY+npWkH} x2={lhcx} y2={npSf2Y} stroke="#9CA3AF" strokeWidth={1.5} />
<line x1={mhcx} y1={npSf2Y} x2={othcx} y2={npSf2Y} stroke="#9CA3AF" strokeWidth={1.5} />
<line x1={mhcx} y1={npSf2Y} x2={mhcx} y2={npMhY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph2)" />
<line x1={othcx} y1={npSf2Y} x2={othcx} y2={npOthY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph2)" />
<rect x={mhcx-36} y={npSf2Y-11} width={72} height={22} rx={11} fill="#ECFDF5" stroke="#10B981" strokeWidth={1.5} />
<text x={mhcx} y={npSf2Y+4} textAnchor="middle" fontSize={10} fontWeight="700" fill="#065F46">MassHealth</text>
<rect x={othcx-28} y={npSf2Y-11} width={56} height={22} rx={11} fill="#E0F2FE" stroke="#0EA5E9" strokeWidth={1.5} />
<text x={othcx} y={npSf2Y+4} textAnchor="middle" fontSize={10} fontWeight="700" fill="#0369A1">Other</text>
{/* Other ins → schedule */}
<rect x={othcx-npOthW/2} y={npOthY} width={npOthW} height={npOthH} rx={8} fill="#F0FDF4" stroke="#22C55E" strokeWidth={1.5} />
<text x={othcx} y={npOthY+16} textAnchor="middle" fontSize={10} fontWeight="600" fill="#15803D">Other insurance</text>
<text x={othcx} y={npOthY+32} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">Ask preferred date &amp; time</text>
<text x={othcx} y={npOthY+48} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">Office hours check</text>
<text x={othcx} y={npOthY+64} textAnchor="middle" fontSize={9} fill="#047857" fontWeight="600"> Appointment created</text>
{/* MassHealth consent + ID+DOB */}
<rect x={mhcx-npMhW/2} y={npMhY} width={npMhW} height={npMhH} rx={8} fill="#ECFDF5" stroke="#10B981" strokeWidth={1.5} />
<text x={mhcx} y={npMhY+16} textAnchor="middle" fontSize={10} fontWeight="600" fill="#065F46">Check MassHealth now?</text>
<text x={mhcx} y={npMhY+30} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">Yes send Member ID</text>
<text x={mhcx} y={npMhY+44} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">+ DOB (MM/DD/YYYY)</text>
<text x={mhcx} y={npMhY+62} textAnchor="middle" fontSize={8} fill="#9CA3AF" fontStyle="italic">No ask date preference</text>
{/* NP Selenium */}
<line x1={mhcx} y1={npMhY+npMhH} x2={mhcx} y2={npSelY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph2)" />
<rect x={mhcx-npSelW/2} y={npSelY} width={npSelW} height={npSelH} rx={8}
fill="#F0F9FF" stroke="#0EA5E9" strokeWidth={1.5} strokeDasharray="5 3" />
<rect x={llcx-40} y={npSelY-11} width={80} height={22} rx={11} fill="#E0F2FE" stroke="#0EA5E9" strokeWidth={1.5} />
<text x={llcx} y={npSelY+4} textAnchor="middle" fontSize={10} fontWeight="700" fill="#0369A1">Selenium</text>
<text x={llcx} y={npSelY+20} textAnchor="middle" fontSize={10} fontWeight="600" fill="#0369A1">MassHealth Portal</text>
<text x={llcx} y={npSelY+36} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">Auto-checks eligibility</text>
<text x={llcx} y={npSelY+48} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic"> result SMS to patient</text>
<rect x={mhcx-38} y={npSelY-11} width={76} height={22} rx={11} fill="#E0F2FE" stroke="#0EA5E9" strokeWidth={1.5} />
<text x={mhcx} y={npSelY+4} textAnchor="middle" fontSize={10} fontWeight="700" fill="#0369A1">Selenium</text>
<text x={mhcx} y={npSelY+20} textAnchor="middle" fontSize={10} fontWeight="600" fill="#0369A1">MassHealth Portal</text>
<text x={mhcx} y={npSelY+36} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">Auto-checks eligibility</text>
<text x={mhcx} y={npSelY+52} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">Result sent via SMS</text>
{/* NP: Post-Selenium ACTIVE/INACTIVE fork */}
<line x1={llcx} y1={npSelY+npSelH} x2={llcx} y2={npResHY} stroke="#9CA3AF" strokeWidth={1.5} />
{/* NP ACTIVE / INACTIVE fork */}
<line x1={mhcx} y1={npSelY+npSelH} x2={mhcx} y2={npResHY} stroke="#9CA3AF" strokeWidth={1.5} />
<line x1={npActCx} y1={npResHY} x2={npInaCx} y2={npResHY} stroke="#9CA3AF" strokeWidth={1.5} />
<line x1={npActCx} y1={npResHY} x2={npActCx} y2={npResY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph)" />
<line x1={npInaCx} y1={npResHY} x2={npInaCx} y2={npResY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph)" />
<line x1={npActCx} y1={npResHY} x2={npActCx} y2={npResY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph2)" />
<line x1={npInaCx} y1={npResHY} x2={npInaCx} y2={npResY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph2)" />
<rect x={npActCx-28} y={npResHY-11} width={56} height={22} rx={11} fill="#F0FDF4" stroke="#22C55E" strokeWidth={1.5} />
<text x={npActCx} y={npResHY+4} textAnchor="middle" fontSize={10} fontWeight="700" fill="#15803D">ACTIVE</text>
<rect x={npInaCx-34} y={npResHY-11} width={68} height={22} rx={11} fill="#FFF7ED" stroke="#F97316" strokeWidth={1.5} />
<text x={npInaCx} y={npResHY+4} textAnchor="middle" fontSize={10} fontWeight="700" fill="#C2410C">INACTIVE</text>
<rect x={npActCx-npResW/2} y={npResY} width={npResW} height={npResH} rx={8} fill="#F0FDF4" stroke="#22C55E" strokeWidth={1.5} />
<text x={npActCx} y={npResY+16} textAnchor="middle" fontSize={10} fontWeight="600" fill="#15803D">Check-up or</text>
<text x={npActCx} y={npResY+30} textAnchor="middle" fontSize={10} fontWeight="600" fill="#15803D">tooth problem?</text>
<text x={npActCx} y={npResY+48} textAnchor="middle" fontSize={9} fill="#9CA3AF" fontStyle="italic"> book appt</text>
{/* NP ACTIVE result */}
<rect x={npActCx-npActW/2} y={npResY} width={npActW} height={npActH} rx={8} fill="#F0FDF4" stroke="#22C55E" strokeWidth={1.5} />
<text x={npActCx} y={npResY+16} textAnchor="middle" fontSize={10} fontWeight="600" fill="#15803D">MassHealth active!</text>
<text x={npActCx} y={npResY+30} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">Ask date &amp; time</text>
<text x={npActCx} y={npResY+46} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">Office hours check</text>
<text x={npActCx} y={npResY+62} textAnchor="middle" fontSize={9} fill="#047857" fontWeight="600"> Appt created</text>
<rect x={npInaCx-npResW/2} y={npResY} width={npResW} height={npResH} rx={8} fill="#FFF7ED" stroke="#F97316" strokeWidth={1.5} />
<text x={npInaCx} y={npResY+16} textAnchor="middle" fontSize={10} fontWeight="600" fill="#C2410C">Inactive.</text>
<text x={npInaCx} y={npResY+30} textAnchor="middle" fontSize={10} fontWeight="600" fill="#C2410C">Self-pay?</text>
<text x={npInaCx} y={npResY+50} textAnchor="middle" fontSize={9} fill="#9CA3AF" fontStyle="italic">YES/NO</text>
{/* NP INACTIVE → other insurance? */}
<rect x={npInaCx-npInaW/2} y={npResY} width={npInaW} height={npInaH} rx={8} fill="#FFF7ED" stroke="#F97316" strokeWidth={1.5} />
<text x={npInaCx} y={npResY+18} textAnchor="middle" fontSize={10} fontWeight="600" fill="#C2410C">Coverage inactive</text>
<text x={npInaCx} y={npResY+36} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">or not verified</text>
{/* ═══════════ RIGHT BRANCH — EXISTING PATIENT ════════════════ */}
<line x1={npInaCx} y1={npResY+npInaH} x2={npInaCx} y2={npOins2Y-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph2)" />
<rect x={npInaCx-npOins2W/2} y={npOins2Y} width={npOins2W} height={npOins2H} rx={8} fill="#FEF9C3" stroke="#CA8A04" strokeWidth={1.5} />
<text x={npInaCx} y={npOins2Y+18} textAnchor="middle" fontSize={10} fontWeight="600" fill="#92400E">Other insurance?</text>
<text x={npInaCx} y={npOins2Y+36} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">"Yes" or "No"</text>
<rect x={rcx-brW/2} y={brY} width={brW} height={brH} rx={8} fill="#F5F3FF" stroke="#8B5CF6" strokeWidth={1.5} />
<text x={rcx} y={brY+22} textAnchor="middle" fontSize={11} fontWeight="600" fill="#5B21B6">Do you still have</text>
<text x={rcx} y={brY+38} textAnchor="middle" fontSize={11} fontWeight="600" fill="#5B21B6">the same insurance?</text>
{/* Final fork: yes=transfer, no=contact info */}
<line x1={npInaCx} y1={npOins2Y+npOins2H} x2={npInaCx} y2={npFinalY-16} stroke="#9CA3AF" strokeWidth={1.5} />
<line x1={npTxCx} y1={npFinalY-16} x2={npCiCx} y2={npFinalY-16} stroke="#9CA3AF" strokeWidth={1.5} />
<line x1={npTxCx} y1={npFinalY-16} x2={npTxCx} y2={npFinalY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph2)" />
<line x1={npCiCx} y1={npFinalY-16} x2={npCiCx} y2={npFinalY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph2)" />
<line x1={rcx} y1={brY+brH} x2={rcx} y2={sfHY} stroke="#9CA3AF" strokeWidth={1.5} />
<line x1={rlcx} y1={sfHY} x2={rrcx} y2={sfHY} stroke="#9CA3AF" strokeWidth={1.5} />
<line x1={rlcx} y1={sfHY} x2={rlcx} y2={leafY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph)" />
<line x1={rrcx} y1={sfHY} x2={rrcx} y2={leafY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph)" />
<rect x={npTxCx-22} y={npFinalY-28} width={44} height={22} rx={11} fill="#F0FDF4" stroke="#22C55E" strokeWidth={1.5} />
<text x={npTxCx} y={npFinalY-13} textAnchor="middle" fontSize={10} fontWeight="700" fill="#15803D">Yes</text>
<rect x={npCiCx-22} y={npFinalY-28} width={44} height={22} rx={11} fill="#FFF7ED" stroke="#F97316" strokeWidth={1.5} />
<text x={npCiCx} y={npFinalY-13} textAnchor="middle" fontSize={10} fontWeight="700" fill="#C2410C">No</text>
<rect x={rlcx-20} y={sfHY-11} width={40} height={22} rx={11} fill="#F0FDF4" stroke="#22C55E" strokeWidth={1.5} />
<text x={rlcx} y={sfHY+4} textAnchor="middle" fontSize={10} fontWeight="700" fill="#15803D">YES</text>
<rect x={rrcx-20} y={sfHY-11} width={40} height={22} rx={11} fill="#FFF7ED" stroke="#F97316" strokeWidth={1.5} />
<text x={rrcx} y={sfHY+4} textAnchor="middle" fontSize={10} fontWeight="700" fill="#C2410C">NO</text>
<rect x={npTxCx-npTxW/2} y={npFinalY} width={npTxW} height={npTxH} rx={8} fill="#FFF7ED" stroke="#F97316" strokeWidth={1.5} />
<text x={npTxCx} y={npFinalY+16} textAnchor="middle" fontSize={10} fontWeight="600" fill="#C2410C">Transfer</text>
<text x={npTxCx} y={npFinalY+32} textAnchor="middle" fontSize={9} fill="#9CA3AF" fontStyle="italic">to staff</text>
{/* EP: YES — "Same insurance confirmed" */}
<rect x={rlcx-leafW/2} y={leafY} width={leafW} height={leafH} rx={8} fill="#F0FDF4" stroke="#22C55E" strokeWidth={1.5} />
<text x={rlcx} y={leafY+18} textAnchor="middle" fontSize={10} fontWeight="600" fill="#15803D">Same insurance</text>
<text x={rlcx} y={leafY+34} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">MassHealth auto-check</text>
<text x={rlcx} y={leafY+48} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">Other schedule</text>
<rect x={npCiCx-npCiW/2} y={npFinalY} width={npCiW} height={npCiH} rx={8} fill="#F9FAFB" stroke="#D1D5DB" strokeWidth={1.5} />
<text x={npCiCx} y={npFinalY+16} textAnchor="middle" fontSize={10} fontWeight="600" fill="#374151">Leave name &amp; phone</text>
<text x={npCiCx} y={npFinalY+32} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">Receptionist will</text>
<text x={npCiCx} y={npFinalY+48} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">contact you shortly</text>
{/* EP: NO — Transfer */}
<rect x={rrcx-leafW/2} y={leafY} width={leafW} height={leafH} rx={8} fill="#FFF7ED" stroke="#F97316" strokeWidth={1.5} />
<text x={rrcx} y={leafY+18} textAnchor="middle" fontSize={10} fontWeight="600" fill="#C2410C">Transfer</text>
<text x={rrcx} y={leafY+34} textAnchor="middle" fontSize={9} fill="#9CA3AF" fontStyle="italic">"Our staff will</text>
<text x={rrcx} y={leafY+48} textAnchor="middle" fontSize={9} fill="#9CA3AF" fontStyle="italic">assist you"</text>
{/* ═══════════ EXISTING PATIENT BRANCH ════════════════════════ */}
{/* EP: YES → MassHealth sub-fork */}
<line x1={rlcx} y1={leafY+leafH} x2={rlcx} y2={exForkHY} stroke="#9CA3AF" strokeWidth={1.5} />
<line x1={exMhCx} y1={exForkHY} x2={exOtherCx} y2={exForkHY} stroke="#9CA3AF" strokeWidth={1.5} />
<line x1={exMhCx} y1={exForkHY} x2={exMhCx} y2={exCheckY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph)" />
<line x1={exOtherCx} y1={exForkHY} x2={exOtherCx} y2={exCheckY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph)" />
{/* Same insurance? */}
<rect x={rcx-epInsW/2} y={epInsY} width={epInsW} height={epInsH} rx={8} fill="#F5F3FF" stroke="#8B5CF6" strokeWidth={1.5} />
<text x={rcx} y={epInsY+18} textAnchor="middle" fontSize={11} fontWeight="600" fill="#5B21B6">Got it existing patient!</text>
<text x={rcx} y={epInsY+34} textAnchor="middle" fontSize={11} fontWeight="600" fill="#5B21B6">Same insurance on file?</text>
<text x={rcx} y={epInsY+52} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">"Yes" / "No" / "Changed"</text>
<rect x={exMhCx-36} y={exForkHY-11} width={72} height={22} rx={11} fill="#ECFDF5" stroke="#10B981" strokeWidth={1.5} />
<text x={exMhCx} y={exForkHY+4} textAnchor="middle" fontSize={10} fontWeight="700" fill="#065F46">MassHealth</text>
<rect x={exOtherCx-32} y={exForkHY-11} width={64} height={22} rx={11} fill="#E0F2FE" stroke="#0EA5E9" strokeWidth={1.5} />
<text x={exOtherCx} y={exForkHY+4} textAnchor="middle" fontSize={10} fontWeight="700" fill="#0369A1">Other ins.</text>
{/* Sub-fork 1 */}
<line x1={rcx} y1={epInsY+epInsH} x2={rcx} y2={epSf1Y} stroke="#9CA3AF" strokeWidth={1.5} />
<line x1={epSameCx} y1={epSf1Y} x2={epDiffCx} y2={epSf1Y} stroke="#9CA3AF" strokeWidth={1.5} />
<line x1={epSameCx} y1={epSf1Y} x2={epSameCx} y2={epSameY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph2)" />
<line x1={epDiffCx} y1={epSf1Y} x2={epDiffCx} y2={epDiffY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph2)" />
{/* EP: MassHealth — "Checking 30-60s" node */}
<rect x={exMhCx-exCheckW/2} y={exCheckY} width={exCheckW} height={exCheckH} rx={8} fill="#ECFDF5" stroke="#10B981" strokeWidth={1.5} />
<text x={exMhCx} y={exCheckY+18} textAnchor="middle" fontSize={10} fontWeight="600" fill="#065F46">Wait 30-60 secs</text>
<text x={exMhCx} y={exCheckY+34} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">Using saved ID &amp; DOB</text>
<rect x={epSameCx-22} y={epSf1Y-11} width={44} height={22} rx={11} fill="#F0FDF4" stroke="#22C55E" strokeWidth={1.5} />
<text x={epSameCx} y={epSf1Y+4} textAnchor="middle" fontSize={10} fontWeight="700" fill="#15803D">YES</text>
<rect x={epDiffCx-22} y={epSf1Y-11} width={44} height={22} rx={11} fill="#FFF7ED" stroke="#F97316" strokeWidth={1.5} />
<text x={epDiffCx} y={epSf1Y+4} textAnchor="middle" fontSize={10} fontWeight="700" fill="#C2410C">NO</text>
{/* EP: Other insurance — schedule directly */}
<rect x={exOtherCx-exCheckW/2} y={exCheckY} width={exCheckW} height={exCheckH} rx={8} fill="#F0FDF4" stroke="#22C55E" strokeWidth={1.5} />
<text x={exOtherCx} y={exCheckY+18} textAnchor="middle" fontSize={10} fontWeight="600" fill="#15803D">Schedule</text>
<text x={exOtherCx} y={exCheckY+34} textAnchor="middle" fontSize={9} fill="#9CA3AF" fontStyle="italic">"When to come in?"</text>
{/* Changed → transfer */}
<rect x={epDiffCx-epDiffW/2} y={epDiffY} width={epDiffW} height={epDiffH} rx={8} fill="#FFF7ED" stroke="#F97316" strokeWidth={1.5} />
<text x={epDiffCx} y={epDiffY+18} textAnchor="middle" fontSize={10} fontWeight="600" fill="#C2410C">Insurance changed</text>
<text x={epDiffCx} y={epDiffY+36} textAnchor="middle" fontSize={9} fill="#9CA3AF" fontStyle="italic">Transfer to staff</text>
{/* EP: MassHealth → Selenium */}
<line x1={exMhCx} y1={exCheckY+exCheckH} x2={exMhCx} y2={exSelY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph)" />
<rect x={exMhCx-exSelW/2} y={exSelY} width={exSelW} height={exSelH} rx={8}
{/* Same confirmed */}
<rect x={epSameCx-epSameW/2} y={epSameY} width={epSameW} height={epSameH} rx={8} fill="#F0FDF4" stroke="#22C55E" strokeWidth={1.5} />
<text x={epSameCx} y={epSameY+20} textAnchor="middle" fontSize={11} fontWeight="600" fill="#15803D">Insurance confirmed</text>
<text x={epSameCx} y={epSameY+38} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">MassHealth or Other?</text>
{/* Sub-fork 2 */}
<line x1={epSameCx} y1={epSameY+epSameH} x2={epSameCx} y2={epSf2Y} stroke="#9CA3AF" strokeWidth={1.5} />
<line x1={epMhCx} y1={epSf2Y} x2={epOthCx} y2={epSf2Y} stroke="#9CA3AF" strokeWidth={1.5} />
<line x1={epMhCx} y1={epSf2Y} x2={epMhCx} y2={epMhY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph2)" />
<line x1={epOthCx} y1={epSf2Y} x2={epOthCx} y2={epOthY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph2)" />
<rect x={epMhCx-36} y={epSf2Y-11} width={72} height={22} rx={11} fill="#ECFDF5" stroke="#10B981" strokeWidth={1.5} />
<text x={epMhCx} y={epSf2Y+4} textAnchor="middle" fontSize={10} fontWeight="700" fill="#065F46">MassHealth</text>
<rect x={epOthCx-28} y={epSf2Y-11} width={56} height={22} rx={11} fill="#E0F2FE" stroke="#0EA5E9" strokeWidth={1.5} />
<text x={epOthCx} y={epSf2Y+4} textAnchor="middle" fontSize={10} fontWeight="700" fill="#0369A1">Other</text>
{/* Other ins → schedule */}
<rect x={epOthCx-epOthW/2} y={epOthY} width={epOthW} height={epOthH} rx={8} fill="#F0FDF4" stroke="#22C55E" strokeWidth={1.5} />
<text x={epOthCx} y={epOthY+16} textAnchor="middle" fontSize={10} fontWeight="600" fill="#15803D">Other insurance</text>
<text x={epOthCx} y={epOthY+32} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">Ask preferred date &amp; time</text>
<text x={epOthCx} y={epOthY+48} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">Office hours check</text>
<text x={epOthCx} y={epOthY+64} textAnchor="middle" fontSize={9} fill="#047857" fontWeight="600"> Appointment created</text>
{/* EP MassHealth auto-check */}
<rect x={epMhCx-epMhW/2} y={epMhY} width={epMhW} height={epMhH} rx={8} fill="#ECFDF5" stroke="#10B981" strokeWidth={1.5} />
<text x={epMhCx} y={epMhY+18} textAnchor="middle" fontSize={10} fontWeight="600" fill="#065F46">MassHealth auto-check</text>
<text x={epMhCx} y={epMhY+34} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">Using stored ID + DOB</text>
<text x={epMhCx} y={epMhY+50} textAnchor="middle" fontSize={8} fill="#9CA3AF" fontStyle="italic">Please wait 30-60 secs</text>
{/* EP Selenium */}
<line x1={epMhCx} y1={epMhY+epMhH} x2={epMhCx} y2={epSelY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph2)" />
<rect x={epMhCx-epSelW/2} y={epSelY} width={epSelW} height={epSelH} rx={8}
fill="#F0F9FF" stroke="#0EA5E9" strokeWidth={1.5} strokeDasharray="5 3" />
<rect x={exMhCx-38} y={exSelY-11} width={76} height={22} rx={11} fill="#E0F2FE" stroke="#0EA5E9" strokeWidth={1.5} />
<text x={exMhCx} y={exSelY+4} textAnchor="middle" fontSize={10} fontWeight="700" fill="#0369A1">Selenium</text>
<text x={exMhCx} y={exSelY+20} textAnchor="middle" fontSize={10} fontWeight="600" fill="#0369A1">MassHealth Portal</text>
<text x={exMhCx} y={exSelY+36} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">Auto-checks eligibility</text>
<rect x={epMhCx-38} y={epSelY-11} width={76} height={22} rx={11} fill="#E0F2FE" stroke="#0EA5E9" strokeWidth={1.5} />
<text x={epMhCx} y={epSelY+4} textAnchor="middle" fontSize={10} fontWeight="700" fill="#0369A1">Selenium</text>
<text x={epMhCx} y={epSelY+20} textAnchor="middle" fontSize={10} fontWeight="600" fill="#0369A1">MassHealth Portal</text>
<text x={epMhCx} y={epSelY+36} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">Auto-checks eligibility</text>
<text x={epMhCx} y={epSelY+52} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">Result sent via SMS</text>
{/* EP: ACTIVE / INACTIVE fork */}
<line x1={exMhCx} y1={exSelY+exSelH} x2={exMhCx} y2={exResHY} stroke="#9CA3AF" strokeWidth={1.5} />
<line x1={exActCx} y1={exResHY} x2={exInaCx} y2={exResHY} stroke="#9CA3AF" strokeWidth={1.5} />
<line x1={exActCx} y1={exResHY} x2={exActCx} y2={exLeafY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph)" />
<line x1={exInaCx} y1={exResHY} x2={exInaCx} y2={exLeafY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph)" />
{/* EP ACTIVE / INACTIVE */}
<line x1={epMhCx} y1={epSelY+epSelH} x2={epMhCx} y2={epResHY} stroke="#9CA3AF" strokeWidth={1.5} />
<line x1={epActCx} y1={epResHY} x2={epInaCx} y2={epResHY} stroke="#9CA3AF" strokeWidth={1.5} />
<line x1={epActCx} y1={epResHY} x2={epActCx} y2={epResY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph2)" />
<line x1={epInaCx} y1={epResHY} x2={epInaCx} y2={epResY-2} stroke="#9CA3AF" strokeWidth={1.5} markerEnd="url(#nph2)" />
<rect x={exActCx-28} y={exResHY-11} width={56} height={22} rx={11} fill="#F0FDF4" stroke="#22C55E" strokeWidth={1.5} />
<text x={exActCx} y={exResHY+4} textAnchor="middle" fontSize={10} fontWeight="700" fill="#15803D">ACTIVE</text>
<rect x={exInaCx-34} y={exResHY-11} width={68} height={22} rx={11} fill="#FFF7ED" stroke="#F97316" strokeWidth={1.5} />
<text x={exInaCx} y={exResHY+4} textAnchor="middle" fontSize={10} fontWeight="700" fill="#C2410C">INACTIVE</text>
<rect x={epActCx-28} y={epResHY-11} width={56} height={22} rx={11} fill="#F0FDF4" stroke="#22C55E" strokeWidth={1.5} />
<text x={epActCx} y={epResHY+4} textAnchor="middle" fontSize={10} fontWeight="700" fill="#15803D">ACTIVE</text>
<rect x={epInaCx-34} y={epResHY-11} width={68} height={22} rx={11} fill="#FFF7ED" stroke="#F97316" strokeWidth={1.5} />
<text x={epInaCx} y={epResHY+4} textAnchor="middle" fontSize={10} fontWeight="700" fill="#C2410C">INACTIVE</text>
<rect x={exActCx-exLeafW/2} y={exLeafY} width={exLeafW} height={exLeafH} rx={8} fill="#F0FDF4" stroke="#22C55E" strokeWidth={1.5} />
<text x={exActCx} y={exLeafY+18} textAnchor="middle" fontSize={10} fontWeight="600" fill="#15803D">When to</text>
<text x={exActCx} y={exLeafY+32} textAnchor="middle" fontSize={10} fontWeight="600" fill="#15803D">come in?</text>
<text x={exActCx} y={exLeafY+50} textAnchor="middle" fontSize={9} fill="#9CA3AF" fontStyle="italic"> book appt</text>
<rect x={epActCx-epActW/2} y={epResY} width={epActW} height={epActH} rx={8} fill="#F0FDF4" stroke="#22C55E" strokeWidth={1.5} />
<text x={epActCx} y={epResY+16} textAnchor="middle" fontSize={10} fontWeight="600" fill="#15803D">Coverage active!</text>
<text x={epActCx} y={epResY+30} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">Ask date &amp; time</text>
<text x={epActCx} y={epResY+46} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">Office hours check</text>
<text x={epActCx} y={epResY+62} textAnchor="middle" fontSize={9} fill="#047857" fontWeight="600"> Appt created</text>
<rect x={exInaCx-exLeafW/2} y={exLeafY} width={exLeafW} height={exLeafH} rx={8} fill="#FFF7ED" stroke="#F97316" strokeWidth={1.5} />
<text x={exInaCx} y={exLeafY+18} textAnchor="middle" fontSize={10} fontWeight="600" fill="#C2410C">Inactive.</text>
<text x={exInaCx} y={exLeafY+32} textAnchor="middle" fontSize={10} fontWeight="600" fill="#C2410C">Self-pay?</text>
<text x={exInaCx} y={exLeafY+50} textAnchor="middle" fontSize={9} fill="#9CA3AF" fontStyle="italic">YES/NO</text>
<rect x={epInaCx-epInaW/2} y={epResY} width={epInaW} height={epInaH} rx={8} fill="#FFF7ED" stroke="#F97316" strokeWidth={1.5} />
<text x={epInaCx} y={epResY+18} textAnchor="middle" fontSize={10} fontWeight="600" fill="#C2410C">Coverage inactive</text>
<text x={epInaCx} y={epResY+34} textAnchor="middle" fontSize={9} fill="#6B7280" fontStyle="italic">Self-pay offer?</text>
<text x={epInaCx} y={epResY+50} textAnchor="middle" fontSize={8} fill="#9CA3AF" fontStyle="italic">YES schedule / NO close</text>
</svg>
);
}
@@ -974,7 +1046,7 @@ export function AiChatSettingsCard() {
Reminder &amp; Reschedule Flow
</TabsTrigger>
<TabsTrigger value="new_patient" className="flex-1 text-xs">
New Patient / After-Hours Flow
New Patient Flow
</TabsTrigger>
</TabsList>