FHIR R5 OperationOutcome resource.
A collection of error, warning, or information messages that result from a FHIR system action (e.g., a server validation error, or the outcome of a batch/transaction request).
https://www.hl7.org/fhir/R5/operationoutcome.html
Issue severity
fatal | error | warning | information | success
Issue codes (common subset)
invalid | structure | required | value | invariant | |
security | login | unknown | expired | forbidden | |
processing | not-supported | duplicate | not-found | conflict | |
too-long | code-invalid | business-rule | transient | timeout |
throttled | informational | success
Example
alias FhirEx.Resources.OperationOutcome
outcome = %OperationOutcome{
id: "oo-001",
issue: [
%{
severity: "error",
code: "required",
details: %FhirEx.Types.CodeableConcept{text: "Patient.name is required"},
expression: ["Patient.name"]
}
]
}
# Build a quick error outcome
outcome = OperationOutcome.error("not-found", "Patient/999 was not found")
outcome = OperationOutcome.ok("Patient created successfully")
Summary
Functions
Builds a single-issue error OperationOutcome.
Builds the struct from a string-keyed map (e.g., from decoded FHIR JSON).
Builds a new struct from a map or keyword list of field values.
Builds a single-issue informational / success OperationOutcome.
Returns the FHIR resource type name string.
Converts the struct to a string-keyed map for use with FhirEx.JSON.
Builds a single-issue warning OperationOutcome.
Types
@type t() :: %FhirEx.Resources.OperationOutcome{ extension: [FhirEx.Types.Extension.t()] | nil, id: String.t() | nil, issue: [issue()], meta: FhirEx.Types.Meta.t() | nil, text: FhirEx.Types.Narrative.t() | nil }
Functions
Builds a single-issue error OperationOutcome.
Builds the struct from a string-keyed map (e.g., from decoded FHIR JSON).
Builds a new struct from a map or keyword list of field values.
Builds a single-issue informational / success OperationOutcome.
@spec resource_type() :: String.t()
Returns the FHIR resource type name string.
Converts the struct to a string-keyed map for use with FhirEx.JSON.
Builds a single-issue warning OperationOutcome.