core.tojsboolean | Medplum

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 [​](/content/docs/sdk/core.tojsboolean#parameters "Direct link to Parameters"/index.html)

Parameter Type Description
obj TypedValue Any value or array of values.

Returns:

boolean

The converted boolean value according to FHIRPath rules.