Nexus Docs Documentation for the Nexus hospital management system

User Guide

Pharmacy

Prescriptions, drug-safety, dispensing, counselling, and multi-pharmacy stock — the seventh kiosk.

A.1 What a pharmacist owns

ResponsibilityDetail
Pharmacy workbenchA single screen with six tabs — Prescriptions, Inventory, Transfers, Interactions, Counselling, Analytics.
Prescription queueEvery Rx placed by any doctor (clinic, ER, ward, OR, outpatient) lands on the Prescriptions tab the moment it’s created. STAT / urgent items bubble up via the bell.
Drug-safety checksThe system runs a drug-allergy check and a drug-drug interaction check at the moment a prescriber tries to create an Rx. Major / contraindicated pairs and any active-allergy match block the Rx unless an override is recorded in the audit log. Moderate / minor interactions pass through but are persisted as an active medication alert on the patient.
DispensingPer-item Dispense button on the Rx detail. Stock decrements at the prescription’s branch (not “any branch with the drug”). Out-of-stock is surfaced inline; the rest of the items can still go.
RefillsPrescriptions can carry an authorised refill count (0–11). When ≥1 refill remains, an Issue refill button appears on the Rx detail. Each refill decrements the remaining count, deducts stock, and writes a row in the refill log.
Inventory & drug masterPer-medication card with stock, reorder level, branch, controlled-substance flag + narcotic schedule, formulary status, refrigeration, barcode / batch / lot / storage location. Cards filter by branch and by status.
Stock transfersMulti-pharmacy hospitals route inventory between Main / ER / OPD / satellite branches via the Transfers tab. The destination Accepts (stock moves) or Rejects (no movement).
Drug-drug interactionsThe Interactions tab is the master editor for the rule set the safety check runs on. Pharmacy directors can extend or override the seeded list.
Counselling logPharmacist-patient education events go into the Counselling tab — topic (dosing / side-effects / adherence / lifestyle / drug-food / contraception / missed-dose / other), notes, and an optional follow-up date.
Walk-in patient registrationOutpatient or walk-in patients can be registered directly from the kiosk’s + Patient button — no need to bounce them to reception.
Operational analyticsThe Analytics tab is the head pharmacist’s daily readout: total / pending / dispensed counts, top-prescribed meds, top prescribers, per-branch usage, low-stock + expiring + active-alert counters, 14-day Rx volume sparkline.

A.2 What they cannot do

  • No ward boards (ICU / ER / Maternity / Operations / Ward / Lab / Radiology) — pharmacist is not a clinical-write role.
  • No HR, finance, cashier surfaces.
  • They CAN now register walk-in patients and create prescriptions, but they cannot admit, transfer between wards, or order labs / imaging.

A.3 What the screen looks like

┌────────────────────────────────────────────────────────────────────────────┐
│ M  Mando · Pharmacy        🔔   Pharmacist Omar Khaled ┄                    │
├────────────────────────────────────────────────────────────────────────────┤
│  💊 Pharmacy                                                                │
│     N pending prescriptions · M low stock alerts                            │
│                                       [+ Patient] [+ Med] [+ Prescription]  │
│                                                                             │
│  [Prescriptions] Inventory  Transfers  Interactions  Counselling  Analytics │
│                                                                             │
│  Quick Navigation                                                           │
│  [Patients] [Dispense] [Medications] [Doctors] [Emergency] [Operations] …   │
│                                                                             │
│  [search…] [All / pending / partially / dispensed]                          │
│  [All sources / emergency / operation / ward / clinic / outpatient]         │
│                                                                             │
│  Patient        Doctor         Date         Status         Source · Items   │
│  Sarah Hassan   Dr. Ahmad      2026-04-29   pending        clinic · 3       │
│  John Smith     Dr. Chen       2026-04-29   partially      ward · 5         │
│  …                                                                          │
└────────────────────────────────────────────────────────────────────────────┘

A.4 The day, end to end

  1. Sign in. The system bounces Pharmacist + department=Pharmacy users to /pharmacy. Other roles never see this kiosk.
  2. Watch the queue. Prescriptions is the default tab. Filter by status / source. Search by patient or doctor.
  3. Walk-in patient? Click + Patient in the banner. The modal runs a debounced search before letting you create — orange “Possible matches” panel surfaces existing records so you don’t double-MRN. After create, the system jumps you straight into a New Prescription with that patient pre-selected.
  4. Click a row to open the Rx detail. Patient / doctor / source / pharmacy branch / refills / diagnosis are all visible at a glance, plus a per-item table.
  5. Dispense. Click Dispense on any pending item. Stock is deducted at the prescription’s branch. If the branch is out of stock, the item flips to out-of-stock and the Dispense button gone — but other items on the same Rx are unaffected.
  6. Issue a refill. When the prescriber authorised refills, an Issue refill button appears in the Rx footer once at least one item is dispensed. One click writes a refill row, decrements refills_remaining, and re-deducts stock per item.
  7. Stock transfer. ER pharmacy is short on a drug? Open Transfers, pick the source branch on the picker, hit + Transfer Stock, choose the medication / destination / quantity / priority. The destination’s Inbox lights up; they Accept (stock moves) or Reject (no movement).
  8. Drug-drug interaction tuning. The seeded master ships with ~15 high-impact pairs (warfarin + aspirin, simvastatin + clarithromycin, sildenafil + nitrate, etc.). Pharmacy directors edit / disable / extend the list from the Interactions tab.
  9. Counselling. After dispensing a new chronic med (or any time the patient asks), open Counselling, log the session — topic, notes, optional follow-up date.
  10. End of shift. Open Analytics for the daily readout: pending Rx count, top prescribed drugs, top prescribers, per-branch volume, low-stock / out-of-stock / expiring (60d) / active-alert counters.

