resourceType Is Required
Every FHIR resource must carry a top-level resourceType string. The validator could not find one, so it cannot decide which resource definition to apply.
FHIR · Error
The error
resourceType is requiredWhy it happens
Serializing only the data fields and dropping resourceType, wrapping the resource in another object, or passing a Bundle entry payload that lost its resourceType during extraction.
How to fix it
Add "resourceType" as a top-level string equal to a valid FHIR R4 type, for example "Patient" or "Observation". It must be a sibling of id and the other fields, not nested.
Example
The snippet below triggers the error:
{
"id": "example",
"name": [{ "family": "Doe" }]
}The corrected version:
{
"resourceType": "Patient",
"id": "example",
"name": [{ "family": "Doe" }]
}Frequently asked questions
Does resourceType go inside meta?
No. resourceType is a top-level property of the resource JSON, alongside id and meta. It is not inside meta and it is case-sensitive (Patient, not patient).
Related
- Open the FHIR Validator
- All validation errors
- 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
- Reference Should Be Type/id, urn:uuid, or an Absolute URL