# `HL7v2.Standard`
[🔗](https://github.com/Balneario-de-Cofrentes/hl7v2/blob/v3.10.1/lib/hl7v2/standard.ex#L1)

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

# `segment`

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

Returns segment metadata by ID, or nil.

# `segment_count`

```elixir
@spec segment_count() :: non_neg_integer()
```

Returns the total count of standard segments in the catalog.

# `segment_ids`

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

Returns all segment IDs in the catalog.

# `segment_module`

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

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

# `segment_tier`

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

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

# `type`

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

Returns type metadata by code, or nil.

# `type_codes`

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

Returns all type codes in the catalog.

# `type_count`

```elixir
@spec type_count() :: non_neg_integer()
```

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

# `type_tier`

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

Returns the capability tier for a data type.

# `typed_segment_ids`

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

Returns all typed segment IDs.

# `typed_type_codes`

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

Returns all typed type codes.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
