Interface: CWE
HL7 v2 Coded with Exceptions (CWE): coded element per HL7 Chapter 2. All 9 components are optional. Fields are OMITTED when the underlying component is absent (exactOptionalPropertyTypes).
Component positions (HL7 1-indexed; this interface is 0-indexed by key):
- identifier (e.g. "GLU")
- text (human-readable, e.g. "Glucose")
- nameOfCodingSystem (e.g. "LN" for LOINC, "SCT" for SNOMED CT)
- alternateIdentifier
- alternateText
- nameOfAlternateCodingSystem
- codingSystemVersionId
- alternateCodingSystemVersionId
- originalText
Components 10+ (present only on v2.7+ senders) are surfaced verbatim, in
order, on extraComponents: never silently truncated.
Example
import type { CWE } from "@cosyte/hl7";
const code: CWE = { identifier: "GLU", text: "Glucose", nameOfCodingSystem: "LN" };
Properties
alternateCodingSystemVersionId?
readonlyoptionalalternateCodingSystemVersionId?:string
alternateIdentifier?
readonlyoptionalalternateIdentifier?:string
alternateText?
readonlyoptionalalternateText?:string
codingSystemVersionId?
readonlyoptionalcodingSystemVersionId?:string
extraComponents?
readonlyoptionalextraComponents?: readonlystring[]
Components beyond the modeled 9 (HL7 component 10 onward), preserved
verbatim and in order for forward-compatibility with v2.7+ senders that
carry the second-alternate triplet or coding-system / value-set OIDs.
OMITTED when the element has no components past the 9th. An absent interior
component is preserved as "" so extraComponents[i] maps to HL7
component 10 + i.
identifier?
readonlyoptionalidentifier?:string
nameOfAlternateCodingSystem?
readonlyoptionalnameOfAlternateCodingSystem?:string
nameOfCodingSystem?
readonlyoptionalnameOfCodingSystem?:string
originalText?
readonlyoptionaloriginalText?:string
text?
readonlyoptionaltext?:string