6.0 KiB
Development Environment Setup - Complete! ✅
Setup Summary
The development environment has been successfully created with the following components:
📊 Database Objects Created
| Component | Count |
|---|---|
| Organizations | 2 |
| Hospitals | 6 |
| Departments | 78 |
| Roles | 9 |
| PX Sources | 13 |
| Survey Templates | 22 |
| Survey Questions | 117 |
| Journey Templates | 15 |
| Journey Stages | 37 |
| Observation Categories | 15 |
| Notification Templates | 10 |
| Standard Sources | 4 |
| Standard Categories | 8 |
🏥 Hospitals Created
-
NUZHA-DEV - Al Hammadi Hospital - Nuzha (Development)
- 8 departments (ED, OPD, IP, ICU, Pharmacy, Lab, Radiology, Admin)
- 4 survey templates (Inpatient, OPD, EMS, Day Case)
- Journey templates for all patient types
- SLA configs, escalation rules, thresholds
-
OLAYA-DEV - Al Hammadi Hospital - Olaya (Development)
- Same configuration as NUZHA-DEV
-
SUWAIDI-DEV - Al Hammadi Hospital - Suwaidi (Development)
- Same configuration as NUZHA-DEV
📝 Survey Templates
4 Template Types per hospital:
-
Inpatient Post-Discharge Survey
- 7 questions (nursing, doctor, cleanliness, food, information, NPS, comments)
-
OPD Patient Experience Survey
- 6 questions (registration, waiting, consultation, pharmacy, NPS, comments)
-
EMS Emergency Services Survey
- 6 questions (response time, paramedic, ED care, communication, NPS, comments)
-
Day Case Patient Survey
- 6 questions (pre-procedure, procedure, post-procedure, discharge, NPS, comments)
🔄 Journey Templates
OPD Journey Stages (with HIS integration):
- Registration (trigger: REGISTRATION)
- Waiting (trigger: WAITING)
- MD Consultation (trigger: Consultation)
- MD Visit (trigger: Doctor Visited)
- Clinical Assessment (trigger: Clinical Condtion)
- Patient Assessment (trigger: ChiefComplaint)
- Pharmacy (trigger: Prescribed Drugs)
- Discharge (trigger: DISCHARGED)
Other Journey Types:
- Inpatient Journey
- EMS Journey
- Day Case Journey
🎭 Roles & Permissions
| Role | Level | Description |
|---|---|---|
| PX Admin | 100 | Full system access |
| Hospital Admin | 80 | Hospital-level access |
| Department Manager | 60 | Department-level access |
| PX Coordinator | 50 | PX actions & complaints |
| Physician | 40 | View feedback |
| Nurse | 30 | View department feedback |
| Staff | 20 | Basic access |
| Viewer | 10 | Read-only |
| PX Source User | 5 | External sources |
📬 PX Sources
Internal Sources:
- Patient
- Family Member
- Staff
- Survey
Government Sources:
- Ministry of Health (MOH)
- Council of Cooperative Health Insurance (CCHI)
⚙️ SLA Configurations
| Source | SLA | 1st Reminder | 2nd Reminder | Escalation |
|---|---|---|---|---|
| MOH | 24h | 12h | 18h | 24h |
| CCHI | 48h | 24h | 36h | 48h |
| Internal | 72h | 24h | 48h | 72h |
🔔 Escalation Rules
- Default: Department Manager (immediate on overdue)
- Critical: Hospital Admin (4h overdue)
- Final: PX Admin (24h overdue)
👁️ Observation Categories
15 categories including:
- Patient Safety
- Clinical Quality
- Infection Control
- Medication Safety
- Equipment & Devices
- Facility & Environment
- Staff Behavior
- Communication
- Documentation
- Process & Workflow
- Security
- IT & Systems
- Housekeeping
- Food Services
- Other
📨 Notification Templates
10 templates for:
- Onboarding (Invitation, Reminder, Completion)
- Surveys (Invitation, Reminder)
- Complaints (Acknowledgment, Update)
- Actions (Assignment)
- SLA (Reminder, Breach)
✅ Standards Setup
Standard Sources:
- CBAHI (Saudi Central Board for Accreditation)
- JCI (Joint Commission International)
- ISO (International Organization for Standardization)
- SFDA (Saudi Food & Drug Authority)
Standard Categories:
- Patient Safety
- Quality Management
- Infection Control
- Medication Safety
- Environment of Care
- Leadership
- Information Management
- Facility Management
🔌 HIS Integration
API Configuration:
- URL:
https://his.alhammadi.med.sa:54380/SSRCE/API/FetchPatientVisitTimeStamps - Auth: Basic (username/password from .env)
- Schedule: Every 5 minutes (Celery Beat)
Event Mappings:
- Consultation → OPD_CONSULTATION
- Doctor Visited → OPD_DOCTOR_VISITED
- Clinical Condtion → CLINICAL_ASSESSMENT
- ChiefComplaint → PATIENT_ASSESSMENT
- Prescribed Drugs → PHARMACY
- DISCHARGED → PATIENT_DISCHARGED
🚀 Next Steps
1. Create Admin Users
python manage.py createsuperuser
2. Start Services
# Start Redis
redis-server
# Start Celery Worker
celery -A config worker -l info
# Start Celery Beat
celery -A config beat -l info
# Start Django Server
python manage.py runserver
3. Verify Setup
Visit http://localhost:8000 and login with your superuser account.
4. Load SHCT Taxonomy (Optional)
python manage.py load_shct_taxonomy
5. Import Staff Data (Optional)
python manage.py import_staff_csv path/to/staff.csv
📚 Documentation
See /docs/SETUP_GUIDE.md for complete documentation.
🔧 Useful Commands
# Preview changes
python manage.py setup_dev_environment --dry-run
# Setup specific hospital
python manage.py setup_dev_environment --hospital-code NUZHA-DEV
# Skip specific components
python manage.py setup_dev_environment --skip-surveys --skip-integration
# Reset and recreate (delete database first)
rm db.sqlite3
python manage.py migrate
python manage.py setup_dev_environment
✨ Features Ready to Use
- ✅ Multi-hospital structure
- ✅ Role-based access control
- ✅ Survey system with 4 template types
- ✅ HIS integration with 5-minute polling
- ✅ Patient journey tracking
- ✅ Complaint management with SLA
- ✅ Observation system
- ✅ Notification system
- ✅ Standards compliance tracking
- ✅ Escalation workflows
Environment is ready for development! 🎉