Skip to main content
Version: v0.0.3

Function: parseIvlPq()

parseIvlPq(el, ctx): IVL_PQ | undefined

Parse an IVL_PQ element into a typed IVL_PQ. Returns undefined when the element is absent. Never throws; omits any bound the element lacks.

A @nullFlavor on the interval itself beside bounds that carry values is the same contradiction parsePq resolves one level down, and gets the same treatment: CONTRADICTORY_NULL_FLAVOR is emitted once for the interval, every bound is preserved verbatim, and the derived value number is withheld from each of them. Without this a dose range declared unknown would still hand doseRange.low.value back to a caller, which is the scalar-dose harm by another route.

Parameters

el

any

ctx

ParseCtx

Returns

IVL_PQ | undefined

Example

import { parseIvlPq } from "@cosyte/ccda";
const range = parseIvlPq(el, { emit: () => {} });
console.log(range?.low?.value, range?.high?.value);