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

# Prescribing and dispensing safety

> The checks that fail closed, the controlled-drug rules, medication records and the pharmacist verification setting.

The allergy, interaction and out-of-stock steps are in [Prescribing](/guides/doctor/prescribing) and [Dispense a prescription](/guides/pharmacist/dispense-a-prescription). This page covers the rules around them.

<Warning>
  The allergy check matches names and drug classes against **recorded** allergies. It does not infer cross-reactions between different classes, and it cannot see an allergy nobody has recorded. The clinical content is awaiting clinical sign-off. It supports your judgement. It does not replace it.
</Warning>

## Fail closed

If the allergy check cannot run at the counter, dispensing is held. PHB answers `503` with `dispense.allergy_check_unavailable` and never shows "no allergies" when it could not look. The drug interaction check is awaiting clinical sign-off and switched off, so check interactions yourself.

## Controlled drugs

* Signing a Schedule I or II prescription needs a security re-check with your device key. Without it, PHB asks you to verify your device first.
* At the counter, a controlled drug is always stock-gated, even when your pharmacy does not track general inventory. If the count is short, the dispense fails with `inventory.insufficient`. Record stock first or flag the item out of stock.

## Pharmacist verification

The three checks (pharmacist, link, premises) are in [PCN verification](/guides/pharmacist/pcn-verification). What you see depends on a platform setting. **The default is to warn.** An unverified pharmacist or premises can still dispense, and PHB records each time. PHB can switch the setting to **blocking**. Then:

| Missing | You see |
| - | - |
| Your PCN licence | **Only a PCN-verified pharmacist can dispense. Verify your PCN licence to continue.** with a link to onboarding. |
| The premises | A message that PHB has not verified this pharmacy's premises. Only PHB can resolve it, so contact PHB support. |

The setting applies to every pharmacy at once. It is not set per facility.

## Medication records: otc and external\_rx

**Record a sale** puts a medicine on a patient's record without a PHB prescription. Each record carries an origin:

* `otc`: an over-the-counter sale.
* `external_rx`: a paper prescription from outside PHB. You can note the outside prescriber.

A medication record is not a PHB prescription. It carries no prescribing authority, and the allergy and interaction checks do not run on it. Recording needs a verified pharmacist, and the patient must be present and confirmed. See [Record a sale](/guides/pharmacist/record-a-sale).

<Note>
  The clinical model for medication records is awaiting clinical sign-off.
</Note>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.