chore(strip): verwijder behandelplan-module

AI-generatie negeerde de geregistreerde diagnose en ernst — elk plan was
generiek (reviewbevinding). Module komt terug bij de rebuild, gekoppeld
aan het nieuwe datamodel.

- app/epd/patients/[id]/behandelplan/ en /api/behandelplan/ verwijderd
- components/behandelplan/ (view, list, forms) verwijderd
- lib/ai/behandelplan-prompt.ts, lib/ai/intervention-mapping.ts,
  lib/types/behandelplan.ts verwijderd
- behandelplan-sectie uit patientdashboard, dashboard-API en
  Cortex patient-dashboard-block
- 'Doorzetten naar behandelplan' uit behandeladvies-formulier

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
colinislit
2026-07-14 22:47:58 +02:00
parent a8b02c1ef3
commit 96848ecc81
27 changed files with 3 additions and 6407 deletions

View File

@@ -18,14 +18,6 @@ import type { Intake } from '@/lib/types/intake';
import { format } from 'date-fns';
import { nl } from 'date-fns/locale';
import { getPatientEncounters } from '@/app/epd/agenda/actions';
import { getActiveCarePlan } from './behandelplan/actions';
import type { SmartGoal, Intervention, Behandelstructuur, Evaluatiemoment } from '@/lib/types/behandelplan';
function extractHulpvraag(notes: string | null): string | null {
if (!notes) return null;
const firstSentence = notes.split(/[.!?]/)[0];
return firstSentence.length > 150 ? firstSentence.slice(0, 150) + '...' : firstSentence;
}
export default async function PatientDashboardPage({
params,
@@ -35,10 +27,9 @@ export default async function PatientDashboardPage({
const { id } = await params;
// Fetch all data in parallel for better performance
const [intakesResult, encountersResult, carePlanResult] = await Promise.all([
const [intakesResult, encountersResult] = await Promise.all([
getIntakesByPatientId(id).catch(() => [] as Intake[]),
getPatientEncounters(id).catch(() => []),
getActiveCarePlan(id).catch(() => null),
]);
// Process intakes
@@ -58,16 +49,6 @@ export default async function PatientDashboardPage({
recentEncounters = recent.slice(0, 5 - upcomingEncounters.length);
}
// Process care plan and get hulpvraag from already-fetched intakes
const activeCarePlan = carePlanResult;
let hulpvraag: string | null = null;
if (activeCarePlan?.based_on_intake_id) {
const linkedIntake = intakesResult.find((i: Intake) => i.id === activeCarePlan.based_on_intake_id);
if (linkedIntake?.notes) {
hulpvraag = extractHulpvraag(linkedIntake.notes);
}
}
return (
<div className="p-6">
{/* Page Header */}
@@ -266,154 +247,6 @@ export default async function PatientDashboardPage({
</div>
)}
{/* Behandelplan Section */}
{activeCarePlan && (
<div className="bg-white rounded-lg border border-slate-200 p-6 mb-6">
<div className="flex items-center justify-between mb-4">
<h3 className="text-lg font-semibold text-slate-900">Actief Behandelplan</h3>
<Link
href={`/epd/patients/${id}/behandelplan`}
className="text-sm text-teal-600 hover:text-teal-700 font-medium"
>
Bekijk volledig plan
</Link>
</div>
{/* Hulpvraag */}
{hulpvraag && (
<div className="mb-4 p-3 bg-slate-50 rounded-lg">
<p className="text-xs font-medium text-slate-600 mb-1">Hulpvraag</p>
<p className="text-sm text-slate-700 italic">&ldquo;{hulpvraag}&rdquo;</p>
</div>
)}
{/* Behandelstructuur */}
{activeCarePlan.behandelstructuur && (
<div className="mb-4 p-3 bg-teal-50 rounded-lg">
<p className="text-xs font-medium text-teal-700 mb-2">Behandelstructuur</p>
<div className="grid grid-cols-2 gap-2 text-sm text-teal-900">
{(() => {
const bs = activeCarePlan.behandelstructuur as unknown as Behandelstructuur;
return (
<>
<div>
<span className="font-medium">Duur:</span> {bs.duur}
</div>
<div>
<span className="font-medium">Frequentie:</span> {bs.frequentie}
</div>
<div>
<span className="font-medium">Aantal sessies:</span> {bs.aantalSessies}
</div>
<div>
<span className="font-medium">Vorm:</span> {bs.vorm}
</div>
</>
);
})()}
</div>
</div>
)}
{/* Doelen Overzicht */}
{activeCarePlan.goals && Array.isArray(activeCarePlan.goals) && activeCarePlan.goals.length > 0 && (
<div className="mb-4">
<p className="text-xs font-medium text-slate-600 mb-2">Doelen ({activeCarePlan.goals.length})</p>
<div className="space-y-2">
{(activeCarePlan.goals as unknown as SmartGoal[]).slice(0, 3).map((goal) => (
<div key={goal.id} className="p-2 bg-slate-50 rounded border border-slate-200">
<div className="flex items-start justify-between mb-1">
<p className="text-sm font-medium text-slate-900">{goal.title}</p>
<span className={`px-2 py-0.5 rounded-full text-xs font-medium ${
goal.status === 'bezig' ? 'bg-blue-50 text-blue-700' :
goal.status === 'gehaald' ? 'bg-green-50 text-green-700' :
'bg-slate-50 text-slate-700'
}`}>
{goal.status === 'bezig' ? 'Bezig' :
goal.status === 'gehaald' ? 'Gehaald' :
goal.status === 'niet_gestart' ? 'Niet gestart' : goal.status}
</span>
</div>
{goal.progress > 0 && (
<div className="mt-1">
<div className="h-1.5 bg-slate-200 rounded-full overflow-hidden">
<div
className="h-full bg-teal-500 transition-all"
style={{ width: `${goal.progress}%` }}
/>
</div>
<p className="text-xs text-slate-500 mt-0.5">{goal.progress}% voltooid</p>
</div>
)}
</div>
))}
{activeCarePlan.goals.length > 3 && (
<p className="text-xs text-slate-500 text-center">
+{activeCarePlan.goals.length - 3} meer doelen
</p>
)}
</div>
</div>
)}
{/* Interventies Overzicht */}
{activeCarePlan.activities && Array.isArray(activeCarePlan.activities) && activeCarePlan.activities.length > 0 && (
<div className="mb-4">
<p className="text-xs font-medium text-slate-600 mb-2">Interventies ({activeCarePlan.activities.length})</p>
<div className="flex flex-wrap gap-2">
{(activeCarePlan.activities as unknown as Intervention[]).slice(0, 5).map((intervention) => (
<span
key={intervention.id}
className="px-2 py-1 bg-purple-50 text-purple-700 rounded text-xs font-medium"
>
{intervention.name}
</span>
))}
{activeCarePlan.activities.length > 5 && (
<span className="px-2 py-1 bg-slate-100 text-slate-600 rounded text-xs">
+{activeCarePlan.activities.length - 5} meer
</span>
)}
</div>
</div>
)}
{/* Aankomende Evaluatiemomenten */}
{activeCarePlan.evaluatiemomenten &&
Array.isArray(activeCarePlan.evaluatiemomenten) &&
activeCarePlan.evaluatiemomenten.length > 0 && (
<div>
<p className="text-xs font-medium text-slate-600 mb-2">Aankomende evaluatiemomenten</p>
<div className="space-y-2">
{(activeCarePlan.evaluatiemomenten as unknown as Evaluatiemoment[])
.filter((evaluatie) => evaluatie.status === 'gepland')
.slice(0, 2)
.map((evaluatie) => (
<div key={evaluatie.id} className="p-2 bg-amber-50 rounded border border-amber-200">
<div className="flex items-center justify-between">
<div>
<p className="text-sm font-medium text-amber-900">
{evaluatie.type === 'tussentijds' ? 'Tussentijdse evaluatie' :
evaluatie.type === 'eind' ? 'Eindevaluatie' : 'Crisis evaluatie'}
</p>
{evaluatie.plannedDate && (
<p className="text-xs text-amber-700 mt-0.5">
Week {evaluatie.weekNumber} {format(new Date(evaluatie.plannedDate), 'd MMM yyyy', { locale: nl })}
</p>
)}
</div>
<span className="px-2 py-0.5 bg-amber-100 text-amber-800 rounded-full text-xs font-medium">
Gepland
</span>
</div>
</div>
))}
</div>
</div>
)}
</div>
)}
{/* Next Steps Section */}
<div className="bg-blue-50 border border-blue-200 rounded-lg p-6">
<div className="flex items-start gap-3">