HL7v2.Type.XON (HL7v2 v3.10.1)

Copy Markdown View Source

Extended Composite Name and ID for Organizations (XON) -- HL7v2 composite data type.

10 components:

  1. Organization Name (ST)
  2. Organization Name Type Code (IS) -- Table 0204: A=Alias, D=Display, L=Legal
  3. ID Number (NM) -- deprecated
  4. Check Digit (NM)
  5. Check Digit Scheme (ID) -- Table 0061
  6. Assigning Authority (HD) -- sub-components delimited by &
  7. Identifier Type Code (ID) -- Table 0203
  8. Assigning Facility (HD) -- sub-components delimited by &
  9. Name Representation Code (ID) -- Table 0465
  10. Organization Identifier (ST)

Summary

Functions

Encodes an XON to a list of component strings.

Parses an XON from a list of components.

Types

t()

@type t() :: %HL7v2.Type.XON{
  assigning_authority: HL7v2.Type.HD.t() | nil,
  assigning_facility: HL7v2.Type.HD.t() | nil,
  check_digit: binary() | nil,
  check_digit_scheme: binary() | nil,
  id_number: binary() | nil,
  identifier_type_code: binary() | nil,
  name_representation_code: binary() | nil,
  organization_identifier: binary() | nil,
  organization_name: binary() | nil,
  organization_name_type_code: binary() | nil
}

Functions

encode(xon)

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

Encodes an XON to a list of component strings.

Examples

iex> HL7v2.Type.XON.encode(%HL7v2.Type.XON{organization_name: "General Hospital", organization_name_type_code: "L"})
["General Hospital", "L"]

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

parse(components)

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

Parses an XON from a list of components.

Examples

iex> HL7v2.Type.XON.parse(["General Hospital", "L", "", "", "", "HOSP&2.16.840.1.113883.19.4.6&ISO", "XX", "", "", "GH001"])
%HL7v2.Type.XON{
  organization_name: "General Hospital",
  organization_name_type_code: "L",
  assigning_authority: %HL7v2.Type.HD{namespace_id: "HOSP", universal_id: "2.16.840.1.113883.19.4.6", universal_id_type: "ISO"},
  identifier_type_code: "XX",
  organization_identifier: "GH001"
}

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