- Replace in-memory Maps in aiHandoffStore with DB-backed async functions using new patient_conversation table (stage + aiHandoff per patient) - Add afterHoursEnabled to ai_settings table (persists across restarts) - Fix runtime crash in reschedule-graph: mon/tue/wed variables were out of scope in the next-week fallback branch (ReferenceError) - Wire rescheduleGreeting and generalFallback chat templates through to LangGraph nodes so user-configured messages take effect - Add otherNode to reminder-graph to handle unclassified patient replies (e.g. "I want another appointment") and route to booking flow - Fetch chatTemplates once per webhook request instead of per stage Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
38 lines
1.2 KiB
TypeScript
38 lines
1.2 KiB
TypeScript
import * as z from 'zod';
|
|
import { PatientStatusSchema } from '../../enums/PatientStatus.schema';
|
|
// prettier-ignore
|
|
export const PatientModelSchema = z.object({
|
|
id: z.number().int(),
|
|
firstName: z.string(),
|
|
lastName: z.string(),
|
|
dateOfBirth: z.date().nullable(),
|
|
gender: z.string(),
|
|
phone: z.string(),
|
|
email: z.string().nullable(),
|
|
address: z.string().nullable(),
|
|
city: z.string().nullable(),
|
|
zipCode: z.string().nullable(),
|
|
insuranceProvider: z.string().nullable(),
|
|
insuranceId: z.string().nullable(),
|
|
groupNumber: z.string().nullable(),
|
|
policyHolder: z.string().nullable(),
|
|
allergies: z.string().nullable(),
|
|
medicalConditions: z.string().nullable(),
|
|
preferredLanguage: z.string().nullable(),
|
|
status: PatientStatusSchema,
|
|
userId: z.number().int(),
|
|
createdAt: z.date(),
|
|
updatedAt: z.date(),
|
|
user: z.unknown(),
|
|
appointments: z.array(z.unknown()),
|
|
procedures: z.array(z.unknown()),
|
|
claims: z.array(z.unknown()),
|
|
groups: z.array(z.unknown()),
|
|
payment: z.array(z.unknown()),
|
|
communications: z.array(z.unknown()),
|
|
documents: z.array(z.unknown()),
|
|
conversation: z.unknown().nullable()
|
|
}).strict();
|
|
|
|
export type PatientPureType = z.infer<typeof PatientModelSchema>;
|