> ## 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 Statement Tracking

> See how many billing statements a patient has been sent and when the most recent one went out.

One row per patient per warehouse tracking billing statement state from Elation Billing - how many statements have been sent, when the most recent one was sent, and whether statements should be sent to the patient at all. Join back to `patient` via `patient_id` for demographics.

This table's columns and relationships are shown in the [Hosted Database schema](/articles/hdb/schema).

<Note>
  `patient_statement_tracking.patient_id` joins to `patient.id` and is null when the Elation Billing patient has no crosswalk to an HDB patient.
</Note>

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

* Patients who have never been sent a statement
* When each patient was last sent a statement
* Patients excluded from statements via the `send_stmt` flag

## Statement status per patient

Returns each patient's statement state, joined to `patient` for the name, with a `never_sent_statement` flag derived from `last_statement`. Order by `last_statement` for the most recent send, or filter to `never_sent_statement = true` for patients who have never been sent one.

<CodeGroup>
  ```sql sql theme={null}
  select
      pst.patient_id
    , p.full_name
    , pst.statement_counter
    , pst.last_statement
    , pst.send_stmt
    , pst.last_statement is null as never_sent_statement
  from patient_statement_tracking pst
    left join patient p on p.id = pst.patient_id
  where pst.is_deleted = false
  order by pst.last_statement desc nulls last;
  ```
</CodeGroup>

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