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
Returns
ObservationValue | undefined
Example
import { readObservationValue } from "@cosyte/ccda";
const v = readObservationValue(child(obs, "value"), ctx);