Prescriptions
Prescriptions is where a pharmacy logs each patient Rx — patient details, prescribing doctor, one or more drug lines with dosage/frequency/duration, and how long the prescription is valid for. Every Rx gets an auto-generated number and expiry date, can be "dispensed" by handing its drug list off to billing, and feeds a WhatsApp refill-reminder banner for patients due for a refill soon.
Overview
Every prescription is given an Rx number in the format RX-YYYYMMDD-### the moment it is created, where the date is the prescribed date and ### is a running count of Rx created for that same date at this store.
Expiry Date is calculated automatically as Prescribed Date + Valid For (days) — there is no separate manual expiry field.
A prescription can hold multiple drug lines ("items"), each with its own dosage, frequency, duration, quantity and instructions — add or remove lines freely before saving.
Typing a Doctor Name that exactly matches (case-insensitive) an entry in Doctors auto-links the prescription to that doctor record (doctorId); typing any other name still saves fine as free text, just without the link.
A "Dispense" action on each active Rx hands its patient name, doctor name and drug list to the billing screen via sessionStorage so a cashier can search for and add each drug to the cart — it does not add the items automatically.
A banner above the list surfaces patients whose prescription is due for a refill within 7 days, each with a one-tap WhatsApp reminder button (same wa.me pattern used by Warranty/EMI reminders in other variants).
Before You Start
- You must have the Billing feature enabled on your plan.
- Add doctors under Pharmacy → Doctors first if you want the Doctor Name field to auto-link to a doctor record (optional — free-text names are accepted either way).
Step-by-Step Guide
1 Create a new prescription
- Open Pharmacy → Prescriptions and click "+ New Rx".
- Fill in Patient Name (required), Phone, Age and Gender.
- Enter Doctor Name (pick from the suggestions if the doctor is already in Doctors), Reg. Number, Hospital/Clinic, Prescribed Date, Valid for (days, default 30) and Diagnosis.
- Add one or more drug lines under "Drugs Prescribed" — Drug Name, Frequency, Duration and Qty (use "+ Add Drug" for more lines, the trash icon to remove one).
- Add any Notes, then click "Save Rx" — the Rx number and expiry date are generated automatically.
2 Dispense a prescription at billing
- On an active (non-expired) prescription row, click the pill icon ("Dispense at billing").
- You are taken to Quick Billing; the patient and doctor name are pre-filled and a toast lists every drug and quantity from the Rx so the cashier knows what to search for and add.
- Search for and add each drug to the cart as normal, then complete the sale — the sale is stamped with the prescription's ID.
- On checkout, each matching drug line's dispensed quantity is updated and the prescription's status advances automatically (see Field Reference → Status).
3 Send a refill reminder
- If any active prescriptions are due for a refill within 7 days, an amber banner appears above the filters listing each patient as a button.
- Click a patient's name to open a pre-filled WhatsApp message on their phone number reminding them to restock; this only works if the prescription has a Patient Phone on file.
4 Search, filter, edit and delete
- Use the search box to filter by patient name, Rx number or doctor name as you type.
- Use the All / Active / Expired chips to narrow the list; "Expired" shows Rx whose expiry date has passed regardless of status.
- Click the edit (pencil) icon to reopen an Rx for editing, including its drug lines, which are fully replaced with whatever is in the form when you save.
- Click the trash icon and confirm to permanently delete a prescription and all its drug lines.
Every Field & Button, Explained
| Field / Button | What it does |
|---|---|
Rx Number | Auto-generated as RX-YYYYMMDD-###; the date is the Prescribed Date and ### is a running count for that date at this store — not editable. |
Patient Name / Phone / Age / Gender | Patient Name is required; the rest are optional. Phone is what the WhatsApp refill reminder is sent to. |
Doctor Name | Free text with autocomplete suggestions from Doctors. An exact case-insensitive match to an existing doctor links doctorId automatically; anything else is still saved as plain text. |
Reg. Number / Hospital or Clinic | Recorded on the Rx itself (separate from any linked Doctor record) — useful when the prescribing doctor is not in your Doctors master. |
Prescribed Date | Defaults to today if left blank. Used as the base date for both the Rx number and the Expiry Date calculation. |
Valid for (days) | Number of days the prescription remains valid from Prescribed Date; defaults to 30. Expiry Date = Prescribed Date + this many days. |
Diagnosis / Notes | Free-text; Notes only appears in the edit form, not in the list. |
Drugs Prescribed (items) | One or more lines, each with Drug Name (required to be saved), Frequency (from a fixed list: Once daily, Twice daily, Thrice daily, Four times daily, Every 8 hours, Every 6 hours, As needed, At bedtime), Duration (free text, e.g. "7 days") and Quantity. |
Status | ACTIVE at creation. Advances to PARTIAL once some drug lines are dispensed via a sale, DISPENSED once every line's dispensed quantity reaches its prescribed quantity. "Expired" in the list is a separate, date-based badge (Expiry Date passed) shown regardless of the underlying status value; CANCELLED exists in the schema but there is no button in this screen to set it. |
Tips & Best Practices
- Keep Patient Phone filled in if you want to use the refill-reminder WhatsApp button later — prescriptions without a phone number simply show an error toast when you try.
- Dispense does not remove or add items to the cart for you — it is a hand-off that pre-fills the patient/doctor name and reminds the cashier which drugs to search for, so double-check quantities against the toast before completing the sale.
- Add the prescribing doctor under Doctors first (matching the name exactly) if you want their prescriptions to roll up correctly into the Doctors → Report view.