HL7v2.Type.QIP (HL7v2 v3.10.1)

Copy Markdown View Source

Query Input Parameter List (QIP) -- HL7v2 composite data type.

Used in QPD segment for passing query parameters.

2 components:

  1. Segment Field Name (ST) -- e.g., "@PID.3.1"
  2. Values (ST)

Summary

Functions

Encodes a QIP to a list of component strings.

Parses a QIP from a list of components.

Types

t()

@type t() :: %HL7v2.Type.QIP{
  segment_field_name: binary() | nil,
  values: binary() | nil
}

Functions

encode(qip)

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

Encodes a QIP to a list of component strings.

Examples

iex> HL7v2.Type.QIP.encode(%HL7v2.Type.QIP{segment_field_name: "@PID.3.1", values: "12345"})
["@PID.3.1", "12345"]

iex> HL7v2.Type.QIP.encode(%HL7v2.Type.QIP{segment_field_name: "@PID.5.1"})
["@PID.5.1"]

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

parse(components)

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

Parses a QIP from a list of components.

Examples

iex> HL7v2.Type.QIP.parse(["@PID.3.1", "12345"])
%HL7v2.Type.QIP{segment_field_name: "@PID.3.1", values: "12345"}

iex> HL7v2.Type.QIP.parse(["@PID.5.1"])
%HL7v2.Type.QIP{segment_field_name: "@PID.5.1"}

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