# Cancer Patient Management System

A comprehensive oncology care platform with 8 real cancer patient cases, full medication protocols, role-based access control, clinical alerting, and automated testing.

## Quick Start

```bash
cd CancerPatientSystem
python api_server.py
```

Opens http://127.0.0.1:8080 in your browser automatically.

## Login Credentials

| Role | Username | Password |
|------|----------|----------|
| Admin | admin | admin123 |
| Doctor | dr.martin | doctor123 |
| Doctor | dr.dupont | doctor123 |
| Doctor | dr.bernard | doctor123 |
| Doctor | dr.lefevre | doctor123 |
| Nurse | inf.moret | nurse123 |
| Nurse | inf.petit | nurse123 |
| Nurse | inf.roux | nurse123 |
| Nurse | inf.garcia | nurse123 |
| Patient | patient.durand | patient123 |
| Patient | patient.moreau | patient123 |
| Patient | patient.laurent | patient123 |
| Patient | patient.simon | patient123 |
| Patient | patient.robert | patient123 |
| Patient | patient.blanc | patient123 |
| Patient | patient.guerin | patient123 |
| Patient | patient.fournier | patient123 |

## What's Inside

### 8 Cancer Patient Cases
1. **Marie Durand** - Stage IIB Breast Cancer (HER2+) → TCHP protocol
2. **Jean Moreau** - Stage IIIA Lung Cancer (NSCLC) → Concurrent chemoradiation + durvalumab
3. **Pierre Laurent** - Stage IIIC Colorectal Cancer → FOLFOX + bevacizumab
4. **Isabelle Simon** - Stage IV Prostate Cancer (mCRPC) → Cabazitaxel
5. **Francois Robert** - Acute Myeloid Leukemia → 7+3 induction
6. **Catherine Blanc** - Stage IIB Hodgkin Lymphoma → ABVD
7. **Nicolas Guerin** - Stage IIIB Pancreatic Cancer → mFOLFIRINOX
8. **Helene Fournier** - Stage IV Ovarian Cancer → Cisplatin/Paclitaxel + Olaparib

### 36 Medications with Full Clinical Detail
Each medication includes: drug class, dosage, route, frequency, indication, side effects, contraindications, monitoring requirements, and clinical notes.

### System Features
- **Role-based access** - Admin sees all; doctors/nurses see assigned patients; patients see own records
- **Clinical alerts** - Critical, high, medium, low severity with auto-trigger conditions
- **Vital signs tracking** - Temperature, HR, BP, SpO2, pain scores over time
- **Lab results** - Molecular markers, tumor markers, blood work with abnormal flags
- **Symptom reports** - Patient-reported symptoms with severity scoring
- **Treatment cycles** - Chemotherapy cycle tracking with toxicity grading
- **Nurse-patient assignments** - Staff alignment to patients by shift
- **Audit log** - Full system activity tracking
- **20 automated tests** - Built-in test runner verifies all components

### Technology
- Python standard library only (zero dependencies)
- SQLite with WAL mode
- Single-page HTML/CSS/JS frontend
- Token-based authentication

## Files

```
CancerPatientSystem/
  api_server.py        - HTTP API server (17 endpoints)
  database.py          - SQLite schema and utilities
  seed_data.py         - Demo data seeding script
  cancer_patients.db   - SQLite database (auto-created)
  static/
    index.html         - Full UI application
  docs/
    SYSTEM_ARCHITECTURE.md  - Architecture documentation
    README.md               - This file
```
