FhirEx.Validation.Error (fhir_ex v0.3.0)

Copy Markdown View Source

Represents a single FHIR validation error.

The path is a list of strings tracing the location of the error within the resource, following JSON pointer conventions.

Examples

%Error{path: ["status"], message: "is required"}
%Error{path: ["name", "0", "use"], message: "must be one of: usual, official, temp, nickname, anonymous, old, maiden"}
%Error{path: ["identifier", "0", "system"], message: "must be a valid URI"}

Summary

Functions

Formats the error as a human-readable string.

Formats a list of errors into a single newline-separated string.

Creates a new validation error with a path and message.

Types

t()

@type t() :: %FhirEx.Validation.Error{message: String.t(), path: [String.t()]}

Functions

format(error)

@spec format(t()) :: String.t()

Formats the error as a human-readable string.

format_all(errors)

@spec format_all([t()]) :: String.t()

Formats a list of errors into a single newline-separated string.

new(path, message)

@spec new([String.t()], String.t()) :: t()

Creates a new validation error with a path and message.