FIXES:
- Removed duplicate Encounter model from core/database (kept FHIR-compliant version in clinica)
- Fixed MockSpanContext to include span_id, trace_id, trace_flags attributes
- Fixed MockSpan to include end() method
- Fixed Mock Status class to accept optional parameters
- Fixed StandardResponseMiddleware to skip HTML/CSS/JS responses
- Fixed TenantIsolationMiddleware to skip UI routes (/, /ui/, /assets/, /static/)
- Fixed AuditMiddleware to exclude UI and static asset routes
- Fixed datetime serialization in audit_middleware query params
ENHANCEMENTS:
- Added SOTA middleware stack (observability, security, performance)
- Improved middleware layering with proper UI route exclusions
- Better error handling and graceful degradation when OpenTelemetry not available
VALIDATION:
- UI now loads successfully at / (200 OK)
- HTML templates render correctly
- All 17 healthcare apps accessible
- Health endpoint working
- API endpoints functional
FILES MODIFIED:
- src/core/database/__init…