feat: batch eligibility, batch claim, and batch check+claim from AI chat
- Add batch_eligibility, batch_claim, and batch_check_and_claim intents to AI classifier so multiple patients can be processed one by one - Add queue processing on insurance-status and claims pages to auto-start the next patient after each check/claim completes - Make patient schema firstName, lastName, phone optional so patients can be created with just member ID + DOB from eligibility checks - Cancel buttons now preserve chat history instead of clearing it - Patient-found card shows Check Eligibility, Eligibility & Appointment Today, and Cancel buttons - Claim service date asks user to pick between latest appointment and today when they differ - Login page subtitle styled with animated gradient Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,9 @@ import { getLlm, type AiProvider } from "./llm-factory";
|
||||
export type InternalChatIntent =
|
||||
| "check_eligibility" // by patient name → look up in DB
|
||||
| "eligibility_by_id" // by explicit memberId + dob (no name)
|
||||
| "batch_eligibility" // multiple patients by memberId + dob
|
||||
| "batch_claim" // claim same procedures for multiple patients by name
|
||||
| "batch_check_and_claim" // eligibility + claim for multiple patients by memberId+dob
|
||||
| "check_and_claim" // eligibility + claim procedures
|
||||
| "find_patient" // look up patient record only
|
||||
| "schedule_appointment" // add patient to today's (or specified) schedule
|
||||
@@ -21,6 +24,10 @@ export interface ChatClassification {
|
||||
patientName?: string; // for check_eligibility / find_patient / schedule_appointment
|
||||
memberId?: string; // for eligibility_by_id / check_and_claim
|
||||
dob?: string; // for eligibility_by_id / check_and_claim (MM/DD/YYYY)
|
||||
// --- batch eligibility (multiple patients) ---
|
||||
patients?: { memberId: string; dob: string }[]; // for batch_eligibility
|
||||
// --- batch claim (same procedures for multiple patients by name) ---
|
||||
patientNames?: string[]; // for batch_claim
|
||||
// --- insurance hint (only if explicitly stated in the message) ---
|
||||
insuranceHint?: string; // raw text, e.g. "masshealth", "BCBS", "CCA"
|
||||
// --- rendering/treating provider (only if explicitly stated, e.g. "with provider Kai Gao") ---
|
||||
@@ -48,6 +55,8 @@ Respond ONLY with valid JSON (no markdown fences):
|
||||
"patientName": "<full name if mentioned by name>",
|
||||
"memberId": "<member/insurance ID if given explicitly or found in history>",
|
||||
"dob": "<date of birth in MM/DD/YYYY if given explicitly or found in history>",
|
||||
"patients": [{"memberId": "<id>", "dob": "<MM/DD/YYYY>"}, ...],
|
||||
"patientNames": ["<name1>", "<name2>", ...],
|
||||
"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>", ...],
|
||||
@@ -61,12 +70,27 @@ Omit any field that is not present in the message or history.
|
||||
Intents:
|
||||
- check_eligibility : user wants to check insurance for a patient identified by NAME only
|
||||
e.g. "check Maria Jesus", "verify insurance for John Smith"
|
||||
- eligibility_by_id : user provides a member ID and date of birth (no patient name)
|
||||
- eligibility_by_id : user provides a SINGLE member ID and date of birth (no patient name)
|
||||
e.g. "check masshealth for 100xxxx, 10/10/1988"
|
||||
ALSO use this when user wants to check eligibility AND schedule/add an appointment on a date
|
||||
e.g. "check mh for 100xxxx, 10/10/1988 and schedule on 4/10/2026"
|
||||
e.g. "check mh for 100xxxx, 10/10/1988 and make appointment on 5/1/2026"
|
||||
In these cases set appointmentDate to the mentioned date (YYYY-MM-DD)
|
||||
- batch_eligibility : user provides MULTIPLE member IDs with dates of birth in one message
|
||||
e.g. "check mh for 100xxxx 10/10/1988 and 200xxxx 5/5/2000"
|
||||
e.g. "check 100xxxx, 10/10/1988 and 200xxxx, 5/5/2000"
|
||||
Use this ONLY when TWO OR MORE distinct memberId+dob pairs are given.
|
||||
Put each pair into the "patients" array. Also set insuranceHint if stated.
|
||||
- batch_claim : user wants to claim the SAME procedures for MULTIPLE patients identified by NAME
|
||||
e.g. "claim perio exam and adult prophy for Jackaline and Keioson"
|
||||
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".
|
||||
- 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"
|
||||
Use this when TWO OR MORE memberId+dob pairs are given WITH procedures.
|
||||
Put each pair into "patients" array. Put procedure names in "procedureNames".
|
||||
- check_and_claim : user wants to check eligibility AND submit PROCEDURES/BILLING as claims
|
||||
e.g. "check masshealth for 100xxxx, 10/10/1988 and claim perio exam and adult cleaning"
|
||||
e.g. "check Maria Jesus and claim D0120 D1110"
|
||||
|
||||
Reference in New Issue
Block a user