Skip to main content
The patient_form_appointment_change table has one row per change staff made to a single form on a single appointment. It is the override layer on top of the forms an appointment type asks for: a form can be removed from one appointment, added to one appointment, or marked complete for one appointment. Join appointment_id to appointment.id and patient_form_id to patient_form.id. The forms an appointment starts with are in Forms required by an appointment type. This table is also where the answer to “did this appointment’s forms get done?” comes from, because a form can be complete without a submission. This table’s columns and relationships are shown in the Hosted Database schema. For reporting on but not limited to:
  • Forms marked complete by staff rather than submitted by the patient
  • The status of every form an appointment required
  • How often staff override the forms an appointment type asks for
  • Which staff mark forms complete, and how often

Before you query per-appointment form changes

marked_complete is the only change type used today

override_type can be one of three values:
  • not_required: the form was removed from this appointment, although its appointment type asks for it;
  • required: the form was added to this appointment, although its appointment type does not ask for it;
  • marked_complete: staff marked the form complete for this appointment, whether or not the patient submitted it.
In practice every row is marked_complete. The other two are supported and your queries should still handle them, but do not expect them in your data.

A row counts while deletion_time is null

Undoing a change, for example unmarking a form that was marked complete, sets deletion_time rather than removing the row. Always filter on deletion_time is null when asking what is true now, and leave the filter off only when you want the history of overrides including the ones that were undone.

The status of a form an appointment required, matching Elation

For a form that an appointment requires, the status is:
  • submitted if a patient_form_submission that counts has the same appointment_id and patient_form_id;
  • otherwise marked complete if a marked_complete row here counts for that appointment and form;
  • otherwise incomplete.
Submitted wins over marked complete, so a form the patient later filled in reads as submitted even though staff had already marked it done.

Start from the forms the appointment requires

This table only holds changes, so it says nothing about the forms that were never overridden. To report on an appointment’s forms, build the required list first from patient_form_appointment_type and then layer the status on top, as the status of every form an appointment required query does.

There is no practice on a change

A change carries only the appointment and the form. To group by practice, join appointment and use its practice_id.

Who undid a change is not always recorded

created_by_user_id is the member of staff who made the change. deleted_by_user_id is filled in only where Elation records who undid it, so expect nulls there.

Forms marked complete rather than submitted

Finds the forms staff marked complete where the patient never submitted them. These are the forms that count as done in Elation but have no patient answers behind them.

The status of every form an appointment required

Builds the appointment’s required forms from its appointment type, applies the per-appointment overrides, then gives each form a status.

How often staff mark forms complete

Counts marked-complete changes by practice and month, and how many of them were later undone.
If you have any questions about this topic please reach out to Elation Support Portal with the subject line HDB - <your_question>