+
+
Coding-Warteschlange
+
+
+ {codedCount} von {totalCount} Fälle codiert
+
+
+
+
+
+ {/* Progress bar */}
+ {data && totalCount > 0 && (
+
+ )}
+
+ {/* Cards */}
+ {loading ? (
+
+ {Array.from({ length: 4 }).map((_, i) => (
+
+ ))}
+
+ ) : data && data.items.length > 0 ? (
+
+ {data.items.map((c) => {
+ const form = formStates[c.id]
+ if (!form) return null
+ const isSaving = savingIds.has(c.id)
+ const isSaved = savedIds.has(c.id)
+ const error = errors[c.id]
+
+ return (
+
+
+
+
+ {c.fall_id || `#${c.id}`} — {c.nachname}
+ {c.vorname ? `, ${c.vorname}` : ''}
+
+ {isSaved && (
+
+ )}
+
+
+
+ {FALLGRUPPEN_LABELS[c.fallgruppe] || c.fallgruppe}
+
+ {c.icd && (
+
+ {c.icd}
+
+ )}
+
+
+
+ {/* Gutachten-Typ */}
+
+
+
+
+
+ {/* Therapieänderung */}
+
+
+
+
+
+ {/* Checkboxes */}
+
+
+
+ updateFormField(c.id, 'ta_diagnosekorrektur', !!checked)
+ }
+ />
+
+
+
+
+ updateFormField(c.id, 'ta_unterversorgung', !!checked)
+ }
+ />
+
+
+
+
+ updateFormField(c.id, 'ta_uebertherapie', !!checked)
+ }
+ />
+
+
+
+
+ {error && (
+
+ {error}
+
+ )}
+
+
+
+
+ )
+ })}
+
+ ) : (
+
+ Keine Fälle in der Warteschlange.
+
+ )}
+
+ {/* Pagination */}
+ {data && data.total > 50 && (
+
+
+
+ Seite {page} von {Math.ceil(data.total / 50)}
+
+
+
+ )}
+
+ )
+}
diff --git a/frontend/src/pages/ReportsPage.tsx b/frontend/src/pages/ReportsPage.tsx
new file mode 100644
index 0000000..83ec8da
--- /dev/null
+++ b/frontend/src/pages/ReportsPage.tsx
@@ -0,0 +1,251 @@
+import { useState, useEffect } from 'react'
+import { Download, FileSpreadsheet, Loader2, Plus } from 'lucide-react'
+import api from '@/services/api'
+import type { ReportMeta } from '@/types'
+import { useAuth } from '@/context/AuthContext'
+import { Button } from '@/components/ui/button'
+import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
+import { Input } from '@/components/ui/input'
+import { Label } from '@/components/ui/label'
+import {
+ Table, TableBody, TableCell, TableHead, TableHeader, TableRow,
+} from '@/components/ui/table'
+import { Skeleton } from '@/components/ui/skeleton'
+import { Alert, AlertDescription } from '@/components/ui/alert'
+
+export function ReportsPage() {
+ const { isAdmin } = useAuth()
+ const currentYear = new Date().getFullYear()
+ const currentKw = getISOWeek(new Date())
+
+ const [reports, setReports] = useState