Getting Started
This guide will walk you through installing and configuring the Healthcare Management System.
Prerequisites
Before beginning installation, ensure you have:
- Python 3.12 or higher - Download Python
- Git (optional) - For cloning the repository
- Ollama (optional) - For offline AI features
Installation Steps
Step 1: Obtain the Source Code
Option A: Clone with Git
git clone https://github.com/mabdulre9/healthcare-system.git
cd healthcare-system
Option B: Download ZIP
- Visit the GitHub repository
- Click “Code” → “Download ZIP”
- Extract the archive
- Navigate to the extracted directory
Step 2: Create Virtual Environment
Create an isolated Python environment for the application:
Windows:
python -m venv venv
venv\Scripts\activate
Linux/macOS:
python3 -m venv venv
source venv/bin/activate
You should see (venv) prefix in your terminal.
Step 3: Install Dependencies
Install required Python packages:
pip install -r requirements.txt
This installs:
- Flask 3.0.0 - Web framework
- python-docx 1.1.0 - Document generation
- requests 2.31.0 - HTTP library
- ollama - AI integration
Step 4: Run the Application
Start the development server:
python app.py
Expected output:
* Running on http://127.0.0.1:5000
* Press CTRL+C to quit
Step 5: Access the Application
Open your web browser and navigate to:
http://localhost:5000
You should see the dashboard with two sample patients pre-loaded.
Ollama AI Setup
To enable the offline AI assistant, install and configure Ollama.
Install Ollama
Visit https://ollama.com/download
Windows:
- Download
OllamaSetup.exe - Run the installer
- Ollama starts automatically
macOS:
- Download the DMG file
- Drag Ollama to Applications
- Launch Ollama
Linux:
curl -fsSL https://ollama.com/install.sh | sh
Verify Installation:
ollama --version
Download AI Model
Select and download an AI model:
Recommended (Balanced):
ollama pull qwen2.5:4b
Fast (Low Resource):
ollama pull qwen3:0.6b
High Quality:
ollama pull llama3.2:3b
Verify Download:
ollama list
Configure AI in Application
- Navigate to
http://localhost:5000/settings - Enter the model name (e.g.,
qwen2.5:4b) - Click TEST MODEL to verify connection
- Click SAVE SETTINGS
The AI Assistant is now ready for use.
First Steps
Explore Sample Data
The system includes two sample patients:
- Jane Doe - Diabetic patient with visit history
- Robert Johnson - Hypertensive patient
Click on either patient to explore:
- Patient overview and demographics
- Medical history
- Visit records
- Vital signs
- Lab results
- Immunizations
Register a New Patient
- Click REGISTER NEW PATIENT on the dashboard
- Complete required fields:
- Full Name
- Date of Birth
- Gender
- Optionally add:
- Contact information
- Medical conditions
- Current medications
- Known allergies
- Click SAVE PATIENT RECORD
Record a Visit
- Select a patient from the dashboard
- Click NEW VISIT
- Enter visit information:
- Visit date (defaults to today)
- Visit type (Consultation, Follow-up, Emergency)
- Chief complaint
- Assessment and plan
- Optionally record vital signs
- Click SAVE VISIT RECORD
Use AI Assistant
- From a patient record, click AI ASSISTANT
- Wait for patient context to load
- Enter a clinical question
- Click ASK AI ASSISTANT or press Enter
- View the streaming response
Configuration
Clinic Information
Edit clinic details in app.py (lines 18-22):
CLINIC_NAME = 'Your Clinic Name'
CLINIC_ADDRESS = '123 Medical Center Dr'
CLINIC_PHONE = '(555) 123-4567'
CLINIC_EMAIL = 'contact@clinic.com'
These details appear on generated medical reports.
Change Application Port
If port 5000 is in use, modify app.py (last line):
if __name__ == '__main__':
app.run(debug=True, port=5001) # Change port
Troubleshooting
Port Already in Use
Error: “Address already in use”
Solution: Change the port in app.py as described above.
Module Not Found
Error: ModuleNotFoundError: No module named 'flask'
Solution: Ensure virtual environment is activated and run:
pip install -r requirements.txt
Ollama Connection Failed
Error: Cannot connect to Ollama
Solution:
- Verify Ollama is running:
ollama list - Ensure model is downloaded:
ollama pull qwen2.5:4b - Test model in Settings page
- Restart Ollama service if necessary
Python Version Error
Error: Python version too old
Solution: Install Python 3.12+ from python.org
Next Steps
- User Guide - Learn core features
- Patient Management - Manage patient records
- AI Assistant - Use AI clinical support
- Configuration - Advanced settings