A comprehensive healthcare management solution consisting of a PHP backend API and a Flutter mobile application. This system enables healthcare providers to manage patient records, appointments, prescriptions, lab results, and consultations efficiently.
- Overview
- Features
- Technology Stack
- Project Structure
- Backend Setup
- Mobile App Setup
- Database Schema
- API Endpoints
- User Roles
- Screenshots
The National Medical Record Management System is a system designed to digitize and Patient medical records. It provides role-based access for patients, doctors, nurses and administrators, ensuring secure and efficient management of medical data.
- View personal medical records and history
- View prescriptions and lab results
- Request re-access to restricted accounts
- View scheduled and past appointments and their status
- View patients and their medical records
- Manage appointments (create, modify, delete, confirm, complete, cancel, mark as missed)
- Create consultations with diagnoses and notes
- Prescribe medications
- Upload lab results
-Manage all patients (add, edit, delete)
- Manage staff accounts (doctors, admins)
- Process re-access requests
- View system activity logs
- Comprehensive activity logging
- Secure authentication with role-based access control
- File upload support for lab results
eliminates duplicated records across different hospitals. Allows real-time updates of diagnoses, treatments, prescriptions, and lab results.
-Logic: The system automatically tracks patient attendance. -Trigger: If a patient misses three (3) consecutive scheduled appointments. -Action: The system automatically flags the patient and restricts access to their account. -Resolution: The patient must submit a "Re-access Request" via the app, which the System Administrator must review and approve/reject.
The project follows a client-server architecture
Server: Apache (via XAMPP) Language: PHP 8 (pure php not laravel) Role: Handles HTTP requests, executes business logic, and manages database interactions.
System: MySQL / MariaDB Management Tool: phpMyAdmin Security: Passwords are hashed; critical medical data is encrypted.
- Dart
- Flutter (dart framework to make interfaces based on widgets system)
- HTTP package for API communication
- Google Fonts for typography
- intl: for date/time formatting
- Shared Preferences for local session management
medical-app/
├── backend/
│ ├── db_connect.php # Database connection configuration
│ ├── login.php # Authentication endpoint
│ ├── appointments_crud.php # Appointment operations
│ ├── consultations_crud.php # Consultation operations
│ ├── prescriptions_crud.php # Prescription operations
│ ├── lab_results_crud.php # Lab results operations
│ ├── reaccess_crud.php # Re-access request operations
│ ├── logs_crud.php # System logging operations
│ ├── add_patient.php # Add new patient
│ ├── update_patient.php # Update patient information
│ ├── delete_patient.php # Delete patient
│ ├── get_patients.php # Retrieve patients list
│ ├── get_patients_for_doctor.php # Get doctor's assigned patients
│ ├── get_patient_appointments.php# Get patient's appointments
│ ├── get_patient_full_records.php# Get complete patient records
│ ├── add_staff.php # Add new staff member
│ ├── update_staff.php # Update staff information
│ ├── delete_user.php # Delete user account
│ ├── get_staff.php # Retrieve staff list
│ ├── get_metadata.php # Get system statistics
│ ├── upload_lab_file.php # File upload handler
│ ├── uploads/ # Uploaded files directory
│ └── medical_record_system.sql # Database schema
│
└── mobile/
├── lib/
│ ├── main.dart # Application entry point
│ ├── api_service.dart # API communication layer
│ ├── app_theme.dart # Application theming
│ ├── login_screen.dart # Authentication screen
│ ├── home_screens.dart # Role-based home dashboards
│ ├── doctor_appointments_screen.dart # Doctor appointment management
│ ├── doctor_patients_screen.dart # Doctor's patient list
│ ├── patient_appointments_screen.dart# Patient appointment view
│ ├── patient_medical_records_screen.dart # Patient records view
│ ├── patient_detail_screen.dart # Detailed patient view
│ ├── manage_patients_screen.dart # Admin patient management
│ ├── manage_staff_screen.dart # Admin staff management
│ ├── manage_reaccess_screen.dart # Re-access request management
│ ├── request_reaccess_screen.dart # Re-access request form
│ └── system_logs_screen.dart # System activity logs
├── android/
│ └── app/src/main/AndroidManifest.xml
└── pubspec.yaml # Flutter dependencies
- XAMPP (or similar PHP development environment like WAMP/MAMP)
- MySQL / MariaDB
- Flutter SDK installed and configured
- Android Studio to run as a native android application
1-Locate the backend folder in the project. 2-Move the folder to your server's root directory (e.g., C:\xampp\htdocs\medical_system). 3-Start Apache and MySQL in the XAMPP Control Panel. 4-Open http://localhost/phpmyadmin. 5-Create a new database named medical_record_system. 6-Import the medical_record_system.sql file provided in the backend folder. Optional: Configure your IP address in db_connect.php if testing on a physical device.
1-Open the mobile_app folder in your IDE. 2-Open lib/api/api_service.dart. 3-Change the baseUrl variable to match your local server IP:
// For Emulator
static const String baseUrl = 'http://10.0.2.2/medical_system';
// For Physical Device
static const String baseUrl = 'http://YOUR_PC_IP_ADDRESS/medical_system';4-Run the dependencies command:
flutter pub get5-Launch the app:
flutter runThe system uses the following main tables:
| Table | Description |
|---|---|
users |
User accounts (patients, doctors, admins) |
patients |
Patient-specific information |
appointments |
appointments |
consultations |
Medical consultations |
prescriptions |
Medication prescriptions |
lab_results |
Laboratory test results |
reaccess_requests |
Account re-access requests |
system_logs |
Activity audit trail |
| Method | Endpoint | Description |
|---|---|---|
| POST | /login.php |
User authentication |
| Method | Endpoint | Description |
|---|---|---|
| GET | /get_patients.php |
List all patients |
| POST | /add_patient.php |
Create new patient |
| POST | /update_patient.php |
Update patient |
| POST | /delete_patient.php |
Delete patient |
| Method | Endpoint | Description |
|---|---|---|
| POST | /appointments_crud.php |
CRUD operations |
| Method | Endpoint | Description |
|---|---|---|
| POST | /consultations_crud.php |
CRUD operations |
| Method | Endpoint | Description |
|---|---|---|
| GET | /get_staff.php |
List all staff |
| POST | /add_staff.php |
Create staff account |
| POST | /update_staff.php |
Update staff |
| POST | /delete_user.php |
Delete user |
| Role | Access Level |
|---|---|
| Patient | View own records, view past and scheduled appointments, request re-access |
| Doctor | Manage patients, appointments, consultations |
| Nurse | Manage patients |
| Admin | manage doctors and nurses, treat re access requests, view system logs |
IMPORTANT NOTE: replace androidManifest.xml with the one provided so the app workds correctly (change to support file upload in emulator), and replace pubspec.yaml with the one provided so you can install all dependencies with flutter pub get
![Uploading Screenshot 2026-01-26 234117.png…]()
![Upload
ing Screenshot 2026-01-27 000648.png…]()
in pages