Skip to main content

core.getpreferredpharmaciesfrompatient

Home > @medplum/core > getPreferredPharmaciesFromPatient

getPreferredPharmaciesFromPatient() function

Extracts preferred pharmacies from a Patient resource's extensions.

Signature:

export declare function getPreferredPharmaciesFromPatient(patient: Patient, preferenceTypeSystem?: string): PreferredPharmacy[];

Parameters

Parameter

Type

Description

patient

Patient

The Patient resource.

preferenceTypeSystem

string

(Optional) Optional coding system URL to filter by. When provided, only codings with this system are considered when determining primary status. When omitted, any coding with a primary code is matched regardless of system — this allows reading pharmacy preferences written by any vendor.

Returns:

PreferredPharmacy[]

An array of PreferredPharmacy objects.