Reference Should Be Type/id, urn:uuid, or an Absolute URL
A Reference.reference string should be a relative reference (Type/id), a urn:uuid for bundle-local resources, a fragment (#id) for contained resources, or an absolute URL. The value matched none of these.
FHIR · Warning
The error
Reference should be Type/id, urn:uuid:..., or absolute URLWhy it happens
Storing only a bare id (123) without the resource type, using a database primary key, or referencing a contained resource without the leading #.
How to fix it
Prefix the id with its resource type: Patient/123. For bundle entries use urn:uuid:.... For contained resources use #localId. Use a full URL only when pointing at an external server.
Example
The snippet below triggers the error:
{
"resourceType": "Observation",
"status": "final",
"subject": { "reference": "123" }
}The corrected version:
{
"resourceType": "Observation",
"status": "final",
"subject": { "reference": "Patient/123" }
}Frequently asked questions
When should I use urn:uuid references?
Inside a transaction or document Bundle where resources do not yet have server-assigned ids, entries reference each other by urn:uuid: matching their fullUrl. Once persisted, references become Type/id.
Related
- Open the FHIR Validator
- All validation errors
- resourceType Is Required
- Unknown FHIR R4 Resource Type
- Required Element Is Missing for This Resource
- gender Must Be male, female, other, or unknown
- birthDate Must Be YYYY, YYYY-MM, or YYYY-MM-DD
- instant Must Include a Timezone
- Resource id Has an Invalid Format
- subject Must Be a Reference Object, Not a String