Skip to content

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.

  • 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_notes enables 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.
  • 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.
  1. Medical > Calendar.
  2. Route: /calendar/view.
  3. Open an existing appointment from month/week/day calendar views.
  4. In the appointment modal (ModalCalendarV2Component), click the trash icon (Delete appointment).
  5. Confirm in the warning dialog to complete deletion.

Scenario A: Provider deletes an appointment from own calendar

  1. Open Medical > Calendar.
  2. Click the appointment event to open details.
  3. Click the Delete appointment (trash) icon.
  4. In the warning dialog, click Yes, delete it.
  5. 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

  1. Open Medical > Calendar.
  2. Select a provider or patient context from calendar filters.
  3. Open the target appointment.
  4. Click the trash icon and confirm deletion.
  5. Confirm success and verify the selected shared calendar refreshes without that appointment.
  • Q: What happens if I click delete and then choose Cancel in 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.