This page is part of the FHIR Specification (v3.5.0: R4 Ballot #2). The current version which supercedes this version is 5.0.0. For a full list of available versions, see the Directory of published versions . Page versions: R5 R4B R4 R3 R2
FHIR Infrastructure Work Group | Maturity Level: 5 | Normative | Compartments: Not linked to any defined compartments |
Normative Candidate Note: This page is candidate normative content for R4 in the Infrastructure Package. Once normative, it will lose it's Maturity Level, and breaking changes will no longer be made.
A collection of error, warning or information messages that result from a system action.
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:
This resource is referenced by GuidanceResponse and MessageHeader. The reference from GuidanceResponse indicates that there is an additional use context that needs to be addressed in the scope.
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. The resource 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.
This resource is referenced by GuidanceResponse and MessageHeader
Structure
Name | Flags | Card. | Type | Description & Constraints |
---|---|---|---|---|
OperationOutcome | ΣN | DomainResource | Information about the success/failure of an action Elements defined in Ancestors: id, meta, implicitRules, language, text, contained, extension, modifierExtension | |
issue | Σ | 1..* | BackboneElement | A single issue associated with the action |
severity | Σ | 1..1 | code | fatal | error | warning | information IssueSeverity (Required) |
code | Σ | 1..1 | code | Error or warning code IssueType (Required) |
details | Σ | 0..1 | CodeableConcept | Additional details about the error Operation Outcome Codes (Example) |
diagnostics | Σ | 0..1 | string | Additional diagnostic information about the issue |
location | ΣXD | 0..* | string | Deprecated: Path of element(s) related to issue |
expression | Σ | 0..* | string | FHIRPath of element(s) related to issue |
Documentation for this format |
UML Diagram (Legend)
XML Template
<OperationOutcome xmlns="http://hl7.org/fhir"> <!-- from Resource: id, meta, implicitRules, and language --> <!-- from DomainResource: text, contained, extension, and modifierExtension --> <issue> <!-- 1..* A single issue associated with the action --> <severity value="[code]"/><!-- 1..1 fatal | error | warning | information --> <code value="[code]"/><!-- 1..1 Error or warning code --> <details><!-- 0..1 CodeableConcept Additional details about the error --></details> <diagnostics value="[string]"/><!-- 0..1 Additional diagnostic information about the issue --> <location value="[string]"/><!-- 0..* Deprecated: Path of element(s) related to issue --> <expression value="[string]"/><!-- 0..* FHIRPath of element(s) related to issue --> </issue> </OperationOutcome>
JSON Template
{ "resourceType" : "OperationOutcome", // from Resource: id, meta, implicitRules, and language // from DomainResource: text, contained, extension, and modifierExtension "issue" : [{ // R! A single issue associated with the action "severity" : "<code>", // R! fatal | error | warning | information "code" : "<code>", // R! Error or warning code "details" : { CodeableConcept }, // Additional details about the error "diagnostics" : "<string>", // Additional diagnostic information about the issue "location" : ["<string>"], // Deprecated: Path of element(s) related to issue "expression" : ["<string>"] // FHIRPath of element(s) related to issue }] }
Turtle Template
@prefix fhir: <http://hl7.org/fhir/> . [ a fhir:OperationOutcome; fhir:nodeRole fhir:treeRoot; # if this is the parser root # from Resource: .id, .meta, .implicitRules, and .language # from DomainResource: .text, .contained, .extension, and .modifierExtension fhir:OperationOutcome.issue [ # 1..* A single issue associated with the action fhir:OperationOutcome.issue.severity [ code ]; # 1..1 fatal | error | warning | information fhir:OperationOutcome.issue.code [ code ]; # 1..1 Error or warning code fhir:OperationOutcome.issue.details [ CodeableConcept ]; # 0..1 Additional details about the error fhir:OperationOutcome.issue.diagnostics [ string ]; # 0..1 Additional diagnostic information about the issue fhir:OperationOutcome.issue.location [ string ], ... ; # 0..* Deprecated: Path of element(s) related to issue fhir:OperationOutcome.issue.expression [ string ], ... ; # 0..* FHIRPath of element(s) related to issue ], ...; ]
Changes since R3
OperationOutcome | |
OperationOutcome.issue.severity |
|
See the Full Difference for further information
This analysis is available as XML or JSON.
See R3 <--> R4 Conversion Maps (status = 6 tests that all execute ok. 6 fail round-trip testing and 6 r3 resources are invalid (0 errors).)
Structure
Name | Flags | Card. | Type | Description & Constraints |
---|---|---|---|---|
OperationOutcome | ΣN | DomainResource | Information about the success/failure of an action Elements defined in Ancestors: id, meta, implicitRules, language, text, contained, extension, modifierExtension | |
issue | Σ | 1..* | BackboneElement | A single issue associated with the action |
severity | Σ | 1..1 | code | fatal | error | warning | information IssueSeverity (Required) |
code | Σ | 1..1 | code | Error or warning code IssueType (Required) |
details | Σ | 0..1 | CodeableConcept | Additional details about the error Operation Outcome Codes (Example) |
diagnostics | Σ | 0..1 | string | Additional diagnostic information about the issue |
location | ΣXD | 0..* | string | Deprecated: Path of element(s) related to issue |
expression | Σ | 0..* | string | FHIRPath of element(s) related to issue |
Documentation for this format |
XML Template
<OperationOutcome xmlns="http://hl7.org/fhir"> <!-- from Resource: id, meta, implicitRules, and language --> <!-- from DomainResource: text, contained, extension, and modifierExtension --> <issue> <!-- 1..* A single issue associated with the action --> <severity value="[code]"/><!-- 1..1 fatal | error | warning | information --> <code value="[code]"/><!-- 1..1 Error or warning code --> <details><!-- 0..1 CodeableConcept Additional details about the error --></details> <diagnostics value="[string]"/><!-- 0..1 Additional diagnostic information about the issue --> <location value="[string]"/><!-- 0..* Deprecated: Path of element(s) related to issue --> <expression value="[string]"/><!-- 0..* FHIRPath of element(s) related to issue --> </issue> </OperationOutcome>
JSON Template
{ "resourceType" : "OperationOutcome", // from Resource: id, meta, implicitRules, and language // from DomainResource: text, contained, extension, and modifierExtension "issue" : [{ // R! A single issue associated with the action "severity" : "<code>", // R! fatal | error | warning | information "code" : "<code>", // R! Error or warning code "details" : { CodeableConcept }, // Additional details about the error "diagnostics" : "<string>", // Additional diagnostic information about the issue "location" : ["<string>"], // Deprecated: Path of element(s) related to issue "expression" : ["<string>"] // FHIRPath of element(s) related to issue }] }
Turtle Template
@prefix fhir: <http://hl7.org/fhir/> . [ a fhir:OperationOutcome; fhir:nodeRole fhir:treeRoot; # if this is the parser root # from Resource: .id, .meta, .implicitRules, and .language # from DomainResource: .text, .contained, .extension, and .modifierExtension fhir:OperationOutcome.issue [ # 1..* A single issue associated with the action fhir:OperationOutcome.issue.severity [ code ]; # 1..1 fatal | error | warning | information fhir:OperationOutcome.issue.code [ code ]; # 1..1 Error or warning code fhir:OperationOutcome.issue.details [ CodeableConcept ]; # 0..1 Additional details about the error fhir:OperationOutcome.issue.diagnostics [ string ]; # 0..1 Additional diagnostic information about the issue fhir:OperationOutcome.issue.location [ string ], ... ; # 0..* Deprecated: Path of element(s) related to issue fhir:OperationOutcome.issue.expression [ string ], ... ; # 0..* FHIRPath of element(s) related to issue ], ...; ]
Changes since Release 3
OperationOutcome | |
OperationOutcome.issue.severity |
|
See the Full Difference for further information
This analysis is available as XML or JSON.
See R3 <--> R4 Conversion Maps (status = 6 tests that all execute ok. 6 fail round-trip testing and 6 r3 resources are invalid (0 errors).)
See the Profiles & Extensions and the alternate definitions: Master Definition XML + JSON, XML Schema/Schematron + JSON Schema, ShEx (for Turtle) + see the extensions & the dependency analysis
Path | Definition | Type | Reference |
---|---|---|---|
OperationOutcome.issue.severity | How the issue affects the success of the action. | Required | IssueSeverity |
OperationOutcome.issue.code | A code that describes the type of issue. | Required | IssueType |
OperationOutcome.issue.details | A code that provides details as the exact issue. | Example | OperationOutcomeCodes |
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.
Each issue in an operation outcome SHOUD have a 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 location element consistently. Applications can use the location 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 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"
Servers may also need to report errors in the HTTP headers - especially query parameters when processing searches. Errors are reported using a case sensitive location that has two parts, a fixed "http" and the header or query parameter name separated by a ".". Some examples:
Location | Description |
http."name:exact" | A reference to the search parameter "name" with the modifier ":exact" |
http.Authorization | A reference to the Authorization header - perhaps to indicate that it is missing, and some form of authentication is required. |