chore(strip): verwijder kapotte intake-tabs anamnese, onderzoeken en ROM

Opslaan faalde altijd door label/code-mismatch met de database-constraints
(reviewbevinding). Tabs komen terug bij de rebuild op het nieuwe datamodel.

- tab-mappen anamnese/, examination/, rom/ verwijderd
- tabs uit intake-tabs.tsx, server actions uit actions.ts
- intake-status API telt de secties niet meer mee (voortgangsring klopt)
- Cortex-navigatiedoelen (regex, entity-mapping, prompt) bijgewerkt zodat
  'ga naar anamnese' geen 404 meer geeft

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
colinislit
2026-07-14 22:44:09 +02:00
parent 5e910c3053
commit a8b02c1ef3
14 changed files with 9 additions and 559 deletions

View File

@@ -26,11 +26,8 @@ interface IntakeSection {
const INTAKE_SECTIONS: IntakeSection[] = [
{ id: 'contacts', label: 'Contactmomenten', required: false },
{ id: 'anamnese', label: 'Anamnese', required: true },
{ id: 'risk', label: 'Risicotaxatie', required: true },
{ id: 'kindcheck', label: 'Kindcheck', required: true },
{ id: 'examination', label: 'Onderzoek', required: false },
{ id: 'rom', label: 'Meetinstrumenten (ROM)', required: false },
{ id: 'diagnosis', label: 'Diagnose', required: true },
{ id: 'behandeladvies', label: 'Behandeladvies', required: true },
];
@@ -139,41 +136,17 @@ export async function GET(request: NextRequest) {
}
// Fetch counts for each section in parallel
const [
contactsResult,
anamneseResult,
riskResult,
examinationResult,
romResult,
diagnosisResult,
] = await Promise.all([
const [contactsResult, riskResult, diagnosisResult] = await Promise.all([
// Contacts (encounters)
supabase
.from('encounters')
.select('id', { count: 'exact', head: true })
.eq('intake_id', targetIntakeId),
// Anamnese
supabase
.from('anamneses')
.select('id', { count: 'exact', head: true })
.eq('intake_id', targetIntakeId),
// Risk assessments
supabase
.from('risk_assessments')
.select('id', { count: 'exact', head: true })
.eq('intake_id', targetIntakeId),
// Examinations (non-ROM)
supabase
.from('examinations')
.select('id', { count: 'exact', head: true })
.eq('intake_id', targetIntakeId)
.neq('examination_type', 'ROM'),
// ROM examinations
supabase
.from('examinations')
.select('id', { count: 'exact', head: true })
.eq('intake_id', targetIntakeId)
.eq('examination_type', 'ROM'),
// Diagnoses (conditions linked to intake via encounter_id)
supabase
.from('conditions')
@@ -184,11 +157,8 @@ export async function GET(request: NextRequest) {
// Build section status
const sectionCounts: Record<string, number> = {
contacts: contactsResult.count || 0,
anamnese: anamneseResult.count || 0,
risk: riskResult.count || 0,
kindcheck: intake.kindcheck_data && Object.keys(intake.kindcheck_data as object).length > 0 ? 1 : 0,
examination: examinationResult.count || 0,
rom: romResult.count || 0,
diagnosis: diagnosisResult.count || 0,
behandeladvies: intake.treatment_advice && Object.keys(intake.treatment_advice as object).length > 0 ? 1 : 0,
};