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

Row Column Definition (RCD) -- HL7v2 composite data type.

Defines columns in a tabular response. Used in RDF segment.

3 components:
1. Segment Field Name (ST) -- e.g., "PID.3"
2. HL7 Data Type (ID) -- Table 0440: e.g., "ST", "NM", "CX"
3. Maximum Column Width (NM)

# `t`

```elixir
@type t() :: %HL7v2.Type.RCD{
  hl7_data_type: binary() | nil,
  maximum_column_width: binary() | nil,
  segment_field_name: binary() | nil
}
```

# `encode`

```elixir
@spec encode(t() | nil) :: list()
```

Encodes an RCD to a list of component strings.

## Examples

    iex> HL7v2.Type.RCD.encode(%HL7v2.Type.RCD{segment_field_name: "PID.3", hl7_data_type: "CX", maximum_column_width: "20"})
    ["PID.3", "CX", "20"]

    iex> HL7v2.Type.RCD.encode(nil)
    []

# `parse`

```elixir
@spec parse(list()) :: t()
```

Parses an RCD from a list of components.

## Examples

    iex> HL7v2.Type.RCD.parse(["PID.3", "CX", "20"])
    %HL7v2.Type.RCD{segment_field_name: "PID.3", hl7_data_type: "CX", maximum_column_width: "20"}

    iex> HL7v2.Type.RCD.parse(["OBX.5", "ST"])
    %HL7v2.Type.RCD{segment_field_name: "OBX.5", hl7_data_type: "ST"}

    iex> HL7v2.Type.RCD.parse([])
    %HL7v2.Type.RCD{}

---

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