Skip to navigation

FHIR bundles

Summarizing a patient’s FHIR R4 record: notes and structured data

Send FHIR R4 Bundles — for example from the Synth API, or exported from an EHR — in fhir_bundles. The summary is written from the bundle’s clinical notes and its structured record.

{
"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 DocumentReferenceUsed as
idThe document’s id, which citations point to
date (or context.period.start)Its date
subject → PatientThe patient check

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

DocumentFrom
fhir-patientPatient: age (on the day of the job) and sex only
fhir-problemsCondition: name, clinical status, onset
fhir-medicationsMedicationRequest: medication, status, dose, start date, reason
fhir-proceduresProcedure: name and date
fhir-immunizationsImmunization: vaccine and date
fhir-allergiesAllergyIntolerance: substance, status, reaction
fhir-encountersEncounter: 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.