A.5 Walk-in patient registration

Outpatient pharmacy and ER pharmacy frequently get patients who aren’t on the system yet. Pharmacy staff register them directly:

  1. From any tab, click + Patient in the banner.
  2. Type into the search box (top of the modal). The form runs a debounced search across name, phone, email, and national ID. Possible matches appear in an orange “Possible matches” panel.
  3. If a match appears: click it → the modal closes and the New Prescription modal opens with that patient pre-selected.
  4. If no match: fill the create form (full name required, plus DOB / gender / phone / national ID / email / address) and click Register & New Prescription. The system creates the patient, mints an MRN, refreshes the patient list, and jumps straight into the prescription modal with the new patient pre-selected.

Why search-first: a walk-in pharmacy visit is the most common path to accidentally creating a parallel record (no admission, no insurance lookup, no demographics double-check). The orange panel is the single guardrail.

A.6 Drug-safety workflow

Two checks run automatically every time a prescription is saved:

  1. Drug-allergy. Each prescribed item is checked against the patient’s active allergens. Any match blocks the save and shows the conflict.
  2. Drug-drug interaction. New items are checked against each other and against the patient’s active prescriptions. Severity buckets:
    • Contraindicated / Major: The Rx is blocked. The kiosk surfaces a “Proceed anyway? (override is audited)” confirm — if the prescriber confirms, the override is recorded.
    • Moderate / Minor: The Rx is created, but the hit lands on the pharmacist’s alert panel to acknowledge.

Override is the explicit path — there’s no silent bypass.

A.7 Multi-pharmacy stock transfers

Three branches seed on a fresh boot: MAIN (Main Pharmacy), ER (ER Pharmacy), OPD (Outpatient Pharmacy). Add more from the API or extend the seed.

Branch picker (top of Transfers tab) is the “I am working at this pharmacy” selector. Defaults to the first active branch and persists in localStorage.

Sub-tabWhat it shows
InboxTransfers other branches sent to me, status pending. Accept / Reject buttons.
OutgoingTransfers I sent. Read-only — see whether they were accepted or rejected.
All activityInbox + Outgoing combined, sorted newest first.

The flow:

  1. Tech at Source clicks + Transfer Stock → picks medication, destination, quantity, priority, reason. Submit.
  2. Server verifies source actually has the stock. Refused if not.
  3. Transfer is queued pending. Receiving branch gets a notification.
  4. Destination Accepts → server re-checks stock at decision time (Create’s check could be stale), then decrements source and increments destination (cloning the source row’s master fields if the destination didn’t stock the drug yet).
  5. Destination Rejects → no stock movement. Sender notified at high priority.

Common pitfalls:

  • “My transfer was accepted but stock didn’t move.” Check the destination branch’s inventory — the row is created/incremented at to_branch_id, not at the source.
  • “Stock check failed at Accept time.” Someone dispensed against the source while your transfer was pending. Send a smaller transfer or wait for restock.

A.8 Counselling log

Each row is one pharmacist-patient education event. Topic taxonomy is a soft enum:

TopicUse
dosing“Take with food”, “every 6 hours”, “tapering schedule”
side_effectsWhat to expect / when to call back
adherenceWhy finishing the course matters / pillbox tips
lifestyleAlcohol / driving / breastfeeding caveats
drug_foodGrapefruit / tyramine / dairy interactions
contraceptionCycle gaps, alternative method during therapy
missed_doseCatch-up rules
otherAnything not above

Follow-up: tick the box + pick a date when the patient should come back. The Counselling tab has a “Follow-up needed only” filter so the pharmacy lead can scan the daily callback list.

A.9 Notifications

Inbound (the bell flashes):

  • New prescription placed by any doctor — fires rx_new.
  • Pharmacy stock transfer in (other branch routed work to this branch) — fires pharmacy_transfer_in. STAT/urgent bumps to high priority.
  • Pharmacy stock transfer accepted/rejected — fires back to the sender.

Outbound (the pharmacy fires automatically):

  • Drug-allergy override — recorded in audit log via the audit middleware.
  • Drug-interaction alert — written to medication_alerts for moderate/minor; blocked + audited for major/contraindicated.

A.10 Common pitfalls

  • “The dispense said out-of-stock but I have plenty.” Dispense pulls from the prescription’s branch, not “anywhere with stock”. Either transfer some stock to the prescription’s branch or change the prescription’s branch on the Rx form.
  • “The interaction alert keeps firing on a combination my service uses safely.” Open Interactions, find the rule, set Active=false (or change severity to minor). The seeded list is a starting point, not gospel.
  • “I issued a refill but the patient says they didn’t get one item.” Refills do per-item stock checks but don’t block when an item is out-of-stock — they continue with the rest. Open the Rx; out-of-stock items will be visible.
  • "+ Patient registered the same person twice." The orange match panel was probably ignored. The system shows up to 6 candidates — always click an existing record before creating a new one.
  • “Transfer disappeared after acceptance.” Decided rows don’t show in the Inbox filter (which is status=pending). Switch to All activity.