Pharmacy Reference Public

Reference

Data and screen reference for the ERPat Pharmacy module: the menu items and routes, every permission key, the controllers behind each screen, the main database tables, the cron jobs and dashboard widgets, and the integration and end-user API endpoints.

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

Reference

A compact data-and-screen reference for the Pharmacy module: the sidebar items and their routes, the controllers behind each screen, every permission key, the main database tables, the workflow status values, the scheduled jobs and dashboard widgets, and the two API surfaces. Written to be looked up, not read cover to cover.

Module slug: pharmacy  |  Version: 0.5.0  |  Route prefix: pharmacy

Menu items & routes

The Pharmacy sidebar group (display label "Pharmacy"), in order. Each item is gated by its permission; the two advanced items also by a sub-toggle.

Menu itemRoutePermissionSub-toggle
Overview/pharmacypharmacy
Drug Catalog/pharmacy/productspharmacy_product
Near-Expiry & Lots/pharmacy/expirypharmacy_expiry
Prescriptions/pharmacy/prescriptionspharmacy_prescription
Patients & Prescribers/pharmacy/patientspharmacy_patient
Controlled Drugs/pharmacy/controlledpharmacy_controlled_viewmodule_pharmacy_controlled
Quality & Safety/pharmacy/qualitypharmacy_qualitymodule_pharmacy_quality
Compliance Center/pharmacy/compliancepharmacy_compliance
Settings/pharmacy/settingspharmacy_settings

Additional routed surfaces that live within these workspaces: /pharmacy/licenses, /pharmacy/credentials, /pharmacy/duty, /pharmacy/tasks, /pharmacy/inspection_packs (Compliance Center tabs); /pharmacy/generic_groups, /pharmacy/suppliers (Drug Catalog tabs); and /pharmacy/prescribers (Patients hub tab).

Controllers & the screens they drive

ControllerScreen / responsibility
PharmacyOverview command center (read-only dashboard).
Compliance_centerThe tabbed compliance hub (readiness + on-duty summary).
Pharmacy_licensesLicenses & Permits CRUD (FDA LTO / permit / RMP).
Pharmacy_credentialsPharmacist credentials CRUD (PRC / PIC / training).
Duty_sessionsStart / end pharmacist duty sessions (validates a non-expired credential).
Pharmacy_compliance_tasksRenewal-task checklist + mark-done + overdue detection.
Inspection_packsGenerate / delete inspection-readiness snapshots.
Pharmacy_productsDrug Catalog hub (Catalog / Generic Groups / Suppliers tabs), drug-profile CRUD, regulatory verifications.
Pharmacy_generic_groupsGeneric-group CRUD (interchangeable products).
Pharmacy_suppliersSupplier FDA-LTO licensing (extends Procurement vendors).
Pharmacy_expiryRead-only near-expiry / lot dashboard over the Warehouse ledger.
Pharmacy_prescriptionsRx queue, capture, items, status transitions, record-fill, dispensing label, BIR receipt.
Pharmacy_patientsPatients hub, patient CRUD, representatives, medication profile, audited ID reveal.
Pharmacy_prescribersPrescriber directory CRUD.
Controlled_registerAppend-only controlled ledger, correction-by-reversal, reconciliation.
Pharmacy_qualityRecalls (with batch quarantine), adverse events, cold-chain readings.
Pharmacy_settingsBranch profiles + the advanced sub-toggles.
Pharmacy_apiIntegration (client) API controller.
Pharmacy_euapiEnd-User API controller.

Permission keys

Keys are grouped by category as they appear in the Roles editor. The base pharmacy key is the module Enable toggle. Admins bypass all checks.

CategoryKeys
Basepharmacy
Compliancepharmacy_compliance, pharmacy_compliance_create, pharmacy_compliance_update, pharmacy_compliance_delete
Operationspharmacy_duty
Catalogpharmacy_product, pharmacy_product_create, pharmacy_product_update, pharmacy_product_delete, pharmacy_expiry
Dispensingpharmacy_prescription, pharmacy_prescription_create, pharmacy_prescription_update, pharmacy_prescription_delete, pharmacy_prescription_validate, pharmacy_dispense
Patientspharmacy_patient, pharmacy_patient_create, pharmacy_patient_update, pharmacy_patient_delete, pharmacy_patient_view_sensitive
Controlledpharmacy_controlled_view, pharmacy_controlled_post, pharmacy_controlled_correct
Qualitypharmacy_quality, pharmacy_quality_create, pharmacy_quality_update, pharmacy_quality_delete, pharmacy_recall_manage
Settingspharmacy_settings

