> ## 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.

# Patient form requests

> Ad-hoc requests where staff sent one or more forms to a patient, with when they were sent, when they are due, and when the patient opened them.

The `patient_form_request` table has one row per ad-hoc patient form request: staff picked one or more forms in Elation and sent them to a patient. It holds when the request was sent and by whom, when it becomes overdue, and when the patient first opened it. Join to `patient` on `patient_id` and to `practice` on `practice_id`.

The forms on each request, and whether each one is complete, are in [Forms on a patient form request](https://help.elationhealth.com/articles/hdb/patient-form-request-form.md). Forms that an appointment requires do not come through this table; they reach patients as [Patient forms emails](https://help.elationhealth.com/articles/hdb/patient-form-email.md). For how staff send forms, see [Sending forms to patients](https://help.elationhealth.com/articles/Sending-forms-to-patients.md).

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:**

* Requests with forms still outstanding, and which of those are overdue
* Response rates for the forms a practice sends out
* How often patients open a request, and how quickly
* Which staff send the most form requests

## Before you query patient form requests

### Deleted requests are mostly the unanswered ones

Staff delete requests in Elation, and the ones they delete are mostly ones the patient never completed. Filtering on `deletion_time is null` therefore drops most of the unanswered requests, which makes a response rate look far better than it was. To measure what was actually sent, keep deleted requests: leave the `deletion_time` filter off, as the [response rate](#response-rate-for-the-forms-a-practice-sends) query below does.

Filter on `deletion_time is null` only when you want the requests a practice still sees in Elation, such as a worklist of outstanding forms.

### A request is sent when it is created

There is no separate sent time. `creation_time` is when the request was created and therefore sent, and `created_by_user_id` is the member of staff who sent it. Elation emails the patient at that moment if they have an email address on file. Requests created through the API are not emailed; the caller delivers the link. Whether an email actually went out, and any resends, are not recorded here.

Forms are never sent by SMS or through the patient portal.

### `due_date` is a due date, not a send date

`due_date` is when the request becomes overdue if forms are still outstanding. It is what the API calls `notification_date`, and it defaults to a week after the request was sent. A small share of requests carry far-future dates, for example in 2099 or `9999-01-01`, which in effect means the request has no due date. Cap or exclude those before averaging anything over `due_date`.

### There is no expired status

Form links do not expire with time. The nearest states are overdue, meaning `due_date` has passed with forms still outstanding, and deleted. A deleted request's link tells the patient it has expired, which is the only place the word appears.

### `viewed_at` covers the whole request

`viewed_at` is when the patient first opened the request, not when they opened a particular form on it. A request with three forms has one `viewed_at`, whether the patient filled in all three or none.

### Timestamps are Pacific Time

`creation_time`, `viewed_at`, and `deletion_time` are Pacific Time. `due_date` is either midnight on the due day or exactly a week after `creation_time`, on the same clock. Convert the current time to Pacific Time before comparing it with any of them, as the [outstanding requests](#requests-with-forms-still-outstanding) query does.

## Requests with forms still outstanding

Lists the current requests that have at least one form the patient has not completed, flagging the ones whose due date has passed.

```sql sql theme={null}
select
    r.id as patient_form_request_id
  , r.practice_id
  , r.patient_id
  , concat(pat.first_name, ' ', pat.last_name) as patient_name
  , r.creation_time as sent_at
  , r.due_date
  , r.viewed_at
  , count(*) as forms_sent
  , count_if(
        rf.patient_form_submission_id is null
        and rf.completed_override_at is null
    ) as forms_outstanding
  , iff(
        r.due_date < convert_timezone('America/Los_Angeles', current_timestamp())::timestamp_ntz
      , 'overdue'
      , 'outstanding'
    ) as request_status
from patient_form_request r
  join patient_form_request_form rf
    on rf.patient_form_request_id = r.id
   and rf.deletion_time is null
  left join patient pat on pat.id = r.patient_id
where r.deletion_time is null
group by r.id, r.practice_id, r.patient_id, patient_name, r.creation_time, r.due_date, r.viewed_at
having forms_outstanding > 0
order by r.due_date;
```

## Response rate for the forms a practice sends

Counts the forms each practice sent each month and how many came back completed. Deleted requests are deliberately kept, because they are mostly the ones that went unanswered.

```sql sql theme={null}
with sent as (
    select
        r.practice_id
      , date_trunc('month', r.creation_time)::date as month
      , r.id as request_id
      , rf.patient_form_submission_id
      , rf.completed_override_at
    from patient_form_request r
      join patient_form_request_form rf
        on rf.patient_form_request_id = r.id
       and rf.deletion_time is null
    where r.creation_time >= '2026-01-01'
)
select
    s.practice_id
  , pr.name as practice_name
  , s.month
  , count(distinct s.request_id) as requests_sent
  , count(*) as forms_sent
  , count_if(
        s.patient_form_submission_id is not null
        or s.completed_override_at is not null
    ) as forms_completed
  , round(
        100 * count_if(
            s.patient_form_submission_id is not null
            or s.completed_override_at is not null
        ) / count(*)
      , 1
    ) as pct_completed
from sent s
  left join practice pr on pr.id = s.practice_id
group by s.practice_id, pr.name, s.month
order by s.month, requests_sent desc;
```

## How often patients open a request

Shows how many requests each practice sent, how many the patient opened, and how long they took to open them. Deleted requests are kept here too, as an unopened request is often one that was later deleted.

```sql sql theme={null}
select
    r.practice_id
  , pr.name as practice_name
  , count(*) as requests_sent
  , count_if(r.viewed_at is not null) as requests_opened
  , round(100 * count_if(r.viewed_at is not null) / count(*), 1) as pct_opened
  , round(median(datediff('hour', r.creation_time, r.viewed_at)), 1) as median_hours_to_open
from patient_form_request r
  left join practice pr on pr.id = r.practice_id
where r.creation_time >= '2026-01-01'
group by r.practice_id, pr.name
order by requests_sent desc;
```

*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>*
