Skip to main content
Version: v0.0.8

Function: profileOptions()

profileOptions(profile, context?, overrides?): DeidOptions

Build the DeidOptions to pass to any adapter (deidentifyHl7, deidentifyFhir, …) from a profile: its policy, the supplied key context, and the profile's default redactor (unless overridden).

Parameters

profile

DeidProfile

The profile to apply.

context?

DeidContext

The keyed per-patient context (required by profiles whose requiresContext is true).

overrides?

Optional context/redactor overrides merged over the profile's defaults.

context?

DeidContext

redactor?

FreeTextRedactor

Returns

DeidOptions

The DeidOptions for an adapter call.

Example

import { SAFE_HARBOR_PROFILE, profileOptions, createDeidContext } from "@cosyte/deid";

const opts = profileOptions(SAFE_HARBOR_PROFILE, createDeidContext({ key: "k" }));
opts.policy === SAFE_HARBOR_PROFILE.policy; // => true