Smart Follow-up Assistant is a Django-based follow-up management system for clinical research and longitudinal outpatient tracking. It supports patient master records, repeated treatment episodes, structured follow-up visits, role-based permissions, CSV export, and an optional AI side panel for patient-specific follow-up assistance.
This repository is the open-source package. It does not ship with private deployment materials, local databases, personal contact information, or production API keys.
- Patient master records with auto-generated patient IDs
- Multiple treatment episodes for the same patient
- Multiple follow-up records under each treatment episode
- Planned next follow-up date with manual override
- Card and table views with filtering, sorting, and pagination
- Aggregated data export:
- patient basics CSV
- treatment records CSV
- follow-up records CSV
- Role-based access:
rootadminnormal
- Time-window-based edit/delete restrictions for non-root users
- Optional AI assistant drawer on the patient detail page
- Python 3.11+
- Django 5.2
- SQLite by default
- Gunicorn + Nginx for Linux deployment
config/: Django project settings and URLsfollowup/: core business logic, models, forms, permissions, viewstemplates/: Django templatesstatic/: CSS assetsdeploy_aliyun.sh: one-command Linux deployment script
- Create and activate a virtual environment.
- Install dependencies.
- Copy
.env.exampleto.env.localand fill in the values you need. - Run migrations.
- Start the development server.
python -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env.local
python manage.py migrate
python manage.py runserverDefault local URL:
http://127.0.0.1:8000/
Key settings are loaded from .env.local and .env.server.
FOLLOWUP_APP_NAMEFOLLOWUP_APP_SUBTITLEFOLLOWUP_APP_COPYRIGHTFOLLOWUP_APP_NOTICEFOLLOWUP_SUPPORT_EMAILFOLLOWUP_DEBUGDJANGO_SECRET_KEYFOLLOWUP_DB_PATHFOLLOWUP_ALLOWED_HOSTSFOLLOWUP_CSRF_TRUSTED_ORIGINSAI_PROVIDERAI_API_KEYAI_MODELAI_BASE_URLAI_USE_ENV_PROXY
This project does not hardcode a public default root password.
To create or reset the root account manually:
python manage.py ensure_root_account --username root --password "YourStrongPasswordHere"If you run the Linux deployment script without FOLLOWUP_ROOT_PASSWORD, it generates a random root password and prints it once during deployment.
The optional AI drawer supports text-only models. The current repository is compatible with:
- Aliyun DashScope OpenAI-compatible chat endpoints
- Zhipu Open Platform compatible chat endpoints
By default, the AI patient context excludes direct identifiers such as patient name, phone number, and address.
The repository includes deploy_aliyun.sh for Ubuntu/Debian servers.
bash deploy_aliyun.shThe script will:
- install system dependencies
- create a virtual environment
- install Python requirements
- prepare
.env.server - run migrations
- collect static files
- ensure a root account exists
- configure Gunicorn
- configure Nginx
After deployment, the app is served through Nginx on port 80.
Run checks and tests with:
python manage.py check
python manage.py test followup.tests- No production API key is included in this repository.
- No personal contact email is included by default.
- No deployment database is included.
- Generated release documents and filing materials are intentionally excluded from version control.
Released under the MIT License.