Pharmacy Reference Public

Getting Started

Set up the ERPat Pharmacy module from scratch: run the migration, enable the module and its two advanced sub-toggles, grant the right permissions, add a branch profile, record your FDA LTO and pharmacist credentials, then follow a beginner path through catalog, prescriptions and dispensing.

Guide version: r1 Module version: 1.0.0 Updated: 2026-07-23 Estimated time: 8 min
ERPat · Pharmacy Guide

Getting Started

Go from a freshly installed module to a running, inspection-ready branch: enable Pharmacy (and, if you need them, the two advanced areas), grant the right permissions, create a branch profile, record your FDA LTO and pharmacist credentials, put a pharmacist on duty — then follow a suggested path through the catalog, prescriptions and dispensing.

The Compliance Center setup takes about 20 minutes for a single branch; the rest you can grow into. When you are ready to work the counter, keep Daily Operations open.

Before you begin

Have these ready so you can enter real values as you go — you can always come back and edit later.

  • Admin or an equipped role. Enabling a module and granting permissions needs an administrator. Admins bypass every Pharmacy permission check, so an admin can complete this whole guide alone.
  • Your branch details — the pharmacy's registered name and how it operates.
  • Your FDA License to Operate (LTO) — the number, issued date, and expiry date. The business/mayor's permit and Risk Management Plan help too.
  • Your Pharmacist-in-Charge — an existing ERPat staff user, plus their PRC ID number and its expiry date.
  • The Warehouse (WMS) and Procurement modules, if you want the drug catalog, near-expiry dashboard and FEFO dispensing — the catalog extends Warehouse stock items and supplier licensing extends Procurement vendors. Both degrade gracefully with a clear notice when those modules are not installed.
  • Command-line access (for the admin only) to run the module migration once. Regular users never touch the command line.
Readiness, not certification. Completing these steps makes the Compliance Center report your branch as inspection-ready. That reflects your evidence completeness — it is not a government certification and remains subject to FDA / PRC / BIR validation.

1 · Enable the module

Pharmacy ships its own database tables, so an administrator runs the module migrations once, then switches the module on.

  1. Run the migrations. From the ERPat project root, run:
    php erpat migrate:modules
    This creates the Pharmacy tables (tracked separately in migrations_pharmacy) and is safe to re-run.
  2. Turn the module on. Go to Settings → Manage Modules, find Pharmacy, and enable it. (Under the hood this sets module_pharmacy = 1.)
  3. Confirm the menu. Refresh the page. A new Pharmacy group appears in the left sidebar with Overview, Drug Catalog, Near-Expiry & Lots, Prescriptions, Patients & Prescribers, Compliance Center and Settings. (Controlled Drugs and Quality & Safety stay hidden until you enable their sub-toggles — step 2.)
If the Pharmacy group does not appear, the module is either not enabled or the signed-in user lacks the base pharmacy permission. Sign in as an admin to verify, then grant permissions (step 3).

2 · Enable the advanced sub-modules (optional)

Two regulated areas are kept off by default and only appear once you switch them on in Pharmacy → Settings → Advanced Modules. Enable each only after your tenant has validated the applicable real-world procedure.

Sub-toggleSettingTurns on
Controlled-drug registermodule_pharmacy_controlledThe append-only dangerous-drug (RA 9165) ledger and reconciliation. Enable after validating your PDEA / DDB procedures.
Quality & Safetymodule_pharmacy_qualityRecalls / stop-sale, adverse-event reporting, and cold-chain temperature logging.

Leaving both off is expected for a fresh install. You can enable them later at any time; the menu links and their controllers stay hidden (a direct URL is redirected) until the matching sub-toggle is on.

3 · Grant permissions

Admins already have full access. To let non-admin staff use Pharmacy, assign the relevant permissions to their roles under Settings → Roles. A user needs the base pharmacy permission to see anything at all; the rest layer on specific capabilities. Grant only what each person needs.

Permission familyWhat it unlocksTypical holder
pharmacyBase access — the menu group and the Overview command center.Everyone who opens Pharmacy
pharmacy_compliance (+_create/_update/_delete)Licenses, credentials, renewal tasks, inspection packs.Compliance officer, branch manager
pharmacy_dutyStart and end pharmacist duty sessions.Pharmacist-in-Charge, supervisor
pharmacy_product (+CRUD), pharmacy_expiryThe drug catalog / generic groups / suppliers, and the near-expiry dashboard.Pharmacist, inventory lead
pharmacy_prescription (+CRUD), pharmacy_prescription_validate, pharmacy_dispenseRx capture, the pharmacist validation step, and recording fills.Assistants capture; pharmacists validate & dispense
pharmacy_patient (+CRUD), pharmacy_patient_view_sensitivePatients & prescribers; the last one permits an audited unmask of a patient ID.Front desk; unmask for pharmacist/PIC only
pharmacy_controlled_view / _post / _correctThe controlled register (needs the sub-toggle on).Pharmacist-in-Charge
pharmacy_quality (+CRUD), pharmacy_recall_manageQuality & Safety records; the last one activates/closes recalls (needs the sub-toggle on).Quality lead, PIC
pharmacy_settingsBranch profiles and the advanced sub-toggles.Owner, branch manager

