FHIR OperationOutcome Format

When a Health Gorilla API request fails, the response includes a FHIR OperationOutcome resource with structured details about the error. This allows clients to parse, log, and respond to errors programmatically across all FHIR-based endpoints.

All error responses are returned as application/fhir+json.

Structure of OperationOutcome

The OperationOutcome resource contains an array of issue objects. Each issue provides information about a specific problem detected during request processing.

Common Fields

FieldTypeDescription
severitycodefatal, error, warning, or information
codecodeA coded classification of the issue (e.g., invalid, required, forbidden)
diagnosticsstringHuman-readable explanation of the error
locationstring[]JSONPath or FHIR path to the field that caused the error (if applicable)
details.textstringOptional short description of the error

Example Error Response

HTTP/1.1 422 Unprocessable Entity
Content-Type: application/fhir+json
{
  "resourceType": "OperationOutcome",
  "issue": [
    {
      "severity": "error",
      "code": "required",
      "diagnostics": "The 'patient' field is required.",
      "location": ["AllergyIntolerance.patient"]
    }
  ]
} 

Severity Levels

SeverityUse Case
fatalThe request could not be processed at all
errorA problem that prevents the request from succeeding
warningAn issue that doesn't prevent success, but should be reviewed
informationInformational message that does not indicate a failure

Partial List of Issue Codes

CodeMeaning
invalidGeneral input validation error
requiredMissing required field
forbiddenAccess denied due to permissions
not-foundReferenced resource does not exist
duplicateDuplicate resource or identifier
conflictData conflict or business rule violation
structurePayload is structurally invalid
processingUnexpected internal processing error

For a full list of FHIR issue codes, see the HL7 FHIR OperationOutcome specification.