Commit graph

131 commits

Author SHA1 Message Date
5920986c02 refactor: migrate AdminUsersPage to TanStack Query
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 18:27:17 +00:00
1b4aebfb8d refactor: migrate AdminAuditPage to TanStack Query
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 18:25:32 +00:00
1de2f7274d refactor: migrate DisclosuresPage to TanStack Query
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 18:23:46 +00:00
4b4af6b42d refactor: migrate DashboardPage to TanStack Query
Replace manual useState/useEffect data fetching with useDashboard hook
that uses TanStack Query for automatic caching, refetching, and loading
state management.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 18:21:33 +00:00
28ad5c09ad feat: add TanStack Query with QueryClientProvider
Install @tanstack/react-query v5 and wrap the app with
QueryClientProvider as foundation for server-state management.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 18:18:37 +00:00
62ee46fa3e docs: add state management implementation plan (9 tasks, TanStack Query)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 18:16:20 +00:00
d4420500e5 docs: add state management refactoring design (TanStack Query)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 18:11:55 +00:00
99767fe6fe fix: replace favicon with updated version
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 17:56:23 +00:00
773d5c6e7a feat: add custom favicon for DAK Zweitmeinungs-Portal
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 17:52:19 +00:00
56c0c6e662 fix: remove patient names from coding template and restrict to admin
- 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>
2026-02-26 17:20:28 +00:00
90c121d58d fix: correct down_revision in 006 migration to match 005_disclosure
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 17:13:22 +00:00
c302a91411 feat: auto-update fall_id when KVNR is entered on a case
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>
2026-02-26 17:09:50 +00:00
7bbe501bfa feat: add migration to anonymize existing fall_ids
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>
2026-02-26 17:07:58 +00:00
04a2e8fe93 test: verify duplicate detection works with new fall_id format
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 17:06:58 +00:00
a436580b03 feat: use KVNR instead of Nachname in fall_id generation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 17:04:48 +00:00
d33fc7d242 docs: add implementation plan for fall-id anonymization
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 17:01:09 +00:00
50e93b811d docs: add Fall-ID anonymization design
Replace patient last name in fall_id with KVNR (or random fallback).
Retroactive migration of all existing ~2900 fall_ids.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 16:57:23 +00:00
1612d449c0 fix: make nachname nullable in CaseResponse to support data masking
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>
2026-02-26 16:24:56 +00:00
31a2d5a355 feat: add disclosure admin route and sidebar entry
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 16:14:14 +00:00
810a13b2d8 feat: add admin disclosures page for reviewing data access requests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 16:13:13 +00:00
62a56f3fc9 feat: add disclosure request UI and field visibility for dak_mitarbeiter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 16:11:47 +00:00
f2219b487b feat: hide personal data columns for dak_mitarbeiter in case list
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 16:09:43 +00:00
3e9448ab33 feat: add disclosure types and service functions
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 16:08:38 +00:00
9825489781 feat: add case masking for dak_mitarbeiter and disclosure endpoints
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 16:07:30 +00:00
00076e2c00 feat: add disclosure service with create, review, and check logic
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 16:04:54 +00:00
3496e4acfe feat: add disclosure schemas and case response masking helper
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 16:03:58 +00:00
bb13ec80a2 feat: add DisclosureRequest model and migration
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 16:02:52 +00:00
00bc92322f docs: add DAK-Datenschutz implementation plan (11 tasks)
Backend-enforced field masking for dak_mitarbeiter, disclosure request
workflow with 24h expiry, admin approval page, and frontend adaptations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 15:59:29 +00:00
030fab72e4 docs: add DAK-Datenschutz design for role-based data masking
Design for hiding personal data (name, birthdate) from dak_mitarbeiter
users with backend-enforced filtering and a time-limited disclosure
request mechanism for KVNR error resolution.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 15:56:48 +00:00
480f851836 fix: dashboard weekly chart shows correct stacked breakdown
Change stacked bar chart from erstberatungen+unterlagen+gutachten
(overlapping, incorrect) to ablehnungen+keine_rm+gutachten (disjoint
categories that sum to total cases per KW, matching Excel Sheet 1).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 11:12:30 +00:00
32127c30c3 fix: filter all case queries to DAK insurance only
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>
2026-02-26 10:20:33 +00:00
e0b2d1e01d docs: add Kontoverwaltung design and implementation plan
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 10:12:13 +00:00
5f7b4c6e1d feat: add /account route, sidebar entry and header link
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 09:48:43 +00:00
45cadd07ce feat: add AccountPage with Profile, Security, and MFA tabs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 09:46:52 +00:00
832f5c0a63 feat: add profile/avatar/MFA types and service functions
Extend User and UserResponse interfaces with first_name, last_name,
display_name, avatar_url fields. Add ProfileUpdatePayload,
ChangePasswordPayload, MFASetupResponse, MFAVerifyPayload types.
Add authService functions for profile update, avatar upload/delete,
password change, and MFA setup/verify/disable. Add refreshUser to
AuthContext so components can re-fetch user data after changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 09:42:46 +00:00
fc609401c3 feat: add MFA disable (self-service + admin reset) endpoints
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 09:40:57 +00:00
661f1ce552 feat: add avatar upload/delete endpoints with static file serving
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 09:39:21 +00:00
1fa5d20d40 feat: add PUT /api/auth/profile endpoint for self-service profile update
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 09:37:17 +00:00
6bc0b3ac5a feat: add ProfileUpdate schema and extend UserResponse with profile fields
- Add first_name, last_name, display_name, avatar_url to UserResponse
- Add ProfileUpdate schema for self-service profile editing
- Add MFADisableRequest schema for password-confirmed MFA disable

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 09:35:54 +00:00
d09fdccc75 feat: add first_name, last_name, display_name, avatar_url to User model
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>
2026-02-26 09:34:33 +00:00
400520aebd fix: auto-detect CSV delimiter (comma, semicolon, tab)
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>
2026-02-24 23:09:16 +00:00
f8a8befb19 fix: add versicherung field to CaseUpdate schema
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>
2026-02-24 13:05:55 +00:00
7e9373a6d0 fix: use sentinel value for empty Radix Select option to prevent crash
Radix UI Select.Item does not allow empty string values. The Anrede
dropdown used value="" for the empty option, causing the entire React
app to crash when entering edit mode. Use '__none__' sentinel value
instead and convert to null on selection.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 12:59:32 +00:00
19db4c5def feat: make all case detail fields editable with edit-mode toggle
Replace individual field editors (KVNR, ICD) with a unified edit-mode
approach using data-driven field configuration. A single "Bearbeiten"
button toggles all fields into edit mode with dirty-tracking and
split-save (KVNR via dedicated endpoint for all users, remaining fields
via admin-only general update endpoint).

- Extend Case TypeScript interface with 17 missing backend fields
- Add declarative field config (7 sections, 30 fields) in fieldConfig.ts
- Add useInlineEdit hook with dirty-tracking and split-save logic
- Add EditableField dual-mode component (text/date/boolean/select/textarea)
- Refactor CaseDetail to render sections from config
- ICD section retains its own endpoint with separate save button

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 11:23:03 +00:00
97731552c5 feat: add editable KVNR field in case detail view with dedicated API endpoint
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 11:07:49 +00:00
ab0ed453fa fix: rename Faelle to Fälle in sidebar, add KVNR column to cases table
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 10:50:42 +00:00
7ef1fc9335 feat: add checkbox selection and bulk delete for reports
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 10:40:19 +00:00
9650889d24 feat: add audit logging for login, logout, imports, and report generation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 10:36:25 +00:00
4a3648a018 feat: serve frontend SPA from FastAPI backend
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 10:10:11 +00:00
1edf5835be feat: add dark mode toggle in header and login page
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 10:02:41 +00:00