Skip to main content
Version: v0.0.4

Function: parseCe()

parseCe(rep, enc): CE

Parse an HL7 v2 CE repetition into a structured CE object. Components are returned verbatim (already decoded once by the tokenizer: never re-unescaped). Absent / empty components are OMITTED from the result (exactOptionalPropertyTypes semantics).

Parameters

rep

RawRepetition

enc

EncodingCharacters

Returns

CE

Example

import { parseCe, DEFAULT_ENCODING_CHARACTERS } from "@cosyte/hl7";
const rep = { components: [
{ subcomponents: ["GLU"] },
{ subcomponents: ["Glucose"] },
{ subcomponents: ["LN"] },
] };
const ce = parseCe(rep, DEFAULT_ENCODING_CHARACTERS);
console.log(ce.identifier); // "GLU"