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

Order Sequence Definition (OSD) -- HL7v2 composite data type.

Defines the sequence of orders for results reporting.

11 components:
1. Sequence/Results Flag (ID) -- S (sequential), R (results-dependent)
2. Placer Order Number: Entity Identifier (ST)
3. Placer Order Number: Namespace ID (IS)
4. Filler Order Number: Entity Identifier (ST)
5. Filler Order Number: Namespace ID (IS)
6. Sequence Condition Value (ST)
7. Maximum Number of Repeats (NM)
8. Placer Order Number: Universal ID (ST)
9. Placer Order Number: Universal ID Type (ID)
10. Filler Order Number: Universal ID (ST)
11. Filler Order Number: Universal ID Type (ID)

# `t`

```elixir
@type t() :: %HL7v2.Type.OSD{
  filler_order_number_entity_identifier: binary() | nil,
  filler_order_number_namespace_id: binary() | nil,
  filler_order_number_universal_id: binary() | nil,
  filler_order_number_universal_id_type: binary() | nil,
  maximum_number_of_repeats: binary() | nil,
  placer_order_number_entity_identifier: binary() | nil,
  placer_order_number_namespace_id: binary() | nil,
  placer_order_number_universal_id: binary() | nil,
  placer_order_number_universal_id_type: binary() | nil,
  sequence_condition_value: binary() | nil,
  sequence_results_flag: binary() | nil
}
```

# `encode`

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

Encodes an OSD to a list of component strings.

## Examples

    iex> HL7v2.Type.OSD.encode(%HL7v2.Type.OSD{sequence_results_flag: "S", placer_order_number_entity_identifier: "ORD001"})
    ["S", "ORD001"]

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

# `parse`

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

Parses an OSD from a list of components.

## Examples

    iex> HL7v2.Type.OSD.parse(["S", "ORD001", "HOSP", "FILL001", "LAB"])
    %HL7v2.Type.OSD{sequence_results_flag: "S", placer_order_number_entity_identifier: "ORD001", placer_order_number_namespace_id: "HOSP", filler_order_number_entity_identifier: "FILL001", filler_order_number_namespace_id: "LAB"}

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

---

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