## getPreferredPharmaciesFromPatient() function

Extracts preferred pharmacies from a Patient resource's extensions.

**Signature:**

```typescript
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](/content/docs/sdk/core.preferredpharmacy)

An array of PreferredPharmacy objects.

- [getPreferredPharmaciesFromPatient() function](/content/docs/sdk/core.getpreferredpharmaciesfrompatient#getpreferredpharmaciesfrompatient-function/index.html)
- [Parameters](/content/docs/sdk/core.getpreferredpharmaciesfrompatient#parameters/index.html)