A good starter split: assistants get pharmacy + pharmacy_prescription_create + pharmacy_patient; pharmacists add pharmacy_duty + pharmacy_prescription_validate + pharmacy_dispense; the PIC/owner adds pharmacy_settings, the compliance family, and pharmacy_patient_view_sensitive. Full detail is in Administration.

4 · Add a branch profile (and the rule flags)

A branch profile is the home for one physical pharmacy location. Its rule flags decide what the compliance and dispensing behavior enforces at that branch. Open Pharmacy → Settings and add a profile.

Field / flagDefaultWhat it means
Branch nameThe registered name of this location (required).
Operating profileCommunity drugstorecommunity_drugstore / non_prescription / institutional.
Deployment modeMicromicro / multi_branch / enterprise — a sizing hint.
Pharmacist-in-ChargeThe staff user recorded as the branch PIC.
Require pharmacist on dutyOn (recommended)The pharmacist-on-duty gate that dispensing enforces.
FEFOOnPrefer nearest-expiry stock first — reused from the Warehouse engine.
Senior Citizen booklet requiredOffOff by default per FDA Circular 2025-005 — the senior booklet is not required.
PWD booklet requiredConfigurableTurn on if your branch requires a PWD purchase booklet.
Controlled-drug registerOffA per-branch flag; the register itself is gated by the module sub-toggle (step 2).
Prescription retention (years)5 (minimum 2)How long dispensing records are retained; the statutory minimum is 2 years.
Expiry warning horizon (days)180How many days ahead a license/credential is flagged as "expiring."

Save the profile. Every change is written to the audit trail, so you always have a record of who changed what and when.

5 · Record your compliance evidence

Open Pharmacy → Compliance Center. Its tabbed lists are where your regulatory evidence lives; the readiness score on the Overview rises as you complete them.

  1. Licenses & Permits — add your FDA LTO first (the single most important record), then the business / mayor's permit and Risk Management Plan (RMP). Enter the number and the issued/expiry dates; Pharmacy derives the status (valid / expiring / expired) from the expiry date and your warning horizon.
  2. Pharmacist Credentials — add a credential for your PIC, pick the staff user it belongs to, choose the type (PRC ID / PIC / training) and enter the number and expiry date. A non-expired credential here is what lets that person go on duty.
  3. Renewal Tasks — add a deadline task for each recurring obligation (LTO renewal, permit renewal, PRC renewal, RMP review) with an owner, category and due date. Tasks past due are flagged overdue automatically.
Why credentials matter next: only a staff user with a non-expired credential on file can be put on duty in the next step. No valid credential means no duty session — and no validation or dispensing.

6 · Put a pharmacist on duty

Duty sessions record who the pharmacist on duty is at any moment — the source of the pharmacist-on-duty gate that validation and dispensing enforce.

  1. Open the Pharmacist Duty tab in the Compliance Center (you need pharmacy_duty, or be an admin).
  2. Choose the pharmacist, optionally a branch and counter, and start the session. If the person has no valid credential on file, Pharmacy blocks the start — add or renew their credential first (step 5).
  3. When their shift ends, return here and end the session. The Overview always shows whether a pharmacist is currently on duty.

Your first week — a suggested path

With the Compliance Center in place, grow into the rest of the module in this order:

Build the drug catalog

In Drug Catalog, add a drug profile to each medicine stock item — classification (Rx/OTC/controlled), FDA CPR, storage/cold-chain, Senior/PWD eligibility. Group interchangeable products with Generic Groups and record each vendor's FDA LTO under Suppliers.

Watch expiry

Open Near-Expiry & Lots to see stock by expiry bucket over the Warehouse ledger. The daily cron jobs also flag expiring licenses/credentials and near-expiry stock.

Add patients & prescribers

Create your regular patients (Senior/PWD benefit type, ID — masked and encrypted at rest) and your prescriber directory, ready for Rx capture.

Run a prescription end to end

Capture an Rx, add its items, submit, have a pharmacist validate it (needs someone on duty), then record a fill — FEFO issues stock, the Senior/PWD discount is computed, and you can print the label and BIR receipt. Walk through it in Daily Operations.

Load sample data (optional)

Want to explore with realistic content before entering your own? An administrator can load a demo dataset.

  • Load the demo data:
    php erpat db:seed PharmacyDemo
  • Remove it again when you're done:
    php erpat db:seed PharmacyDemo --remove

The seeder is idempotent (running it twice does no harm) and reversible (a soft delete of exactly what it inserted), so it is safe to try on a fresh install and clean up afterward. You can also load and remove it from the tenant Bulk Database Seeder modal.

Next: Daily Operations → — the counter SOPs for duty, prescriptions, dispensing, the controlled register and cold chain.

Was this guide helpful?

Report a content problem