HL7v2.Standard (HL7v2 v3.10.1)

Copy Markdown View Source

HL7 v2.5.1 standard metadata — single source of truth.

Compile-time catalogs for segments, data types, message structures, and trigger-to-structure mappings from the HL7 v2.5.1 specification.

Each entry includes a capability tier indicating the library's current level of support:

  • :typed — full parse/encode with Elixir struct
  • :raw — preserved as raw fields during typed parsing, no typed access
  • :unsupported — not in the library, unknown segments become raw tuples

Usage

HL7v2.Standard.segment("PID")
#=> %{name: "Patient Identification", tier: :typed, module: HL7v2.Segment.PID}

HL7v2.Standard.type("CX")
#=> %{name: "Extended Composite ID with Check Digit", category: :composite, tier: :typed}

HL7v2.Standard.segment_tier("PID")
#=> :typed

Summary

Functions

Returns segment metadata by ID, or nil.

Returns the total count of standard segments in the catalog.

Returns all segment IDs in the catalog.

Returns the segment module for a typed segment, or nil.

Returns the capability tier for a segment (:typed, :raw, or :unsupported).

Returns type metadata by code, or nil.

Returns all type codes in the catalog.

Returns the total count of standard data types in the catalog.

Returns the capability tier for a data type.

Returns all typed segment IDs.

Returns all typed type codes.

Functions

segment(id)

@spec segment(binary()) :: map() | nil

Returns segment metadata by ID, or nil.

segment_count()

@spec segment_count() :: non_neg_integer()

Returns the total count of standard segments in the catalog.

segment_ids()

@spec segment_ids() :: [binary()]

Returns all segment IDs in the catalog.

segment_module(id)

@spec segment_module(binary()) :: module() | nil

Returns the segment module for a typed segment, or nil.

segment_tier(id)

@spec segment_tier(binary()) :: :typed | :raw | :unsupported

Returns the capability tier for a segment (:typed, :raw, or :unsupported).

type(code)

@spec type(binary()) :: map() | nil

Returns type metadata by code, or nil.

type_codes()

@spec type_codes() :: [binary()]

Returns all type codes in the catalog.

type_count()

@spec type_count() :: non_neg_integer()

Returns the total count of standard data types in the catalog.

type_tier(code)

@spec type_tier(binary()) :: :typed | :unsupported

Returns the capability tier for a data type.

typed_segment_ids()

@spec typed_segment_ids() :: [binary()]

Returns all typed segment IDs.

typed_type_codes()

@spec typed_type_codes() :: [binary()]

Returns all typed type codes.