The Dashboard (index.php) is the main screen of the system. It provides a complete view of
tracer medicine stock status for the 2026/27 financial year (April 2026 to March 2027).
The system pulls data from two tables: pdr_table (current data) and
audit_pdr_table (historical records), and intelligently matches medicine descriptions
to a fixed list of 106 tracer medicines.
What you can do here:
The filter bar allows you to narrow down the data without reloading the core logic. Each filter works independently and they combine with AND logic (i.e. all conditions must match).
| Filter | What it does | Technical behaviour |
|---|---|---|
| Facility | Show data for a specific clinic or hospital. | Searches the Facility and Facility_Name columns using LIKE with partial matching. Auto‑complete suggests existing facilities. |
| District | Show data for all facilities within a selected district. | Matches the District column exactly. Auto‑complete lists districts from the facility_clinic table. |
| NSN | Filter by National Stock Number (a unique product code). | Uses LIKE on the NSN column, so you can search partial numbers. |
| Medicine | Search for a specific tracer medicine by name. | This filters the tracer list itself using stripos (case‑insensitive). Only medicines whose full name contains your search text will appear in the table. |
| Month | Limit the view to a single calendar month (e.g. Jul‑26). | Restricts the week_start_date to the first and last day of the selected month. If omitted, the default range is April 2026 – March 2027. |
The main table lists each tracer medicine as a row. Each month from Apr‑26 to Mar‑27 is a column. The value in each cell tells you the stock status for that medicine in that month.
The Total O/S column at the end counts how many months that medicine was out of stock. A high number (e.g. 8 or more) indicates a chronic shortage and should be investigated.
A bar chart visualises the total number of medicines out of stock per month. This gives a quick overview of how stock availability is trending over time.
Use this chart to spot seasonal patterns, the impact of supply chain disruptions, or improvements over time. Hover over a bar to see the exact number.
Below the main table, three rows show the core performance indicators. These exactly replicate the official KZN Tracer Medicines List Excel formulas.
This is the total number of tracer medicines that were out of stock. For each month, we count every medicine cell that equals 1. The “Total” column sums all months to give the annual numerator.
Example: If 5 medicines are out of stock in Apr‑26, the numerator for Apr‑26 is 5.
The denominator is the total number of tracer medicines that should be available. This is fixed at 106 (the full list). For each month, the denominator is 106. For the annual total, it is 106 × 12 = 1,272.
This is the percentage of tracer medicines that were out of stock. It is calculated by dividing the numerator by the denominator and multiplying by 100. Lower percentages are better.
Example: If 10 medicines are out of stock in May‑26, the rate = (10 / 106) × 100 = 9.43%.
The system groups months into four quarters to match the reporting structure:
For each quarter, the numerator is the sum of the three monthly numerators.
The denominator is 3 × 106 = 318.
The quarterly rate is then calculated as (Quarterly Numerator / 318) × 100.
The Annual Performance row uses the total annual numerator and the annual denominator (1,272) to give the overall stock‑out rate for the entire financial year.
You can export the current view (including all filters and metrics) in three formats using the Export dropdown.
trace_advice.php)The Redistribution Advice page helps you balance stock between facilities. It compares current stock levels (On_Hand) across facilities for each tracer medicine.
The system then suggests transfers from surplus facilities to deficit facilities. The suggested quantity is the smaller of the surplus amount and the deficit amount, so that no facility loses essential supply.
You can apply the same filters (Facility, District, NSN, Medicine) to focus the advice on a specific area or product. The output table shows:
| Issue | Solution |
|---|---|
| “No data” for all medicines | Check that the database connection is working. Ensure that the pdr_table and audit_pdr_table have data for the selected period. |
| Filters do not seem to work | Make sure you click Apply Filters after typing. The filters are case‑insensitive but require an exact match for District. |
| Export takes too long or times out | Large datasets (all facilities, all months) may take a few seconds. To speed up, apply a filter (e.g., a specific month) before exporting. |
| Chart does not appear | Chart.js is loaded from a CDN. Check your internet connection. If offline, download the library and host it locally. |
| Medicine names are mismatched | The system uses keyword matching. If a description is very generic, it might be misassigned. Contact the system administrator to adjust the keyword list. |
| I see “Out of Stock” but I know we had stock | Data is sourced from submitted reports. Verify the source data or ask the data clerk to correct the entry. |