feat: batch eligibility by patient name + "Check All & Appointment Today" option

- Add batch_eligibility_by_name intent so "check Mary and Sinthia" resolves multiple names
- Add "Check All & Appointment Today" button to batch eligibility UI — creates appointment for each patient after their eligibility check completes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
ff
2026-06-19 23:32:05 -04:00
parent e081f32648
commit 60689e58f6
4 changed files with 136 additions and 8 deletions

View File

@@ -394,6 +394,18 @@ export function ChatbotButton() {
prefillAndNavigate(first!.memberId, first!.dob, first!.autoCheck);
};
const handleBatchEligibilityAndAppointment = () => {
if (!batchEligibilityData || batchEligibilityData.length === 0) return;
addMsg("user", `Check all & appointment today (${batchEligibilityData.length} patients)`);
addMsg("bot", `Checking ${batchEligibilityData.length} patients — appointments will be created after each check...`);
sessionStorage.setItem("chatbot_batch_appt_after_eligibility", "true");
const [first, ...rest] = batchEligibilityData;
if (rest.length > 0) {
sessionStorage.setItem("chatbot_eligibility_queue", JSON.stringify(rest));
}
prefillAndNavigate(first!.memberId, first!.dob, first!.autoCheck);
};
const handleEligibilityAndAppointment = async (targetDate?: string) => {
if (!eligibilityIdData) return;
const dateLabel = targetDate
@@ -896,6 +908,14 @@ export function ChatbotButton() {
<Stethoscope className="h-3 w-3 mr-1" />
Check All ({batchEligibilityData.length} patients)
</Button>
<Button
size="sm"
className="w-full h-8 text-xs bg-green-600 hover:bg-green-700 text-white"
onClick={handleBatchEligibilityAndAppointment}
>
<Calendar className="h-3 w-3 mr-1" />
Check All & Appointment Today
</Button>
<Button size="sm" variant="ghost" className="w-full h-8 text-xs" onClick={resetStep}>
Cancel
</Button>