﻿# Generated FHIR URN references must resolve to Bundle fullUrl identities

A practical investigation of generated FHIR URN references must resolve to Bundle fullUrl identities, with explicit observations, control cases and evidence limits.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/field-synthetic-fhir-bundle-generated-urn-reference-identity/
Language: en

## The generated-data scenario

A synthetic healthcare-like dataset creates patient and encounter resources inside a Bundle. A later exporter replaces entry fullUrl values but leaves URN references unchanged. Every resource still looks plausible in isolation, yet encounters no longer resolve to the intended patient. The acceptance question is the bundle-level identity mapping. It concerns interchange correctness, without claiming that plausible generated records are medically valid or suitable for clinical use.

## The generation mechanism

The published FHIR Bundle specification resolves a URN reference by finding an entry whose fullUrl matches it. If none matches, that resolution fails. Its reference specification distinguishes absolute URLs, context-dependent relative references and internal fragments for contained resources. An object’s id and a Bundle entry’s fullUrl have different roles. Replacing one familiar-looking identifier is not a general rule for rewriting every reference representation.

## Define the dataset contract

Define the generated Bundle type, resource identities and allowed reference forms under the chosen FHIR release. Create one explicit mapping when assigning or rewriting fullUrl values, and apply it to the relevant references. Keep contained-resource fragments separate from bundle-level URNs. A patient display label must not serve as an identity fallback, since two intentionally distinct synthetic patients can legitimately share a name or other plausible attribute.

## A step-by-step protocol

First inspect the generated entries and enumerate references that are intended to resolve within the Bundle. Use invented resources with a correct URN match, a dangling URN and similar id strings belonging to different entries. Run the actual export and receiving loader, then verify the resolved target identity rather than only resource counts. Include a negative rewrite that changes fullUrl alone; the check must detect the lost relationship.

## Evidence required for acceptance

Acceptance evidence includes the FHIR release, Bundle identity mapping, exact reference forms and resolved-target assertions after reload. Preserve unresolved references as failures or explicitly external references according to the contract. Do not silently attach a resource by a matching display name to make the fixture pass. The release should retain enough nonclinical provenance to explain which generated encounter belongs to which invented patient without using real patient identifiers.

## Failure cases and limits

Correct references do not establish temporal, medical or population realism. FHIR profiles and Bundle types can impose additional constraints that require separate validation. This article creates no clinical dataset and offers no health guidance. Its bounded result is a verifiable generated-resource graph for the selected interchange path, keeping identity repair distinct from plausible text generation and preventing a syntactically valid export from silently changing who a record is about.

## Primary references and related reading

Preserve fullUrl-to-reference mapping; a plausible resource id alone does not repair a broken generated Bundle link. [FHIR R5 Bundle identity and URN reference resolution](https://hl7.org/fhir/R5/bundle.html); [FHIR R5 literal, relative and contained resource references](https://hl7.org/fhir/R5/references.html).

The proposed investigation of fhir bundle generated urn reference identity is a proposed dataset-contract review; no production dataset was generated or evaluated. Related reading: [Frictionless Table Schema: validate logical values before feature building](/journal/data-guide-frictionless-table-schema/); [Documents to Markdown or JSON: preserve evidence provenance for RAG](/journal/document-markdown-json-provenance/).