Database tables

The 26 tables the module owns (all in the tenant database, tracked in migrations_pharmacy). No stock, payment, supplier or product master is created here — those are reused from other modules.

GroupTables
Compliancepharmacy_branch_profiles, pharmacy_licenses, pharmacy_credentials, pharmacy_duty_sessions, pharmacy_compliance_tasks, pharmacy_inspection_packs
Catalogpharmacy_product_profiles, pharmacy_generic_groups, pharmacy_regulatory_verifications, pharmacy_supplier_profiles
Patients & prescriberspharmacy_patients, pharmacy_patient_representatives, pharmacy_prescribers
Prescriptions & dispensingpharmacy_prescriptions, pharmacy_prescription_items, pharmacy_prescription_documents, pharmacy_dispensing_records, pharmacy_dispensing_items
Statutory benefitpharmacy_benefit_rule_versions, pharmacy_benefit_decisions, pharmacy_benefit_line_calculations
Safetypharmacy_controlled_ledger, pharmacy_controlled_reconciliations, pharmacy_recall_cases, pharmacy_adverse_events, pharmacy_temperature_readings

Status & workflow values

Prescription status

draft → submitted → validated → partially_filled → completed, with rejected and cancelled as exits. Transitions are atomic and one-way; validation and fills require a pharmacist on duty.

Controlled entry types

IN to balance: opening, receipt. OUT of balance: dispense, return, destruction. Plus correction — a linked reversing entry.

Recall status

draft → active (activation quarantines the matching Warehouse batch). Closed/other states track the case to resolution.

Statutory benefit

Benefit types: none, senior, pwd (mutually exclusive). Rule defaults: 20% discount, 12% VAT, senior booklet off. Order: VAT-exempt base, then 20% off. (₱112 → ₱80.)

Drug classification

Rx, pharmacist-OTC, OTC, medical device, supplement, controlled — plus a controlled schedule, FDA CPR number/status, storage condition, cold-chain flag, Senior/PWD eligibility and a price ceiling.

Expiry buckets

Expired · 0–30 days · 31–90 · 91–180 · over-180, computed live from the Warehouse batch ledger with on-hand value.

Cron jobs & dashboard widgets

TypeKeyDetail
Cron jobpharmacy_license_expiryDaily 07:00 — licenses/credentials expiring within 30 days or expired.
Cron jobpharmacy_near_expiry_stockDaily 06:30 — pharmacy-classified stock lots expiring within 90 days (needs Warehouse).
Widgetpharmacy_compliance_readinessStaff dashboard — branch readiness score. On by default.
Widgetpharmacy_expiring_complianceStaff dashboard — expiring licenses & credentials. On by default.

Both widgets are gated on module_pharmacy + pharmacy_compliance; both jobs self-gate on module_pharmacy and run per tenant.

API endpoints

Integration API — /api/v1/pharmacy

Bearer token, scope pharmacy:read ("Pharmacy (Read)"). Read-only: drug catalog + aggregate compliance readiness only.

Method & pathReturns
GET /api/v1/pharmacy/productsPaginated drug catalog (?page, ?per_page, ?classification).
GET /api/v1/pharmacy/products/{id}A single drug profile (404 product_not_found if missing).
GET /api/v1/pharmacy/complianceAggregate compliance-readiness counts (no record-level detail).

End-User API — /v1/api/pharmacy

Authenticated employee; gated by module_pharmacy + the matching web permit. Read-only; no patient/dispensing/controlled data.

Method & pathPermitReturns
GET /v1/api/pharmacy/productspharmacy_productPaginated drug catalog.
GET /v1/api/pharmacy/products/{id}pharmacy_productA single drug profile.
GET /v1/api/pharmacy/near-expirypharmacy_expiryNear-expiry lots (?within days; needs Warehouse — empty list without it).
On both surfaces, a tenant with the module disabled returns 404 module_unavailable — the endpoint hides the resource's existence rather than returning a 403.

Next: Research → — the live files this guide was built from.

Was this guide helpful?

Report a content problem