Commit graph

16 commits

Author SHA1 Message Date
42fd1808c4 feat: add admin-only billing status donut and top gutachter charts to Dashboard
Extends DashboardKPIs with total_abgerechnet/pending_abrechnung. Adds
new GET /reports/dashboard/top-gutachter endpoint (admin-only). Frontend
shows Abrechnungsstatus donut + Gutachter-Verteilung progress bars in a
new third row, visible only to admins.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 15:55:30 +00:00
2f0a556371 fix: use same KW range for year-over-year KPI comparison
The previous implementation compared a partial current year against a
full previous year, producing misleading percentages. Now determines the
max KW with data in the selected year and filters the previous year to
the same KW range for a fair comparison.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 13:23:03 +00:00
73b0d6761c feat: add year-over-year comparison to Dashboard KPI cards
Dashboard endpoint now returns prev_kpis (previous year's KPIs) alongside
current KPIs. KpiCard component shows percentage change with colored trend
indicators (green up, red down, grey neutral). Also marks completed items
in todo.md (notification center, dark mode toggle were already implemented).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 13:15:05 +00:00
5da1e523d3 feat: implement Gutachten-Statistik page with KPIs and charts
Add full statistics page replacing placeholder: 4 KPI cards (total, Bestätigung,
Alternative, Uncodiert), stacked bar chart for gutachten types per KW, donut chart
for type distribution, grouped bar chart for therapy changes per KW, and horizontal
bar chart for therapy change reasons. Includes new backend endpoint and service
function combining sheet3/sheet4 data with KPI aggregation. Also adds feature
roadmap todo.md.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 12:37:08 +00:00
cb73cf5461 feat: add yearly KW comparison chart and top 10 ICD box to Dashboard
Backend: two new endpoints /reports/dashboard/yearly-comparison and
/reports/dashboard/top-icd for multi-year KW case counts and ICD
frequency aggregation.

Frontend: grouped bar chart comparing KW across years (2022+) and
a ranked top 10 ICD list with progress bars on the Dashboard.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 12:11:51 +00:00
899c125a62 fix: show individual case data in Wochenübersicht preview instead of aggregated summaries
Preview now mirrors the Excel export content: KVNR, Datum, x-markers
for Erstgespräch/Abbruch/Unterlagen/Gutachten/FG, and ICD-10 per case,
grouped by KW blocks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 15:32:30 +00:00
27b3810250 feat: add inline preview for Wochenübersicht reports
- Backend stores per-KW summary in report_data (count, ICD status, FG split)
- WochenuebersichtViewer component shows expandable KW table with totals
- Expand/collapse pattern matching ReportsPage (ChevronRight/Down, useReportData)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 15:26:20 +00:00
efeb619b06 feat: persist Wochenübersicht exports, DAK-Mitarbeiter access + ICD upload
- Wochenübersicht exports now persisted in DB (WeeklyReport) + disk
- POST /reports/wochenuebersicht/generate replaces GET (admin-only)
- POST /reports/wochenuebersicht/upload-icd for ICD upload (all roles)
- GET /reports/list supports report_type_prefix filter
- WochenuebersichtPage: report table + ICD drag-drop upload for all roles
- Route + sidebar open to all authenticated users
- ReportsPage filters out wochenuebersicht report types

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 13:51:14 +00:00
6f6a721973 feat: add Wochenübersicht export + ICD import auto-detect
- New Excel export service for weekly DAK summary sheets (c2s / c2s_g_s variants)
- New API endpoint GET /reports/wochenuebersicht (admin-only)
- ICD import auto-detects format (coding template vs. Wochenübersicht KVNR-based)
- New admin frontend page with download form
- Route + sidebar navigation entry

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 13:28:17 +00:00
48939f01dd feat: add Onko-Intensiv and Galle-Schild report types
Adds report_type support across the full stack:
- Backend: REPORT_TYPES mapping, fallgruppen filter in all 5 sheet
  calculations, dynamic Excel columns, report_type DB column with
  Alembic migration 007
- Frontend: report type dropdown in generation form, type column in
  reports table, dynamic fallgruppen in ReportViewer

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 12:47:59 +00:00
dbb5afaeb9 feat: add inline report viewer with 5-tab sheet display
- Backend: GET /reports/{id}/data endpoint returns stored report JSON
- Frontend: ReportViewer component renders all 5 Excel sheets as tabs
  (KW gesamt, Fachgebiete, Gutachten, Therapieänderungen, ICD onko)
- ReportsPage: clickable rows with inline expansion to view reports
- Empty KW rows filtered, summary row at bottom, German labels
- Download button still available alongside inline view

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 22:57:35 +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
4467e1b1cb fix: upsert report metadata to avoid duplicate key error on re-generation
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>
2026-02-24 09:28:40 +00:00
590125073c fix: support token query param for file download endpoints
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>
2026-02-24 09:20:14 +00:00
d6fb04d5a7 feat: coding queue, reports API, Excel sync
- 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>
2026-02-24 08:03:17 +00:00