Skip to main content
Version: v0.0.3

Function: parseIvlTs()

parseIvlTs(el, ctx): IVL_TS | undefined

Parse an IVL_TS element into a typed IVL_TS. Returns undefined when the element is absent. Handles both the <low>/<high> bound form and the degenerate @value point form. Never throws.

A @nullFlavor on the interval beside its own @value or a bound that carries one is a contradiction: CONTRADICTORY_NULL_FLAVOR is emitted once, every raw is preserved, and the derived date is withheld from the point value and from each bound. See parsePq for the rule and its limits.

Parameters

el

any

ctx

ParseCtx

Returns

IVL_TS | undefined

Example

import { parseIvlTs } from "@cosyte/ccda";
const period = parseIvlTs(effectiveTimeEl, { emit: () => {} });
console.log(period?.low?.date?.toISOString());