PharmIQ++
Pharmacy operations connecting batch inventory, FEFO billing, prescription checks and tenant-scoped workflows.
2026Medicine → branch → batch → sale, with expiry-aware allocation.
Inventory context through the sale
PharmIQ++ connects checkout, batch inventory, prescription checks, invoice processing and branch workflows. React/Vite, TypeScript and Zustand power the interface; Express APIs, Prisma and PostgreSQL carry tenant and inventory context into persistence. A medicine has branch-specific batches with quantities and expiry dates rather than one stock total.
The model supports expiry-aware allocation and movement from supplier receipt to a billed sale.
A sale with context
- Tenant & role
- Medicine selection
- FEFO batch
- Prescription check
- Transaction & stock
Checkout links the medicine, selected batch and transaction to the pharmacy’s records.
Key workflows
- Keyboard-oriented POS: item selection, quantities, subtotals and tax calculations stay close to the checkout interaction.
- Batch-aware inventory: batch number, quantity and expiry date remain separate from the medicine catalogue; FEFO ordering prioritizes earlier expiry.
- Prescription-linked sales: restricted-medicine checks require the relevant prescription context before a sale is finalized.
- Procurement and transfers: supplier invoices, OCR-assisted entry and branch stock movement connect incoming and outgoing inventory.
Engineering decisions
FEFO selects eligible, unexpired batches with positive quantity by earliest expiry. Checkout therefore follows the same batch state used by inventory. Prescription-gated flows associate restricted medicines with a prescription record rather than a detached warning screen. Tenant-aware middleware and authenticated requests preserve pharmacy context; branch/transfer records preserve local stock identity.
Tesseract.js OCR experiments support supplier/invoice extraction with review before accepting batch data. Zustand stores organize POS and inventory interactions, including keyboard-oriented quantity and checkout controls. The backend separates routing, request validation and Prisma data access, with Docker configuration for the service/PostgreSQL environment. Explicit medicine, branch, batch and invoice records keep product identity, quantity, expiry and sale context connected.