diff --git a/apps/Frontend/src/components/appointments/appointment-form.tsx b/apps/Frontend/src/components/appointments/appointment-form.tsx index de8f7017..c8da8537 100755 --- a/apps/Frontend/src/components/appointments/appointment-form.tsx +++ b/apps/Frontend/src/components/appointments/appointment-form.tsx @@ -265,7 +265,7 @@ export function AppointmentForm({ title = format(data.date, "MMMM d"); } - let notes = data.notes || ""; + const notes = data.notes || ""; const selectedStaff = staffMembers.find((staff) => staff.id?.toString() === data.staffId) || @@ -273,14 +273,7 @@ export function AppointmentForm({ if (!selectedStaff) { console.error("No staff selected and no available staff in the list"); - return; // Handle this case as well - } - - // If there's no staff information in the notes, add it - if (!notes.includes("Appointment with")) { - notes = notes - ? `${notes}\nAppointment with ${selectedStaff?.name}` - : `Appointment with ${selectedStaff?.name}`; + return; } const formattedDate = formatLocalDate(data.date); diff --git a/apps/Frontend/src/pages/appointments-page.tsx b/apps/Frontend/src/pages/appointments-page.tsx index 4181dd62..21aecf3e 100755 --- a/apps/Frontend/src/pages/appointments-page.tsx +++ b/apps/Frontend/src/pages/appointments-page.tsx @@ -98,6 +98,7 @@ interface ScheduledAppointment { endTime: string | Date; status: string | null; type: string; + notes?: string | null; procedureCodes?: string[]; } @@ -571,6 +572,7 @@ export default function AppointmentsPage() { patientInsuranceProvider, hasProcedures: !!(apt as any).hasProcedures, hasClaimWithNumber: !!(apt as any).hasClaimWithNumber, + notes: (apt as any).notes ?? null, procedureCodes: (apt as any).procedureCodes ?? [], movedByAi: !!(apt as any).movedByAi, staffId, @@ -733,7 +735,7 @@ export default function AppointmentsPage() { status: apt.status ?? undefined, startTime: newTimeSlot.time, endTime: endTime, - notes: `Appointment with ${staff?.name}`, + notes: apt.notes ?? undefined, }; // Call update mutation updateAppointmentMutation.mutate({ @@ -838,6 +840,11 @@ export default function AppointmentsPage() { {appointment.procedureCodes.join(", ")} )} + {appointment.notes && ( +