> ## Documentation Index
> Fetch the complete documentation index at: https://help.elationhealth.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Appointment time changes

> Every time an appointment's scheduled time was set or changed, with the old and new times and who made the change.

The `appointment_time_change` table has one row per change to an appointment's scheduled time, including the time set when the appointment was booked. It holds the time the appointment moved from and to, when the change was made, and who made it. Join to `appointment` on `appointment_id`, and to `user` on `modified_by_user_id`.

This table's columns and relationships are shown in the [Hosted Database schema](https://help.elationhealth.com/articles/hdb/schema.md).

**For reporting on but not limited to:**

* How often appointments are rescheduled, by practice, provider, or period
* How much notice a reschedule gives, and how many are same-day
* The full scheduling history of one appointment
* Appointments that moved more than once before they were kept

## Before you query appointment time changes

### The first row is the booking, not a reschedule

The row where `old_appt_time` is null records the time set when the appointment was booked. Every other row is a reschedule from `old_appt_time` to `new_appt_time`. Filter on `old_appt_time is not null` to count reschedules, and leave the filter off when you want each appointment's starting time as well.

The appointment's current time is `appointment.appt_time`, which matches `new_appt_time` on the most recent change.

### History starts on 2025-07-01

Changes made before 2025-07-01 are not recorded. An appointment booked earlier has no booking row, and reschedules made before that date are missing, so an appointment can appear to start at a time it was moved to rather than the time it was booked for. Restrict a reschedule rate to appointments booked on or after 2025-07-01, so the appointments in the numerator and the denominator cover the same period.

### Appointment times and change times use different time zones

`old_appt_time` and `new_appt_time` are in your practice's time zone, the same as `appointment.appt_time`. `modified_time` is in Pacific Time. Convert one before comparing them, for example to measure how much notice a reschedule gave. The Hosted Database does not carry a practice's time zone, so name it in the query, as the [notice given by a reschedule](#notice-given-by-a-reschedule) example does.

### Rows are never changed or removed

A change stays recorded even after the appointment is deleted, so the table keeps the history of appointments that no longer appear in the schedule. To leave deleted appointments out, join `appointment` and filter on its `deletion_time`.

### Some changes are recorded against an Elation system user

A change made through an integration rather than by a person is recorded against an Elation system user. That user carries no first or last name, and occasionally has no row in `user` at all. Left join `user` so these rows are kept, and expect a blank name rather than a person's.

### Only the scheduled time is recorded

Changes to an appointment's duration, provider, type, or status are not in this table. For status history, including cancellations, use `appointment_status`.

## The scheduling history of one appointment

Returns every change to one appointment in order, starting with the time it was booked for.

```sql sql theme={null}
select
    c.appointment_id
  , c.old_appt_time
  , c.new_appt_time
  , c.modified_time
  , c.modified_by_user_id
  , concat(u.first_name, ' ', u.last_name) as modified_by
from appointment_time_change c
  left join user u on u.id = c.modified_by_user_id
where c.appointment_id = <appointment_id>
order by c.modified_time;
```

## Reschedules by practice and month

Counts reschedules, and the appointments behind them, for each practice in each month. An appointment moved three times counts as three reschedules and one appointment.

```sql sql theme={null}
select
    c.practice_id
  , pr.name as practice_name
  , date_trunc('month', c.modified_time)::date as month
  , count(*) as reschedules
  , count(distinct c.appointment_id) as appointments_rescheduled
from appointment_time_change c
  left join practice pr on pr.id = c.practice_id
where c.old_appt_time is not null
  and c.modified_time >= '2026-01-01'
group by c.practice_id, pr.name, month
order by month, reschedules desc;
```

## Notice given by a reschedule

Measures how far ahead of the appointment each reschedule was made, and how many gave less than a day's notice. Replace `Pacific/Honolulu` with your practice's time zone, which puts `modified_time` on the same clock as `old_appt_time`. A negative figure is a change made after the appointment had already passed.

```sql sql theme={null}
with reschedule as (
    select
        c.practice_id
      , c.appointment_id
      , c.old_appt_time
      , datediff(
            'hour'
          , convert_timezone('America/Los_Angeles', 'Pacific/Honolulu', c.modified_time)
          , c.old_appt_time
        ) as hours_notice
    from appointment_time_change c
    where c.old_appt_time is not null
      and c.modified_time >= '2026-01-01'
)
select
    r.practice_id
  , pr.name as practice_name
  , count(*) as reschedules
  , count_if(r.hours_notice < 24) as under_24_hours_notice
  , round(median(r.hours_notice), 1) as median_hours_notice
from reschedule r
  left join practice pr on pr.id = r.practice_id
group by r.practice_id, pr.name
order by reschedules desc;
```

## Appointments that moved more than once

Lists the appointments rescheduled most often, with the time they were originally booked for and the time they ended up at. Deleted appointments are left out.

```sql sql theme={null}
select
    c.appointment_id
  , a.patient_id
  , c.practice_id
  , count_if(c.old_appt_time is not null) as reschedules
  , min_by(c.new_appt_time, c.modified_time) as first_booked_for
  , a.appt_time as current_appt_time
  , max(c.modified_time) as last_changed
from appointment_time_change c
  join appointment a on a.id = c.appointment_id
where a.deletion_time is null
group by c.appointment_id, a.patient_id, c.practice_id, a.appt_time
having reschedules >= 3
order by reschedules desc
limit 100;
```

*If you have any questions about this topic please reach out to [Elation Support Portal](https://help.elationhealth.com/articles/support-portal-introduction.md) with the subject line HDB - \<your\_question>*
