Task #77
openPrescription_wise Report (Admin)
0%
Description
Prescription-wise Report :(Admin)
Task Objective:
Implement a Prescription-wise Report in the Admin module to display the usage frequency of medicines prescribed by doctors during consultations over a selected time period.
This report helps the admin understand medicine usage patterns and prescribing trends within the hospital.
! No new database tables or columns should be added.
All data must be derived from existing consultation and prescription records.
Navigation:
Admin Login → Reports → Prescription Report
Fields to Display:
Serial Number
Medicine Name
Strength (if available)
Total Prescribed Count
Summary Section:
Total unique medicines prescribed
Total prescription count
Filters:
Today
Monthly
Yearly
From Date – To Date (custom range)
Data Source:
consultations
consultation_prescriptions
prescription_master
Features to Implement:
Load prescription data based on selected date filter
Group consultation data by medicine
Display medicine-wise prescription count
Apply hospital-level filtering using hospital_id
Display report in tabular format with serial numbers
Display summary totals below the table
Pagination for large datasets
Read-only report view
Excel Download
Provide “Download Excel” button
Export the same prescription data shown on screen
Search bar to search medicine
Include:
Report title
Selected date range
Medicine name and prescription count
Generate Excel file server-side
File name example:
Prescription_Report_YYYYMMDD.xlsx
Validations & Rules:
From Date must not be greater than To Date
Date range is mandatory for custom filter
Admin can access only their hospital’s data
Only completed consultations should be included
Disable report generation during API call
Backend Requirements:
Use created_at from consultations for date filtering
Use SQL aggregation:
COUNT()
GROUP BY medicine_id
Do not store report results in database
Completion Criteria:
Prescription counts are accurate for all date filters
Pagination works correctly
Excel download matches report data
No new tables or columns added
Hospital-level data isolation enforced
Search bar should get correct results.