Task #107
Updated by Varsha N 16 days ago
Patient Medical History Report (Admin Module) Module – Phase 2) Task Objective: Implement a Patient Medical History Report in the Admin module that allows the admin to search a patient by Patient ID or Mobile Number and view the patient’s complete medical history, including diagnosis, investigations, and prescriptions, across visits. The report must support multiple time-based filters such as Today, Monthly, Yearly, custom date range, Doctor. ⚠️ No new database tables or columns should be added. All data must be retrieved from existing consultation-related tables. Navigation: Admin Login → Reports → Patient Medical History Search Options: Patient ID Mobile Number Filters: Today Monthly Yearly From Date – To Date (custom range) Doctor Report Details: Patient Information (Header Section) Patient ID Patient Name Age / Gender Mobile Number Consultation History (Visit-wise) For each visit, display: Visit Date Doctor Name Chief Complaints Diagnosis Details -List of diagnoses recorded for the visit Investigation Details -List of investigations ordered for the visit Prescription Details For each visit: -Medicine Name -Dosage -Duration -Food Relation -Follow Instruction Features to Implement: Search patient by Patient ID or Mobile Number Load patient details on successful search Apply selected time filter (Today / Monthly / Yearly / Date range / Doctor) Display visit-wise medical history Fetch and display diagnosis, investigations, and prescriptions per visit Order visits by date (latest first) Apply hospital-level filtering using hospital_id Handle patients with multiple visits Read-only report view (PDF) Pagination for long medical history Excel Download Provide “Download Excel” button Excel should include: Patient details Visit-wise diagnosis, investigation, and prescription data Applied filter information Excel generation must be done server-side File name example: Patient_Medical_History_<PatientID>.xlsx Validations & Rules Either Patient ID or Mobile Number is mandatory 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 shown Disable search and download buttons during API calls Backend Requirements: Fetch patient using Patient ID or Mobile Number + hospital_id Apply date filters on visit date or consultation date Join consultation-related tables using visit_id / consultation_id Do not store report results in database Completion Criteria: Patient search works correctly with ID or mobile number Time-based filters (Today / Monthly / Yearly / Date range) work correctly Medical history loads accurately and visit-wise Excel download matches on-screen data No new tables or columns added Hospital-level data isolation enforced