From b860fd213f4f65e8696d3581d16c6a3addb5248f Mon Sep 17 00:00:00 2001 From: Gitead Date: Tue, 1 Sep 2026 20:39:57 -0400 Subject: [PATCH] fix: allow chatbot auto-scheduling when eligibility status is UNKNOWN Only block appointment creation on explicit INACTIVE status, since scrapes for some plan types (e.g. MassHealth Child Medicaid) can land on UNKNOWN without actually finding an ineligible record. Co-Authored-By: Claude Sonnet 5 --- apps/Frontend/src/pages/insurance-status-page.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/Frontend/src/pages/insurance-status-page.tsx b/apps/Frontend/src/pages/insurance-status-page.tsx index 86b5a32c..5cb9a8c4 100755 --- a/apps/Frontend/src/pages/insurance-status-page.tsx +++ b/apps/Frontend/src/pages/insurance-status-page.tsx @@ -842,12 +842,13 @@ export default function InsuranceStatusPage() { const patient = await lookupRes.json(); if (!patient?.id) return; - // The eligibility check that just ran saved the result to patient.status — only book - // the appointment when insurance came back ACTIVE. - if (patient.status !== "ACTIVE") { + // The eligibility check that just ran saved the result to patient.status — only skip + // booking when insurance came back explicitly INACTIVE. ACTIVE and UNKNOWN (e.g. a + // scrape that couldn't confirm status but didn't find an ineligible record) still book. + if (patient.status === "INACTIVE") { toast({ title: "No appointment created", - description: `${patient.firstName ?? ""} ${patient.lastName ?? ""} insurance is ${patient.status === "INACTIVE" ? "inactive" : "not active"} — please add manually if needed.`.trim(), + description: `${patient.firstName ?? ""} ${patient.lastName ?? ""} insurance is inactive — please add manually if needed.`.trim(), variant: "destructive", }); return;