feat: appointment type inference, procedure codes on cards, claim attachment fixes

- Add appointment type categories matching insurance claim form (recall, filling, pedo, dentures, implant, endo, crown, perio, extraction, ortho, consultation, emergency, other)
- Auto-infer appointment type from CDT codes with priority rules (endo > implant > crown > ...)
- typeLocked flag prevents auto-overwrite when user manually sets type
- Show appointment type label and procedure codes on schedule cards
- Background sync on /day route retroactively fixes stale appointment types
- Fix PUT /api/claims/:id to save claimFiles (previously silently dropped)
- Auto-link AppointmentFile records to ClaimFile when claim is created or updated
- Fix D5750 (denture reline) CDT range to map correctly to dentures category
- Fix typeLocked Zod rejection in appointment update route

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
ff
2026-05-29 14:18:10 -04:00
parent b20dc8e976
commit 9d0cfe5dba
260 changed files with 2443 additions and 1968 deletions

View File

@@ -67,6 +67,7 @@ import { SeleniumTaskBanner } from "@/components/ui/selenium-task-banner";
import { PatientStatusBadge } from "@/components/appointments/patient-status-badge";
import type { OfficeHoursData } from "@/components/settings/office-hours-card";
import { MessageThread } from "@/components/patient-connection/message-thread";
import { getAppointmentTypeLabel } from "@/utils/appointmentTypeUtils";
// Define types for scheduling
interface TimeSlot {
@@ -97,6 +98,7 @@ interface ScheduledAppointment {
endTime: string | Date;
status: string | null;
type: string;
procedureCodes?: string[];
}
function appointmentCardColor(apt: ScheduledAppointment): string {
@@ -569,6 +571,7 @@ export default function AppointmentsPage() {
patientInsuranceProvider,
hasProcedures: !!(apt as any).hasProcedures,
hasClaimWithNumber: !!(apt as any).hasClaimWithNumber,
procedureCodes: (apt as any).procedureCodes ?? [],
movedByAi: !!(apt as any).movedByAi,
staffId,
status: apt.status ?? null,
@@ -797,11 +800,14 @@ export default function AppointmentsPage() {
</span>
)}
</div>
<div className="truncate">
{appointment.type?.startsWith("other:")
? appointment.type.slice(6)
: appointment.type}
<div className="truncate text-[11px]">
{getAppointmentTypeLabel(appointment.type)}
</div>
{appointment.procedureCodes && appointment.procedureCodes.length > 0 && (
<div className="truncate text-[10px] opacity-80">
{appointment.procedureCodes.join(", ")}
</div>
)}
</div>
);
}