- Remove Nachname/Vorname columns from ICD coding template (DSGVO)
- Restrict /cases/coding-template endpoint to admin-only
- ICD import reads last column for backwards compatibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When a KVNR is entered on a case that has a random-suffix or legacy
Nachname-based fall_id, the fall_id is automatically rebuilt using
the new KVNR.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replaces Nachname-based fall_ids with KVNR or random 6-char suffix
for all existing cases in the database.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CaseResponse.nachname was required (str) but the masking function sets
it to None for dak_mitarbeiter. This caused Pydantic validation errors
(500) making the case list empty for non-admin users.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add VERSICHERUNG_FILTER="DAK" to config and apply it to all case
queries: list, detail, pending-icd, pending-coding, coding queue,
dashboard KPIs, all 5 report sheets, and excel sync export.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 4 new nullable profile fields to support the upcoming account
management (Kontoverwaltung) feature. Includes Alembic migration
that has been applied to production database.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
German Excel/CRM exports often use semicolons instead of commas.
The parser now uses csv.Sniffer to auto-detect the delimiter,
fixing the issue where semicolon-delimited CSVs produced 0 rows.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The field was editable in the frontend but missing from the backend
CaseUpdate Pydantic schema, causing changes to be silently dropped.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
get_vorjahr_summary returned a flat dict, but excel_export looked for
data under vj.get("summary", {}), resulting in empty Vorjahr columns.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When generating a report for the same jahr/kw, update the existing
record instead of inserting a duplicate (which caused IntegrityError).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
report_service uses 'summary'/'weekly'/'keine_rm'/'gutachten' but
excel_export expected 'totals'/'weeks'/'keine_rueckmeldung'/
'gutachten_gesamt'. Also fix nested gesamt dict access in sheet3
and icd_codes path from sheet5.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Browser-initiated downloads (window.open) cannot set Authorization
headers. Accept ?token= query parameter as fallback on the report
download and coding-template endpoints.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
.cast(int) uses Python's builtin int, which lacks SQLAlchemy's
_isnull attribute. Replace all occurrences with .cast(Integer).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Prevents a single duplicate fall_id from rolling back the entire
import session. Each row insert now uses db.begin_nested() so
constraint violations are isolated to the offending row.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add coding_service.py with queue retrieval, single + batch coding updates
- Add report schemas (DashboardKPIs, WeeklyDataPoint, ReportMeta)
- Add coding API router with /queue, PUT /{case_id}, POST /batch endpoints
- Add reports API router with /dashboard, /weekly, /generate, /download, /list
- Add excel_sync.py for bidirectional Abrechnung DB<->XLSX sync
- Register coding and reports routers in main.py
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add service and standalone script to import all cases from the master
Excel workbook into the database. Handles 5 year-sheets (2020-2022,
2023, 2024, 2025, 2026) with dynamic column mapping, fallgruppe
normalization, boolean/date parsing, phone number formatting, and
duplicate detection. Supports dry-run mode and per-sheet import.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Initialize Alembic with MySQL/MariaDB-targeted configuration
- Configure env.py to read DB URL from app.config.get_settings()
- Create initial migration (062ccae5457b) for all 11 tables:
users, refresh_tokens, invitation_links, allowed_domains,
cases, case_icd_codes, weekly_reports, yearly_summary,
import_log, audit_log, notifications
- Include all indexes, foreign keys, check constraints, and
MySQL text prefix index (icd(20))
- Add seed script (scripts/init_db.py) for dak.de domain whitelist
- DB apply deferred: MariaDB on Hetzner 1 not reachable from dev
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Initialize project structure with backend/app/ package layout
- Add FastAPI app with CORS middleware and health check endpoint
- Add Pydantic Settings config with DB, JWT, SMTP, and app settings
- Add SQLAlchemy database engine and session management
- Add requirements.txt with all dependencies (FastAPI, SQLAlchemy, Alembic, etc.)
- Add .env.example template and .gitignore
- Add empty frontend/ and backend test scaffolding
- Include project specification and design/implementation plans
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>