core.getpreferredpharmaciesfrompatient | Medplum
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:
An array of PreferredPharmacy objects.