Composite Number and Name without Authority (CNN) -- HL7v2 composite data type.
A simplified person identifier used as the name component of NDL (Name with Date and Location). Unlike XCN, CNN does not carry assigning authority or identifier type information.
11 components per HL7 v2.5.1:
- ID Number (ST)
- Family Name (ST) -- simple string, not FN composite
- Given Name (ST)
- Second and Further Given Names or Initials (ST)
- Suffix (ST)
- Prefix (ST)
- Degree (IS)
- Source Table (IS)
- Assigning Authority - Namespace ID (IS)
- Assigning Authority - Universal ID (ST)
- Assigning Authority - Universal ID Type (ID)
Note: components 9-11 are flattened parts of an HD, not a nested HD composite.
Summary
Functions
Encodes a CNN to a list of component strings.
Parses a CNN from a list of components (or sub-components).
Types
@type t() :: %HL7v2.Type.CNN{ assigning_authority_namespace_id: binary() | nil, assigning_authority_universal_id: binary() | nil, assigning_authority_universal_id_type: binary() | nil, degree: binary() | nil, family_name: binary() | nil, given_name: binary() | nil, id_number: binary() | nil, prefix: binary() | nil, second_name: binary() | nil, source_table: binary() | nil, suffix: binary() | nil }
Functions
Encodes a CNN to a list of component strings.
Examples
iex> HL7v2.Type.CNN.encode(%HL7v2.Type.CNN{id_number: "12345", family_name: "Smith", given_name: "John"})
["12345", "Smith", "John"]
iex> HL7v2.Type.CNN.encode(nil)
[]
iex> HL7v2.Type.CNN.encode(%HL7v2.Type.CNN{})
[]
Parses a CNN from a list of components (or sub-components).
Examples
iex> HL7v2.Type.CNN.parse(["12345", "Smith", "John"])
%HL7v2.Type.CNN{id_number: "12345", family_name: "Smith", given_name: "John"}
iex> HL7v2.Type.CNN.parse(["12345", "Smith", "John", "Q", "JR", "DR", "MD", "PHYS", "NPI", "2.16.840.1.113883.4.6", "ISO"])
%HL7v2.Type.CNN{
id_number: "12345",
family_name: "Smith",
given_name: "John",
second_name: "Q",
suffix: "JR",
prefix: "DR",
degree: "MD",
source_table: "PHYS",
assigning_authority_namespace_id: "NPI",
assigning_authority_universal_id: "2.16.840.1.113883.4.6",
assigning_authority_universal_id_type: "ISO"
}
iex> HL7v2.Type.CNN.parse([])
%HL7v2.Type.CNN{}