> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.emtelligent.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.emtelligent.com/_mcp/server.

# FHIR bundles

Send FHIR R4 Bundles — for example from the [Synth API](/synth/overview), or exported from an
EHR — in `fhir_bundles`. The summary is written from the bundle's clinical notes **and** its
structured record.

```json
{
  "fhir_bundles": [{"resourceType": "Bundle", "type": "transaction", "entry": [ … ]}],
  "prompt": "Summarize the active problems, current medications and recent results for a referral."
}
```

Several bundles can be sent, and `fhir_bundles` combines with `documents`, `prep_documents`
and `nlp_results` in one job. Each bundle should hold one patient.

## What is read

**Clinical notes.** Every `DocumentReference` with a text attachment (`text/plain` or
`text/markdown`, base64 in `attachment.data`) becomes a document:

| From the `DocumentReference`       | Used as                                                                          |
| ---------------------------------- | -------------------------------------------------------------------------------- |
| `id`                               | The document's `id`, which citations point to                                    |
| `date` (or `context.period.start`) | Its date                                                                         |
| `subject` → `Patient`              | The [patient check](/summarization/guides/several-documents#one-patient-per-job) |

**The structured record.** The summary also covers the bundle's structured record. Citations
to it use these ids, each beginning `fhir-`:

| Document                                 | From                                                                                                                                                    |
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `fhir-patient`                           | `Patient`: age (on the day of the job) and sex only                                                                                                     |
| `fhir-problems`                          | `Condition`: name, clinical status, onset                                                                                                               |
| `fhir-medications`                       | `MedicationRequest`: medication, status, dose, start date, reason                                                                                       |
| `fhir-procedures`                        | `Procedure`: name and date                                                                                                                              |
| `fhir-immunizations`                     | `Immunization`: vaccine and date                                                                                                                        |
| `fhir-allergies`                         | `AllergyIntolerance`: substance, status, reaction                                                                                                       |
| `fhir-encounters`                        | `Encounter`: date, type, place, reason                                                                                                                  |
| `fhir-labs-<date>`, `fhir-vitals-<date>` | `Observation` (laboratory, vital signs): one document per date, with values, units and reference ranges. With many dates, one per month or year instead |

With several bundles, the record ids carry the bundle's number: `fhir1-problems`,
`fhir2-problems`, …

A citation such as `[7]` → `fhir-labs-2026-08-14` tells the reader the statement comes from the
structured record, not from a note.

## What is left out

* **Notes that can't be read here** — a PDF or image attachment, an attachment given only as a
  link (`url`), or text that can't be decoded — are skipped. The result names them in a
  `documents_skipped` warning. The rest of the bundle is still summarized.
* Resources marked `entered-in-error` are ignored.
* Practitioners and organizations are used only to name where an encounter took place.

A bundle with no readable notes and no structured record is refused with `invalid_document`; a
request whose `fhir_bundles` item is not a FHIR Bundle with `invalid_fhir_bundle`.

## Billing

The structured record counts toward billing like text, along with the notes. See
[Limits and billing](/summarization/reference/limits).