FHIR Bundle Viewer
Operator: Abdulla Al Fahad. How tools are built and checked
A FHIR Bundle is a list of resources that point at each other by reference, so reading one means chasing strings like Patient/pat-1 or urn:uuid:5b1a6f0e-0001 from an Observation back to a person, a Practitioner or an Encounter. This viewer does that chasing: it resolves every reference inside the bundle and gathers the conditions, medications, observations, allergies, procedures, immunizations, encounters and reports that belong to each patient.
It opens JSON and XML Bundles, or a single resource, in R4 or R5 form. The checks and the de-identified copy it makes are described below with their limits, because neither is a substitute for a FHIR validator or a privacy review.
Key features
- Resource counts by type and a searchable list with a one-line summary for each entry
- A patient summary with demographics and tables for conditions, medications, observations, allergies, procedures, immunizations, encounters and diagnostic reports
- References resolved through fullUrl, Type/id and absolute URLs, with unresolved ones listed with the path that holds them
- Basic structural checks and a CSV of observations that flags values outside the stated reference range
- A de-identified JSON copy with consistent pseudonyms, date shifting or year-only dates (partial dates such as 1951-07 included), request URLs rewritten to the new ids, and an itemised count of what was changed
How a bundle's entries, references and versions are read
A bundle does not state which FHIR version it uses, so R4 and R5 are read together. Where the releases differ, both forms are accepted: Encounter.class as a Coding or a list of CodeableConcepts, and a medication given as medicationCodeableConcept, medication.concept or a reference. The checks use only rules the two releases share, for example that an Observation needs a status and a code and that a Condition needs a subject.
XML is converted into the same structure as JSON. XML cannot say whether a single element is a list, so a fixed list of repeating element names (identifier, name, coding, entry, component, performer and so on) decides it, and numbers and booleans are typed from the element name. That is accurate for the common resources and is not a schema-driven conversion.
How it works
References are indexed by fullUrl and by Type/id. A reference matches an entry exactly, or by its Type/id tail when it is an absolute URL, and a #id reference matches a contained resource of the same resource. A clinical resource belongs to a patient when its subject or patient reference resolves to that Patient entry.
The flag on an observation uses its interpretation code when it has one; otherwise it compares a numeric value with the first stated reference range when both use the same unit, and says that the value is below or above the stated range. It never says a value is normal.
The de-identified copy is built from fresh objects with own-property writes, so a key such as __proto__ in a hostile file stays plain data. Every entry's resource gets a new id, every Reference.reference and fullUrl is rewritten to match, and references to targets outside the bundle become numbered placeholders. In a transaction or batch bundle the request keeps only its method and a URL rewritten the same way: Patient/123 becomes Patient/patient-1, a query string such as ?identifier=...|MRN-778812 is dropped, and ifNoneExist, ifMatch, ifNoneMatch and ifModifiedSince are not copied.
Dates matching the FHIR date and dateTime patterns under date-typed elements (birthDate, effective, onset, authoredOn, issued, sent, recorded, received, period start and end, timing events and similar) are moved by the same number of days, or cut to the year. A partial date such as 1951-07 or 1951 is moved from the first day of its month or year and keeps its precision. Names are recognised by shape wherever they sit, so a HumanName inside a contained Patient or a contact is redacted as well as the top-level Patient.name. Walks are limited to a depth of 64 and six million nodes.
When this helps
- An integration developer receives a sample export from a hospital and uses Resources to confirm it holds 3 Observations, 2 Conditions and one Encounter before writing the importer.
- A data analyst downloads the observations CSV and filters the flag column to the two values outside their ranges, then sends the table to a clinician with the stated ranges beside each value.
- A vendor's support team asks for a reproducible failing bundle. The developer de-identifies a 40-entry transaction bundle, checks that the request URLs now read Patient/patient-1 instead of a conditional MRN search, and attaches the copy to the ticket.
- A QA engineer wants to know why a downstream system rejects a message: the Checks tab lists an Observation whose subject points at Patient/p-77, which is not an entry, with the path of the field that holds it.
Opening a file
- Open the built-in bundle with Load example, or drop a .json or .xml file of up to 80 MB, or paste a document.
- Use the Resources tab to filter by type, then open Patient summary and pick a patient.
- Read the Checks tab for missing required elements, bad codes and dangling references.
- On De-identify, choose what to remove, enter a day shift and download the copy.
- Export observations as CSV from the Export tab.
Example
A 10-entry collection bundle for one patient (the bundled sample) and a day shift of -137
Observation obs-hb: Hemoglobin 11.2 g/dL, reference range 12 to 16 g/dL, performer Practitioner/dr-missing
Patient birthDate 1971-09-04; de-identify with a shift of -137 daysObservations table, checks and the de-identified copy
Hemoglobin: 11.2 g/dL, below the stated range; HbA1c 7.9 %, above the stated range (5.6 upper limit)
Checks: 1 warning, Practitioner/dr-missing is not an entry in this bundle
De-identified: birthDate 1971-04-20, bundle timestamp 2025-09-26, 9 dates moved, 10 references rewrittenTips for best results
- Use year-only dates instead of shifting when the copy will be shared with people who must not be able to reverse a known offset.
- Open the downloaded copy in this page and compare its Checks count with the original's. The same dangling references should be there, now as Unknown/external placeholders, and no new ones.
- The observations CSV covers the whole bundle and has a Patient column, so in a multi-patient export filter on that column in a spreadsheet instead of exporting once per patient.
Limits
The checks are not a profile validation. A bundle can pass them and still break a US Core, IPS or national profile.
De-identification removes the elements it knows about: names, identifiers, addresses, telephone and e-mail, attachments, extensions, narrative, notes and any element named *String (valueString, contentString, authorString), description and comment. Coded values, free text inside CodeableConcept.text, components and unknown elements are copied unchanged, so review the output before sharing it. It is not Safe Harbor certified, and year-only dates do not group ages over 89.
Reference ranges are compared only when the value and range use the same unit string. A value in mmol/L against a range in mg/dL is left unflagged rather than converted.
Contained resources are checked for #id references but are not listed as separate entries in the resource table.
Common errors and how to fix them
- "There is no resourceType, so this is not a FHIR resource."
- A FHIR JSON object starts with "resourceType": "Bundle" or the name of another resource. A response wrapped in an extra object (for example {"data": {...}}) needs unwrapping first.
- "The document declares entities in a DOCTYPE. They are not expanded, so the file was not opened."
- FHIR XML does not use DTD entities. Remove the DOCTYPE section from the file.
- "Enter a whole number of days between -3650 and 3650, other than 0."
- A shift of zero would change nothing, and a shift beyond ten years is refused. Use a value such as -137.
Best practices
- Run the checks first and the de-identification second: dangling references become placeholders in the copy, and fixing them first keeps the copy readable.
- Keep the day shift out of the same repository as the de-identified file.
What changes in the de-identified copy
In the built-in example, the patient name becomes Anonymous Patient, the MRN identifier value becomes id-1 (the identifier system is kept), the phone number and street address disappear while state and country remain, the clinical note on the diabetes condition is removed, and the display label "Lena Marchetti" inside a reference is dropped. That sample is a collection bundle with no requests; in a transaction bundle each entry's request is cut down to a method and a rewritten URL.
The counts shown next to the copy list each of these categories, so you can tell whether a rule did nothing at all, which usually means the data uses an element the rule does not know.
Frequently asked questions
Why is no FHIR version shown?
A Bundle has no version element. The version is normally in the server's capability statement or in an HTTP header, neither of which is in the file.
Does it handle HL7 v2 messages too?
No. The HL7 message viewer on this site reads pipe-delimited v2 messages; this page reads FHIR JSON and XML only.
Can the original be recovered from the de-identified copy?
Not from the file alone: the pseudonym table is never written out, identifiers become id-1, id-2 and so on in order of appearance, and names and addresses are gone. The day shift is the exception. Anyone who knows the offset and holds a true date can move every other date back, which is why the page offers year-only dates.
What happens to the URL of a conditional PUT or POST in a transaction?
The query string is dropped, because conditional URLs usually carry an identifier such as an MRN. A conditional update that read Patient?identifier=...|MRN-778812 becomes Patient, which a server will refuse for PUT. Change the method or add the id before replaying the bundle.