Skip to main content
Version: v0.0.3

Function: readObservationValue()

readObservationValue(valueEl, ctx): ObservationValue | undefined

Read a polymorphic observation <value> into an ObservationValue, branching on xsi:type. A PQ is UCUM-checked; an untyped value with a @code/@value is treated leniently as coded/quantity; an unrecognized xsi:type is preserved as unsupported and flagged with RESULT_VALUE_TYPE_UNHANDLED. Returns undefined when the element is absent.

Parameters

valueEl

any

ctx

ParseCtx

Returns

ObservationValue | undefined

Example

import { readObservationValue } from "@cosyte/ccda";
const v = readObservationValue(child(obs, "value"), ctx);