Delete Appointment
1. What does this feature do? (High-Level Overview)
Section titled “1. What does this feature do? (High-Level Overview)”This feature allows users to remove an existing appointment from the calendar after a confirmation step. It helps keep schedules accurate when sessions are canceled or entered by mistake.
2. Who is this for? (Roles & Permissions)
Section titled “2. Who is this for? (Roles & Permissions)”- Provider roles (for example RBT/BCBA/Analyst): Can delete appointments they can open in their own calendar context.
- Admin-style roles (for example Superadmin/Admin/Owner/Manager) or any role with
manage_notes: Can open shared calendars (after selecting provider or patient context) and delete appointments from that context.
Permission-related behavior:
manage_notesenables shared-calendar access, which determines which calendars and appointments the user can manage.- The backend enforces location and patient authorization before deletion, and appointment access is scoped to the current location context.
3. Business Rules & Enforcements
Section titled “3. Business Rules & Enforcements”- Rule 1: Deletion starts from the appointment detail modal by clicking the trash icon (
Delete appointment). - Rule 2: A confirmation dialog is mandatory before deleting. Users must confirm
Yes, delete it; otherwise no deletion happens. - Rule 3: The action is irreversible in the UI flow (
This action cannot be undone.). - Rule 4: On successful API deletion, the system shows a success message and refreshes the current calendar view so the event disappears.
- Rule 5: If deletion fails (for example authorization, current-location mismatch, or missing record), the system shows an error modal and keeps the appointment unchanged in the current view.
4. UI Placement
Section titled “4. UI Placement”- Medical > Calendar.
- Route:
/calendar/view. - Open an existing appointment from month/week/day calendar views.
- In the appointment modal (
ModalCalendarV2Component), click the trash icon (Delete appointment). - Confirm in the warning dialog to complete deletion.
5. How-To Guide (Step-by-Step)
Section titled “5. How-To Guide (Step-by-Step)”Scenario A: Provider deletes an appointment from own calendar
- Open
Medical > Calendar. - Click the appointment event to open details.
- Click the
Delete appointment(trash) icon. - In the warning dialog, click
Yes, delete it. - Wait for confirmation (
Delete Appointment) and verify the event no longer appears in the current calendar view.
Scenario B: Manager/Admin deletes from shared-calendar mode
- Open
Medical > Calendar. - Select a provider or patient context from calendar filters.
- Open the target appointment.
- Click the trash icon and confirm deletion.
- Confirm success and verify the selected shared calendar refreshes without that appointment.
6. What happens if…? (Edge Cases / FAQ)
Section titled “6. What happens if…? (Edge Cases / FAQ)”-
Q: What happens if I click delete and then choose
Cancelin the warning dialog?
A: No API delete request is sent, and the appointment remains unchanged. -
Q: What happens if the appointment was already removed by another user or process?
A: The API can return a not found error, and the UI shows an error modal (Error deleting appointment). -
Q: Is deletion blocked when an appointment already has a related note?
A: In this flow, the delete icon remains available. The code does not apply the same note-based restriction used for editing.