> ## 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.

# PDMP Configuration

> Configure the organization's PDMP gateway provider and query behavior toggles for the Arizona CSPMP integration.

The PDMP Configuration screen (`/cl/pdmp/configuration`) is the admin page for setting the Prescription Drug Monitoring Program gateway provider and query behavior options for the organization.

## Overview

The page renders `PdmpConfigurationForm` inside a `PageContainer`. The form is gated by `PermissionGate` on `cl.pdmp.configuration.manage` and shows a loading skeleton while configuration data is fetched via `usePdmpConfiguration`. The form has four fields validated with Zod: a `gateway_provider` select (options: `PMP Gateway (NABP)`, `Bamboo Health / Appriss`, `Arizona HIE (Contexture)`) and three boolean toggles — `auto_query_enabled` (Auto-Query on Prescribing), `interstate_query_enabled` (Interstate Queries), and `delegate_access_enabled` (Delegate Access). On submit, `updateConfiguration.mutate` is called with the form values. The card header text reads "Configure Arizona CSPMP/PDMP gateway settings for your organization."

## Who it's for

Requires permission: `cl.pdmp.configuration.manage`

## Before you start

You must hold the `cl.pdmp.configuration.manage` permission. Only one PDMP configuration record exists per organization; this screen edits that record. Gateway credential secrets are managed separately and are not exposed in this UI.

## Steps

<Steps>
  <Step title="Navigate to /cl/pdmp/configuration">
    Open the Clinical module and navigate to PDMP Configuration. The form loads the current gateway settings for your organization.
  </Step>

  <Step title="Select a gateway provider">
    Choose the PDMP gateway vendor from the dropdown: PMP Gateway (NABP), Bamboo Health / Appriss, or Arizona HIE (Contexture).
  </Step>

  <Step title="Configure query behavior toggles">
    Enable or disable each toggle as appropriate:

    * **Auto-Query on Prescribing** — automatically query PDMP when prescribing controlled substances.
    * **Interstate Queries** — query neighboring state PDMP databases in addition to Arizona.
    * **Delegate Access** — allow designated delegates to query PDMP on behalf of prescribers.
  </Step>

  <Step title="Save configuration">
    Click "Save Configuration." The button shows "Saving…" while the mutation is in flight and returns to its default label on completion.
  </Step>
</Steps>

## Key concepts

<AccordionGroup>
  <Accordion title="Gateway provider options">
    Three providers are available in the shipped schema: `pmp_gateway` (PMP Gateway / NABP), `bamboo_health` (Bamboo Health / Appriss), `arizona_hie` (Arizona HIE / Contexture). Selection is enforced by a Zod enum — no other values are accepted.
  </Accordion>

  <Accordion title="Credential vault">
    The component comment explicitly notes: "credentials\_vault\_ref is NOT exposed in the UI." Gateway credentials are stored separately outside this form.
  </Accordion>

  <Accordion title="Loading state">
    While configuration data loads, the form renders three skeleton rows inside the card. No data is shown until `usePdmpConfiguration` resolves.
  </Accordion>

  <Accordion title="Permission enforcement">
    `PermissionGate` wraps the entire form with `fallback={null}`. Users without `cl.pdmp.configuration.manage` see nothing rendered by the form component.
  </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/PdmpConfigurationPage.tsx
  * src/cores/cl/components/PdmpConfigurationForm.tsx
  * src/cores/cl/hooks/usePdmpConfiguration.ts
</Accordion>
