> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Pharmacy Directory

> Manage the organization's pharmacy directory for e-prescribing, including NCPDP ID, EPCS capability, and active status.

The Pharmacy Directory screen manages the organization's list of pharmacies used for electronic prescribing, accessible at `/cl/pharmacies`.

## Overview

The page fetches all organization pharmacies including inactive ones via `usePharmacyListAll` from `cl_pharmacies` (excluding soft-deleted rows). A live search field filters the displayed list by pharmacy name, NCPDP ID, or phone number. The main table columns are: Name, NCPDP ID, Contact (phone and fax), EPCS badge, Status (Active / Inactive), and an Activate/Deactivate toggle action (gated by `cl.pharmacies.manage`). Users with `cl.pharmacies.manage` can also open the "Add Pharmacy" dialog by clicking the accent button in the header. The Add Pharmacy form requires Name and NCPDP ID (both marked required), with optional Phone, Fax, and an EPCS Capable toggle (defaults to on). Inactive pharmacy rows render at reduced opacity with a muted background.

## Who it's for

Requires permission: `cl.pharmacies.view`

Additional permission that unlocks management:

* `cl.pharmacies.manage` — enables "Add Pharmacy" button and Activate/Deactivate row actions

## Before you start

* Your account must have the `cl.pharmacies.view` permission.
* To add or manage pharmacies, you additionally need `cl.pharmacies.manage`.
* Have the pharmacy's NCPDP Provider ID available before adding a new entry.

## Steps

<Steps>
  <Step title="Open Pharmacy Directory">
    Navigate to `/cl/pharmacies`. The directory table loads automatically showing all pharmacies (active and inactive).
  </Step>

  <Step title="Search pharmacies">
    Type in the search box to filter by pharmacy name, NCPDP ID, or phone number. The list filters in real time.
  </Step>

  <Step title="Add a pharmacy (manage permission required)">
    Click "Add Pharmacy" to open the dialog. Enter the pharmacy Name (required) and NCPDP ID (required). Optionally add Phone, Fax, and toggle EPCS Capable. Click "Save Pharmacy" to add the entry to the directory.
  </Step>

  <Step title="Activate or deactivate a pharmacy (manage permission required)">
    Click "Deactivate" on an active pharmacy row to set it inactive, or "Activate" on an inactive row to restore it. Changes take effect immediately.
  </Step>
</Steps>

## Key concepts

<AccordionGroup>
  <Accordion title="EPCS Capable">
    The EPCS badge appears on rows where `accepts_epcs` is true. This indicates the pharmacy is flagged to accept electronic prescriptions for controlled substances. SME: confirm whether this is a verified or manual flag.
  </Accordion>

  <Accordion title="Active vs Inactive">
    Active pharmacies are available for prescribing workflows. Inactive pharmacies remain in the directory (soft deactivated) but are excluded from `usePharmacyList` (the active-only hook used in prescribing contexts).
  </Accordion>

  <Accordion title="Empty states">
    No search match: "No pharmacies found matching your search." No pharmacies in directory: "No pharmacies in directory."
  </Accordion>
</AccordionGroup>

## Related

<Columns cols={2}>
  <Card title="Clinical" icon="stethoscope" href="/cl/overview">
    Overview of the Clinical core.
  </Card>

  <Card title="Governance & parity" icon="scale-balanced" href="/governance/index">
    Documentation coverage and governance.
  </Card>
</Columns>

<Note>
  This page documents shipped product behavior. It is not medical, legal, or
  billing advice. Verify against your organization's policies and applicable
  regulations before using it for clinical, compliance, or billing decisions.
  Protected health information (PHI) shown in the product is governed by your
  tenant's access controls and is never exposed in this documentation.
</Note>

<Accordion title="Documentation sources">
  * src/routes/cl.tsx
  * src/cores/cl/pages/PharmacyDirectoryPage.tsx
  * src/cores/cl/hooks/usePharmacyList.ts
</Accordion>
