feat: AI chat file uploads, RCT/PA tooth mapping, check+claim flow, service date column

- Chatbot: add paperclip button to attach X-ray/PDF files to claim submissions;
  files flow through chatbotFileStore into claim-form uploadedFiles for Selenium
- CDT lookup: auto-select D3310/D3320/D3330 by tooth number for RCT; strip #NN
  from procedure names before alias lookup so "1 pa, #3" → D0220 tooth 3;
  add "1 pa" alias for D0220; expand multi-PA notation via AI prompt rule
- AI classifier: add navigate_eligibility intent ("check mh" → /insurance-status);
  fix duplicate intent entry; add RCT and multi-PA prompt rules
- Check+claim flow: pass serviceDate through check_and_claim_ready actionData;
  tryClaimFromChatbot skips PDF preview and navigates straight to claims with
  memberId fallback lookup; wired into all provider onPdfReady callbacks
- Claims table: add Service Date column between Patient Name and Submission Date

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
ff
2026-06-07 23:47:48 -04:00
co-authored by Claude Sonnet 4.6
parent 19bb5c1145
commit 967a53fc6c
8 changed files with 243 additions and 41 deletions
+11 -1
View File
@@ -11,6 +11,7 @@ export type InternalChatIntent =
| "claim_only" // submit claim for procedures (no eligibility check)
| "navigate_claims"
| "navigate_schedule"
| "navigate_eligibility"
| "general";
export interface ChatClassification {
@@ -76,6 +77,8 @@ Intents:
Always extract appointmentDate when a date or "today" is mentioned
- navigate_claims : open the claims page
- navigate_schedule : open the appointments/schedule page
- navigate_eligibility : open the insurance eligibility page
e.g. "check mh", "check masshealth", "open eligibility", "go to eligibility", "check insurance"
- general : anything else
Rules:
@@ -83,9 +86,16 @@ Rules:
(e.g. "perio exam", "adult cleaning", "D0120") — do NOT translate to codes
- For composite fillings with a tooth number, preserve the EXACT notation including tooth# and surfaces:
e.g. "composite #29 O", "#8 MO", "composite #11 MOD" — keep the #number and surface letters together as one entry
- For RCT/root canal with a tooth number, preserve the tooth# in the entry:
e.g. "rct #29", "#14 root canal", "rct #6" — keep the #number with the procedure so the correct code can be selected
- For multiple PA X-rays with tooth numbers, expand each PA into its own entry:
"1 pa, #T" for the first tooth, "2nd pa, #T" for each additional tooth
e.g. "2 PA (#30, 15)" → ["1 pa, #30", "2nd pa, #15"]
e.g. "3 PA (#3, 14, 30)" → ["1 pa, #3", "2nd pa, #14", "2nd pa, #30"]
e.g. "2 pa #3 #14" → ["1 pa, #3", "2nd pa, #14"]
- insuranceHint is only set when the user explicitly names an insurance in the message
- Keep fallbackReply to 1-2 sentences
- For navigate intents, fallbackReply = "Opening the [page] page..."
- For navigate intents, fallbackReply = "Opening the [page] page..." (e.g. "Opening the eligibility page...")
- appointmentDate applies to BOTH schedule_appointment AND claim_only/check_and_claim:
always set it to today's date (${today}) when the user says "today", "this visit", or similar
set it to the specified date when the user mentions a date (e.g. "05/15/2026")