Coded with Exceptions (CWE) -- HL7v2 composite data type.
Replaces CE in v2.5+. Used when multiple coding systems may apply, the table can be extended locally, or free text may substitute for a code.
9 components:
- Identifier (ST)
- Text (ST)
- Name of Coding System (ID) -- Table 0396
- Alternate Identifier (ST)
- Alternate Text (ST)
- Name of Alternate Coding System (ID) -- Table 0396
- Coding System Version ID (ST)
- Alternate Coding System Version ID (ST)
- Original Text (ST)
If only free text is available, populate component 9 and leave 1-3 empty.
Summary
Types
@type t() :: %HL7v2.Type.CWE{ alternate_coding_system_version_id: binary() | nil, alternate_identifier: binary() | nil, alternate_text: binary() | nil, coding_system_version_id: binary() | nil, identifier: binary() | nil, name_of_alternate_coding_system: binary() | nil, name_of_coding_system: binary() | nil, original_text: binary() | nil, text: binary() | nil }
Functions
Encodes a CWE to a list of component strings.
Examples
iex> HL7v2.Type.CWE.encode(%HL7v2.Type.CWE{identifier: "I48.0", text: "Paroxysmal atrial fibrillation", name_of_coding_system: "I10"})
["I48.0", "Paroxysmal atrial fibrillation", "I10"]
iex> HL7v2.Type.CWE.encode(nil)
[]
Parses a CWE from a list of components.
Examples
iex> HL7v2.Type.CWE.parse(["I48.0", "Paroxysmal atrial fibrillation", "I10"])
%HL7v2.Type.CWE{identifier: "I48.0", text: "Paroxysmal atrial fibrillation", name_of_coding_system: "I10"}
iex> HL7v2.Type.CWE.parse([])
%HL7v2.Type.CWE{}