HL7v2.Type.PT (HL7v2 v3.10.1)

Copy Markdown View Source

Processing Type (PT) -- HL7v2 composite data type.

Used in MSH-11 to indicate processing mode.

2 components:

  1. Processing ID (ID) -- Table 0103: D (Debugging), P (Production), T (Training)
  2. Processing Mode (ID) -- Table 0207: A (Archive), R (Restore), I (Initial), T (Current)

Summary

Functions

Encodes a PT to a list of component strings.

Parses a PT from a list of components.

Types

t()

@type t() :: %HL7v2.Type.PT{
  processing_id: binary() | nil,
  processing_mode: binary() | nil
}

Functions

encode(pt)

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

Encodes a PT to a list of component strings.

Examples

iex> HL7v2.Type.PT.encode(%HL7v2.Type.PT{processing_id: "P"})
["P"]

iex> HL7v2.Type.PT.encode(%HL7v2.Type.PT{processing_id: "P", processing_mode: "T"})
["P", "T"]

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

parse(components)

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

Parses a PT from a list of components.

Examples

iex> HL7v2.Type.PT.parse(["P"])
%HL7v2.Type.PT{processing_id: "P"}

iex> HL7v2.Type.PT.parse(["P", "T"])
%HL7v2.Type.PT{processing_id: "P", processing_mode: "T"}

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