feat: add multi_claim intent for different procedures per patient + fix batch claim PDF race
- Add multi_claim intent so AI correctly handles "claim X for patient A and Y for patient B" instead of applying all procedures to all patients (batch_claim) - Each patient carries their own matchedCodes in the queue - Fix batch claim PDF race condition: chatbot queue no longer advances in closeClaim(), instead advances after selenium PDF is downloaded (matching column claim behavior) - Align United SCO eligibility worker with claim worker: only fill subscriber ID + DOB, use treatmentLocation by ID instead of arrow-wrapper click Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,7 @@ export type InternalChatIntent =
|
||||
| "find_patient" // look up patient record only
|
||||
| "schedule_appointment" // add patient to today's (or specified) schedule
|
||||
| "claim_only" // submit claim for procedures (no eligibility check)
|
||||
| "multi_claim" // different procedures for different patients by name
|
||||
| "preauth" // submit pre-authorization for procedures
|
||||
| "navigate_claims"
|
||||
| "navigate_schedule"
|
||||
@@ -35,6 +36,8 @@ export interface ChatClassification {
|
||||
renderingProvider?: string; // raw name, e.g. "Kai Gao", "Dr. Smith"
|
||||
// --- procedures (raw text, NOT CDT codes — CDT lookup is done in workflow) ---
|
||||
procedureNames?: string[]; // for check_and_claim, e.g. ["perio exam", "adult cleaning"]
|
||||
// --- multi_claim (different procedures per patient) ---
|
||||
claimGroups?: { patientName: string; procedureNames: string[] }[];
|
||||
// --- scheduling ---
|
||||
appointmentDate?: string; // for schedule_appointment, YYYY-MM-DD (omit = today)
|
||||
appointmentTime?: string; // for schedule_appointment, HH:MM 24h (omit = 09:00)
|
||||
@@ -61,6 +64,7 @@ Respond ONLY with valid JSON (no markdown fences):
|
||||
"insuranceHint": "<insurance name only if explicitly stated in the message, e.g. 'masshealth', 'BCBS MA', 'CCA'>",
|
||||
"renderingProvider": "<provider/doctor name only if explicitly stated, e.g. 'Kai Gao', 'Dr. Smith' — omit if not mentioned>",
|
||||
"procedureNames": ["<raw procedure name>", ...],
|
||||
"claimGroups": [{"patientName": "<name>", "procedureNames": ["<procedure>", ...]}, ...],
|
||||
"appointmentDate": "<YYYY-MM-DD; use today's date (${today}) if user says 'today'; omit only if no date is mentioned at all>",
|
||||
"appointmentTime": "<HH:MM 24h if a specific time is mentioned, omit if not stated>",
|
||||
"fallbackReply": "<1-2 sentence reply to show the user>"
|
||||
@@ -94,6 +98,13 @@ Intents:
|
||||
e.g. "perio exam, adult cleaning for Maria and John"
|
||||
Use this ONLY when procedures AND two or more patient names are given.
|
||||
Put each patient name into the "patientNames" array. Put procedure names in "procedureNames".
|
||||
- multi_claim : user wants to claim DIFFERENT procedures for DIFFERENT patients identified by NAME
|
||||
e.g. "claim #13 crown for flor and claim d5212 for bian"
|
||||
e.g. "claim perio exam for Maria and claim adult prophy for John"
|
||||
e.g. "claim D0120 for Jane and D1110 for Bob"
|
||||
Use this when each patient has their OWN distinct set of procedures.
|
||||
Put each patient+procedures group into the "claimGroups" array.
|
||||
Do NOT use batch_claim for this — batch_claim is ONLY for the SAME procedures applied to ALL patients.
|
||||
- batch_check_and_claim : user provides MULTIPLE member IDs with DOBs AND wants to claim PROCEDURES for all of them
|
||||
e.g. "check mh for 100xxxx 10/10/1988 and 200xxxx 5/5/2000, and claim perio exam and adult prophy"
|
||||
e.g. "check 100xxxx, 10/10/1988 and 200xxxx, 5/5/2000 and claim D0120 D1110 for them"
|
||||
|
||||
Reference in New Issue
Block a user