← ReferenceResource
What is an OperationOutcome?
An OperationOutcome is the standard FHIR way to communicate the result of an operation — especially errors, warnings, and hints. A server returns an OperationOutcome when a request fails, when validation finds issues, or when a $operation produces no resource result.
OperationOutcome — validation error
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "error",
"code": "required",
"diagnostics": "Patient.identifier: minimum 1 required",
"expression": ["Patient.identifier"]
},
{
"severity": "warning",
"code": "best-practice",
"diagnostics": "dom-6: A resource should have narrative",
"expression": ["Patient"]
}
]
}Severity levels
| Severity | HTTP status | Meaning |
|---|---|---|
| fatal | 4xx/5xx | Processing stopped completely |
| error | 4xx | Request failed, resource rejected |
| warning | 200/201 | Request succeeded but there are concerns |
| information | 200/201 | Advisory — no action required |
Common issue codes
required— required element missingvalue— element value is invalidnot-found— referenced resource does not existtoo-many— cardinality exceededbest-practice— best-practice recommendation not followed (always a warning)code-invalid— code not found in required value set