fix: extract appointmentDate for multi_claim/batch_claim/preauth intents

The classifier prompt only told the AI that appointmentDate applies to
schedule_appointment/claim_only/check_and_claim, so a trailing date like
"all on 6/23/26" was dropped for multi-patient claims even though the
workflow already reads c.appointmentDate for those intents and silently
defaulted to today.

Also add Prisma config/seed scripts and shopping-vendor types/schema updates.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-29 22:52:48 -04:00
parent cdda91f2b4
commit 26da3394aa
10 changed files with 351 additions and 3 deletions

View File

@@ -102,8 +102,12 @@ Intents:
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"
e.g. "claim post #6 for A and comp #10 DL for B, all on 6/23/26"
→ claimGroups: [{patientName:"A", procedureNames:["post #6"]}, {patientName:"B", procedureNames:["comp #10 DL"]}], appointmentDate: "2026-06-23"
Use this when each patient has their OWN distinct set of procedures.
Put each patient+procedures group into the "claimGroups" array.
A trailing date phrase like "all on <date>" or "on <date>" at the end of the message sets
appointmentDate for EVERY group — do not skip it just because it comes after multiple patients.
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"
@@ -192,9 +196,13 @@ Rules:
Extract just the name (without "Dr." prefix unless it's part of the name), omit if not mentioned
- Keep fallbackReply to 1-2 sentences
- 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:
- appointmentDate applies to ALL claim/scheduling intents — schedule_appointment, claim_only,
check_and_claim, batch_claim, multi_claim, batch_check_and_claim, and preauth:
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")
This applies even when the date is mentioned once at the END of the message and covers
multiple patients/groups (e.g. "...claim X for A and Y for B, all on 6/23/26" → appointmentDate
applies to every group, not just the last one mentioned)
omit it only when no date is mentioned at all (the backend will find the last appointment)
- IMPORTANT: Users type dates in American M/D/YYYY format (month first, then day).
e.g. "6/12/2026" means June 12 2026 (NOT December 6). "1/5/2026" means January 5 2026.