invoices table

The invoices table in the Hospital Management System Database Schema schema has 11 columns, keyed by id, with 2 foreign keys to patients and encounters. 3 columns in invoice_lines, insurance_claims and payments reference it.

Totals are snapshotted at issue. A later price list change must never rewrite an issued invoice.

Columns (11)

Columns of the invoices table
ColumnTypeConstraintsDescription
iduuidprimary key
patient_iduuidnot null, references patients.id
encounter_iduuidreferences encounters.id
numbervarchar(40)unique, not null
statusinvoice_statusnot null
subtotal_centsintegernot null
insurance_covered_centsintegernot null
patient_due_centsintegernot null
currencychar(3)not null
issued_attimestamptznot null
due_attimestamptz

Indexes (2)

  • (patient_id, issued_at)
  • (status)

Relationships