Pharmacy & Inventory

Hospital Pharmacy Management: Stock, Dispensing & Billing Explained

How a hospital pharmacy module manages drug stock, batch and expiry tracking, dispensing against prescriptions, and billing — for both OPD sales and IPD wards.

SK

Subash Kandasamy

Founder, Uyirly

9 min readUpdated 4 August 2026

A hospital pharmacy is really two different operations wearing one name. One side looks like a retail pharmacy: walk-in patients, a prescription, immediate payment. The other side is a supply chain into every ward in the hospital: medicines issued against inpatient orders, charged to a running bill, and tracked by batch and expiry the whole way. A pharmacy module that only handles one of these well isn't really a hospital pharmacy system.

The two sides of hospital pharmacy

Two dispensing paths, one stock

OPD walk-in

Prescription → sale → paid now

IPD ward request

Order → dispense → billed to stay

Both paths draw from the same physical stock, which is exactly why they need to live in one system. A drug dispensed to Ward 3 has to reduce the same stock count as one sold across the counter — otherwise the pharmacy's recorded stock drifts from what is actually on the shelf, and nobody notices until a stock-take turns up a mismatch.

Inventory: batch and expiry tracking

Every unit of stock a hospital pharmacy holds should be traceable to the batch it arrived in and the date it expires. This matters for two reasons: patient safety (never dispense expired medicine) and cost control (never write off medicine that expired because older stock wasn't used first).

  • FEFO dispensing — first-expiry-first-out, so older batches get used before newer ones.
  • Expiry alerts — a running list of stock expiring in the next 30–90 days, so it can be used, returned, or written off deliberately rather than discovered too late.
  • Reorder thresholds — a minimum stock level per drug that triggers a restock alert before the shelf actually runs empty.

For how purchase orders and supplier stock intake feed this pipeline, see our hospital inventory & purchase order guide.

Dispensing against a prescription

Whether OPD or IPD, dispensing should always trace back to a prescription — drug name, dosage, frequency and the prescribing doctor. This isn't just good practice; several drug categories are legally required to be dispensed only against a recorded prescription. See Schedule H, H1 & X compliance for which drug categories carry stricter recording requirements.

Brand vs. generic matters for search

Pharmacy stock and prescriptions are usually written by brand name, but hospitals often want to substitute or compare against the generic/molecule name for cost and stock reasons. A pharmacy module that only searches by exact brand name will constantly send staff hunting — searching by brand, manufacturer and molecule together is worth the extra setup.

Billing: how pharmacy connects to the patient's bill

For an OPD sale, billing is immediate — the transaction is the bill. For an IPD ward request, the dispensed items become a line item on that patient's running combined bill instead of a standalone invoice, so the patient sees one bill at discharge rather than a stack of separate pharmacy slips. See our IPD billing guide for how that combined bill comes together across every department.

The one-stock-count test

There's a fast way to tell whether a pharmacy module actually unifies OPD and IPD, or just runs them as two disconnected features under one login: dispense an item to a ward, then check the OPD sale screen for that same drug. If the stock count dropped there too, it's genuinely one system. If it didn't, the “single pharmacy module” is really two separate stock ledgers wearing one interface — and that gap is exactly where physical stock and recorded stock quietly drift apart.

How Uyirly runs the pharmacy

Uyirly's pharmacytracks every medicine by batch and expiry, and dispenses oldest-valid-first, so stock stays accurate and money does not walk out as expiry write-offs. A doctor's prescription flows straight to the pharmacy, which dispenses against it — so the medicine matches the consultation and the charge lands on the same patient bill.

  • Batch-wise stock with expiry alerts before items lapse.
  • Oldest-valid-batch suggested first (FEFO), so nothing expires unused.
  • One counter for OPD walk-in sales and IPD ward issues.
  • Schedule H, H1 and X carried on each drug, with H1 register fields captured on dispensing.
  • Low-stock flags feed straight into purchase orders.

Getting started

The pharmacy is part of Uyirly's hospital management software and shares the same patient and bill as the doctor. See our Schedule H, H1 & X guide for the compliance detail, or start a 30-day free trial with no credit card.

Frequently asked questions

What is the difference between OPD pharmacy sale and IPD pharmacy billing?

An OPD pharmacy sale is a walk-in, pay-immediately transaction against a prescription — like a retail pharmacy. IPD pharmacy dispensing is different: medicines issued to a ward for an admitted patient are charged to that patient's running combined bill, not paid for on the spot.

How does pharmacy stock get tracked by batch and expiry?

Every incoming stock entry (from a purchase order or supplier delivery) is recorded with its batch number and expiry date. When dispensing, the software should prefer the earliest-expiring batch first (FEFO — first-expiry-first-out) and block or warn against dispensing expired stock.

What is Schedule H1 in pharmacy compliance?

Schedule H1 drugs are a category of prescription medicines — mostly antibiotics and habit-forming drugs — that Indian pharmacies must dispense only against a prescription and log in a separate register with patient and doctor details. The full breakdown is in our drug schedule guide.

See this in your own hospital

Uyirly runs OPD, IPD, pharmacy, lab, billing and staff scheduling in one platform. 30-day free trial, no credit card.

Start free trial

Related guides