View raw Markdown
type: resourceresource: OperationOutcome

OperationOutcome

Introduction

Scope and Usage

Operation outcomes are sets of error, warning and information messages that provide detailed information about the outcome of an attempted system operation. They are provided as a direct system response, or component of one, and provide information about the outcome of the operation.

The OperationOutcome resource is used in the following circumstances:

Boundaries and Relationships

This resource is not used for reporting clinical or workflow issues associated with a proposed or ongoing action; these would be handled using DetectedIssue or other resources. OperationOutcome is not designed to be persisted or referenced from other parts of the workflow.

It is possible to have both OperationOutcome and DetectedIssue together, where the OperationOutcome might indicate that a requested action was rejected due to a clinical issue and the DetectedIssue provides the details of the issue.

Notes

Using Operation Outcome Resources

On the RESTful interface, operation outcome resources are only relevant when a level of computable detail is required that is more granular than that provided by the HTTP response codes. This granularity could include:

Operation outcomes returned SHOULD be in alignment with the HTTP response code. For example, if the HTTP code indicates a failure (300+), at least one of the issues should have a severity of "error", indicating the reason for the failure.

Operation outcomes must include at least one issue. See the All OK example for a template for an operation that returns no errors.

Using the Expression

Each issue in an operation outcome SHOULD have an expression that reports a location for the issue. A correctly populated expression can allow client systems to:

In order to support these kinds of usages, applications need to use the expression element consistently. Applications can use the expression element to refer to a location inside a resource, or some location in the HTTP request (when appropriate).

Error locations are always reported using a simplified FHIRPath statement in the expression element. In addition to the simplified FHIRPath restrictions, the expression SHALL NOT contain a .resolve() function. These examples are legal:

<expression value="Patient.identifier"/>

"expression" : "Patient.identifier[2].value"

but this is not:

"expression" : "Patient.identifier.where(system.value='http://example.com/mrn').value"

Reporting Errors in the HTTP Headers

Servers may also need to report errors in the HTTP headers - especially query parameters when processing searches. Errors are reported using a case sensitive expression that has two parts, a fixed "http" and the header or query parameter name separated by a ".". Some examples:

ExpressonDescription
http.codeA reference to the search parameter "code"
http."name:exact"A reference to the search parameter "name" with the modifier ":exact"
http.AuthorizationA reference to the Authorization header - perhaps to indicate that it is missing, and some form of authentication is required.

This specification follows the convention that HTTP headers start with an uppercase character, and URL parameters start with a lowercase character. Implementations are encouraged to follow this convention, so that no name collisions occur.

StructureDefinition

Elements (Simplified)

Mappings

Implementation Guide

implementationguide-OperationOutcome-core.xml

<?xml version="1.0" encoding="UTF-8"?>

<ImplementationGuide xmlns="http://hl7.org/fhir">
  <id value="OperationOutcome-core"/>
  <name value="StandardOperationOutcomeExtensions"/>
  <title value="Standard  Operation Outcome  Extensions"/>
  <status value="draft"/>
  <date value="2014-01-31T00:00:00.000"/>
  <publisher value="Health Level Seven, Inc. - [WG Name] WG"/>
  <description value="This profile describes common extensions that are used with OperationOutcomes"/>
</ImplementationGuide>

Resource Packs

list-OperationOutcome-packs.xml

<?xml version="1.0" encoding="UTF-8"?>

<List xmlns="http://hl7.org/fhir">
  <id value="OperationOutcome-packs"/>
  <status value="current"/>
  <mode value="working"/>
  <entry>
    <item>
      <reference value="ImplementationGuide/OperationOutcome-core"/>
    </item>
  </entry>
</List>

Examples

Full Examples