feat: AI claim queue auto-return + D1120 age warning

- claims-page: after auto-submit closes the form, automatically navigate
  back to /appointments when an AI claim queue is pending resume, eliminating
  the manual navigation delay between appointments
- internal-chat-workflow: warn and block claim when D1120 (child prophy) is
  requested for a patient aged 14+ — recommend D1110 (adult prophy) instead,
  and advise manual claim if user insists on D1120

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
ff
2026-06-12 22:18:59 -04:00
parent 831f67b093
commit fd4feb3e76
4 changed files with 112 additions and 3 deletions

View File

@@ -813,6 +813,18 @@ export default function ClaimsPage() {
setIsClaimFormOpen(false);
clearUrlParams(["newPatient", "appointmentId"]);
// If an AI claim queue is pending resume, go straight back to appointments
try {
const raw = sessionStorage.getItem("ai_claim_queue");
if (raw) {
const parsed = JSON.parse(raw);
if (parsed?.pendingResume && Array.isArray(parsed.appointments) && parsed.appointments.length > 0) {
setWouterLocation("/appointments");
return;
}
}
} catch {}
};
// Pre Auth section

View File

@@ -170,6 +170,7 @@ export default function InsuranceStatusPage() {
const pendingAutoCheck = useRef<"mh" | "mh-history" | "cmsp" | "ddma" | "delta-ins" | "united-sco" | "tufts-sco" | "cca" | null>(null);
const [triggerTarget, setTriggerTarget] = useState<string | null>(null);
const pendingScrollTo = useRef<string | null>(null);
const [prefillTick, setPrefillTick] = useState(0);
// Prefill from chatbot
useEffect(() => {
@@ -188,6 +189,9 @@ export default function InsuranceStatusPage() {
}
if (ac) pendingAutoCheck.current = ac;
sessionStorage.removeItem("chatbot_eligibility");
// Increment tick so the auto-trigger effect re-fires even when
// memberId/dob are unchanged (same patient submitted a second time).
setPrefillTick((n) => n + 1);
} catch {}
};
apply();
@@ -658,7 +662,7 @@ export default function InsuranceStatusPage() {
setTriggerTarget(check);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [memberId, dateOfBirth]);
}, [memberId, dateOfBirth, prefillTick]);
// small helper: remove given query params from the current URL (silent, no reload)
const clearUrlParams = (params: string[]) => {