Skip to main content

Medical Superbill

The itemized statement a family practice hands a patient after an out-of-network visit, so the patient can claim the cost back from their health plan. It is one dense, ruled page: who treated the patient and under which identifiers, who the patient and the insured are, the visit, the diagnoses, every service with its code and fee, what was paid at the desk and what remains. A practice-management system prints one for every such visit, so every value on it comes from that visit's record.

  • Identifiers a claim is matched by. The practice's tax ID and group provider ID, the rendering provider's individual ID, the patient's member ID and group number, each in a label and value grid whose labels are row headers.
  • Lettered diagnoses. Up to four diagnosis codes, lettered A to D, bound from the diagnoses array. Each service points at the letters it was provided for, as a claim form asks.
  • Coded services, from data. One row per service from the services array: date, procedure code, modifier, diagnosis pointers, units, fee and line total, with the codes and amounts in a monospaced face so the columns line up.
  • Totals and the payment taken. The starter invoice-totals component closes on the balance due, beside the payment received at the visit on the starter invoice-payment component.
  • Archival and accessible. It claims PDF/A-2a and PDF/UA-1. The diagnosis and service tables have header cells, the clinic mark has alternate text, the provider's signature is text set in a script face, and the running footer is an artifact.

Features used: PDF/A-2a, PDF/UA-1 conformance, columns, tables, rules, SVG, data binding, components, headers and footers

How it's built​

The service rows repeat from the data. A row that holds an $item token is drawn once per entry of services, and the DX PTR cell carries the letters of the diagnoses table above it:

{
"table": {
"style": "grid",
"source": "$data.services",
"widths": [11, 8, 6, 42, 8, 7, 8, 10],
"rows": [
[{ "th": "DATE", "style": "th" }, { "th": "CODE", "style": "th" }, /* … */ { "th": "TOTAL", "style": "thR" }],
[
{ "td": "$item.date", "style": "tdMono" },
{ "td": "$item.code", "style": "tdCode" },
{ "td": "$item.modifier", "style": "tdMonoC" },
{ "td": "$item.description", "style": "td" },
{ "td": "$item.pointers", "style": "tdPtr" },
{ "td": "$item.units", "style": "tdMonoC" },
{ "td": "$item.fee", "style": "tdMonoR" },
{ "td": "$item.total", "style": "tdTotal" }
]
]
}
}

Each entry in services is one row: { "date": "11/12/2026", "code": "RX6305", "modifier": "", "description": "Bronchodilator inhalation solution, per 1 mg", "pointers": "A", "units": "3", "fee": "4.50", "total": "13.50" }. The diagnoses work the same way from diagnoses, each entry a pointer, a code and a description. The procedure and diagnosis codes belong to the fictional VPT and VICD-10 code sets; a practice binds the codes its own system holds.

The engine adds nothing up: each line total, the charges and the balance are values in the data, worked out by the billing system. Here the eight line totals come to 429.50, 250.00 was paid at the desk, and 179.50 remains. The totals are the starter invoice-totals component, restyled in the clinic's teal by defining its style names in the document's own styles:

{
"use": {
"name": "invoice-totals",
"params": {
"rows": [
{ "label": "Total charges", "value": "$data.totals.charges" },
{ "label": "Amount paid today", "value": "$data.totals.paid" }
],
"dueLabel": "BALANCE DUE",
"dueValue": "$data.statement.currency $data.totals.balance"
}
}
}