FhirEx.Types.Period (fhir_ex v0.3.0)

Copy Markdown View Source

FHIR R5 Period data type.

A time period defined by a start and end datetime.

https://www.hl7.org/fhir/R5/datatypes.html#Period

Example

%Period{
  start: "2024-01-15T09:00:00Z",
  end: "2024-01-15T10:30:00Z"
}

Summary

Functions

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.

Converts the struct to a string-keyed map for use with FhirEx.JSON.

Types

t()

@type t() :: %FhirEx.Types.Period{end: String.t() | nil, start: String.t() | nil}

Functions

from_map(map)

@spec from_map(map()) :: t()

Builds the struct from a string-keyed map (e.g., from decoded FHIR JSON).

new(attrs \\ %{})

@spec new(map() | keyword()) :: t()

Builds a new struct from a map or keyword list of field values.

to_map(p)

@spec to_map(t()) :: map()

Converts the struct to a string-keyed map for use with FhirEx.JSON.