Skip to main content

core.tojsboolean

Home > @medplum/core > toJsBoolean

toJsBoolean() function

Converts unknown object into a JavaScript boolean. Note that this is different than the FHIRPath "toBoolean", which has particular semantics around arrays, empty arrays, and type conversions.

Signature:

export declare function toJsBoolean(obj: TypedValue[]): boolean;

Parameters

Parameter

Type

Description

obj

TypedValue[]

Any value or array of values.

Returns:

boolean

The converted boolean value according to FHIRPath rules.