feat: AI chatbot preauth intent, UnitedDH pre-auth improvements

- Add preauth intent to AI chatbot (classifier, workflow, frontend UI card)
- Auto-prefill preauth form with CDT codes, service date, and mapped prices
- Auto-trigger preauth Selenium handler by insurance siteKey (MH/Tufts/CCA/UnitedDH)
- Default tentative service date to today+3 for preauth (user didn't pick a date)
- Fix #number always means tooth number, distributes to all procedures in comma list
- Fix bare "post"/"pos" → D2954 (was matching D2955 via keyword scorer)
- UnitedDH pre-auth: fill procedure date with Ctrl+A to overwrite prefilled value
- UnitedDH pre-auth: select Location "Summit Dental Care" in step1 (same as billing entity)
- UnitedDH pre-auth: remove page refresh in step9 to preserve pre-auth number
- UnitedDH pre-auth: wait for table rows before extracting pre-auth number
- UnitedDH pre-auth/claim: explicit wait for Submit button after file upload (no sleep)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
ff
2026-06-17 01:21:51 -04:00
co-authored by Claude Sonnet 4.6
parent 43340ab39d
commit 8e011c5a29
8 changed files with 311 additions and 19 deletions
+16
View File
@@ -40,6 +40,8 @@ export default function ClaimsPage() {
const [isClaimFormOpen, setIsClaimFormOpen] = useState(false);
const [selectedPatientId, setSelectedPatientId] = useState<number | null>(null);
const [chatbotAutoSubmitSiteKey, setChatbotAutoSubmitSiteKey] = useState<string | undefined>(undefined);
const [chatbotInitialTab, setChatbotInitialTab] = useState<string | undefined>(undefined);
const [chatbotAutoSubmitPreauthSiteKey, setChatbotAutoSubmitPreauthSiteKey] = useState<string | undefined>(undefined);
// for redirect from appointment page directly, then passing to claimform
const [selectedAppointmentId, setSelectedAppointmentId] = useState<
number | null
@@ -258,6 +260,16 @@ export default function ClaimsPage() {
}
} catch {}
// Check if chatbot requested preauth tab
try {
const preauthRaw = sessionStorage.getItem("chatbot_preauth_prefill");
if (preauthRaw) {
setChatbotInitialTab("preauth");
const parsed = JSON.parse(preauthRaw);
if (parsed?.siteKey) setChatbotAutoSubmitPreauthSiteKey(parsed.siteKey);
}
} catch {}
handleNewClaim(id);
clearUrlParams(["newPatient"]);
}, [newPatient]);
@@ -946,6 +958,8 @@ export default function ClaimsPage() {
setSelectedPatientId(null);
setSelectedAppointmentId(null);
setChatbotAutoSubmitSiteKey(undefined);
setChatbotInitialTab(undefined);
setChatbotAutoSubmitPreauthSiteKey(undefined);
setIsClaimFormOpen(false);
clearUrlParams(["newPatient", "appointmentId"]);
@@ -1078,6 +1092,8 @@ export default function ClaimsPage() {
appointmentId={selectedAppointmentId ?? undefined}
autoSubmit={mode === "direct" || !!chatbotAutoSubmitSiteKey}
autoSubmitSiteKey={chatbotAutoSubmitSiteKey}
initialTab={chatbotInitialTab}
autoSubmitPreauth={chatbotAutoSubmitPreauthSiteKey}
proceduresOnly={mode === "procedures"}
onClose={closeClaim}
onSubmit={handleClaimSubmit}