Beantwoordt de resterende open vragen uit feitenmodel-instroom.md §7:
aanvullende_informatie_nodig wordt een gebeurtenisfeit i.p.v. besluituitkomst
of statusfase, heroverweging na afwijzing krijgt een expliciete
"vervangt"-relatie tussen acceptatiebesluiten, en intrekking vóór start
intake krijgt twee routes (cliënt-intrekking zonder bevoegdheidseis,
institutionele correctie met dezelfde bevoegdheid als het origineel) waarbij
de al ontstane zorgepisode altijd wordt afgesloten, nooit verwijderd.
Referral Case krijgt daarmee een tijdlijn-gebaseerde stand i.p.v. een vaste
lineaire statusmachine. Alleen vraag 2 (behandeladvies-uitkomsten) blijft
open als apart onderzoek.
Voegt de discovery- en besluitvormingsronde van 18-19 juli toe (besluitenlog,
begrippenlijst, feitenmodel-instroom met scenariotoetsen, terminologie- en
leveranciersonderzoek) en synchroniseert feitenmodel-instroom.md met de
screening=acceptatie-beslissing (§5). Herstructureert docs/datamodel/ naar
submappen per documentsoort (besluiten/sessielogs/feitenmodellen/deelmodellen/
onderzoek/entiteitenkaarten) zodat toekomstige besluitenlogs en feitenrondes
per deelgebied een vaste plek krijgen.
- datamodel-discovery.md: scopeverbreding ronde 1 (wachtlijst, diagnose,
behandelplan), besluiten zorgepisode als eigen entiteit, DSM-5-TR
primair met ICD-10-mapping, wachtlijstplaatsing op twee momenten
(Treeknormen), behandelplan-kern; bevindingen prototype-verkenning
- entiteitenkaart-instroom.html: samenhang-diagram (aanmelding als
besluitproces vs zorgepisode als periode van zorg), diagram 3 met
wachtlijst/diagnose/behandelplan, nieuwe waardelijsten
- sessielog 17 juli: 13 besluiten, bevindingen en open vragen
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- datamodel-discovery.md: FCO-IM-werkwijze, spelregels, feitzinnen §5.1
afgerond met besluiten 17 juli (persoon/cliënt-splitsing, verwijzer +
praktijk als eigen entiteiten, AGB per verwijzertype, flexibele
statussen, verwijsbrief als nudge, cliëntportaal-account, BSN optioneel
op persoon)
- entiteitenkaart-instroom.html: ER-diagram + waardelijsten instroomflow,
gepubliceerd als artifact ter review
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- docs/intent/samenspel-tip-ecd.html: laag-of-platform discussiestuk voor
de werksessie over de TIP-koppeling (twee modellen, drie routes,
API-mapping, beslisvragen)
- docs/sessions/2026-07-14-sessielog.md: besluiten, reviewbevindingen en
uitgevoerde opschoning van vandaag
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- next-mdx-remote en gray-matter uit package.json (0 imports)
- components/ui/hero-section-2.tsx en timeline.tsx (nergens geimporteerd)
- lokale .DS_Store-bestanden opgeruimd (stonden al in .gitignore)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Alle verwijzingen (middleware, login, auth-callback, set-password,
Cortex context-bar) wijzen nu rechtstreeks naar /epd/patients; de
backwards-compat redirects zijn daarmee overbodig.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Beide waren lege placeholders ('Epic 1 - Placeholder', 'Not designed yet').
Sidebar-items eruit; login-tests gebruiken /epd/agenda als voorbeeld van
een beveiligde route.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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>
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>
De intake-variant (intakes/[intakeId]/diagnosis) is de meest complete en
blijft. Sidebar-items Diagnose en Behandelplan (level 2) verwijderd —
behandelplan-module zelf volgt in de volgende commit.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Prototype-ballast verwijderd als eerste stap van de ECD-rebuild:
- app/(marketing) incl. blog, contact, documentatie + lib/mdx, lib/content, content/
- /api/leads en publieke marketing-routes uit middleware
- app/epd/_archive (backup van clients-module)
- sitemap.ts (verwees alleen naar blog), globals.css.backup
- root / redirect naar /login; robots.txt op disallow-all (afgeschermd systeem)
FHIR-routes blijven bewust staan: /api/fhir/Patient is de facto de
patienten-API voor dossier, agenda en Cortex — vervangen volgt in fase 3.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Configs voor beide runners, login via session caching, AI-chat
mocks (SSE) voor deterministische Cortex-tests. Supabase local
config toegevoegd. Auth-state en reports zijn gitignored.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Cortex handelt een no-show af vanuit één chatcommando: afspraak
annuleren (declarabiliteits-nudge), en de openstaande concept-
huisartsbrief wordt via LLM herschreven en ter review aangeboden
in een document artifact (human-in-the-loop, PATCH dispatch zet
status op verzendklaar).
- API-routes: context, rescript, cancel, dispatch
- NoShowDocumentBlock: review/edit UI met origineel-vergelijk
- Mock-data voor concept huisartsbrief
- PRD, FO, bouwplan en epics in docs/intent/noshow-case/
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- agenda-create-form: capture prefilled patient name in const so the
async closure sees a narrowed string type
- tsconfig: exclude tests/ from next build typecheck (Cypress/Playwright
files have their own type context)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Introduced new navigation handler for intake_navigeer intent, allowing users to navigate to specific patient intake pages.
- Added intake status display to show completion percentage and section checklist.
- Updated action-parser schema to include new intake intents and improved routing for better user experience.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fixes 4 bugs preventing intake blocks from working:
1. Chat API validation: Add 'nudge' to message type enum, allow empty
content for streaming messages
2. AI chat recognition: Add P3 intake intents (intake_status,
risico_query, diagnose_query, intake_navigeer) to system prompt
with triggers, entities, and JSON examples
3. Artifact rendering: Add intake block imports and switch cases
to artifact-container.tsx
4. API 400 error: Convert null to undefined for optional Zod params
(searchParams.get returns null, Zod .optional() expects undefined)
Also adds:
- Testplan for E2E testing (60+ test cases)
- Session log with lessons learned and new intent checklist
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add intake intents to action-parser schema and routing
- Add navigation handler in command-center for intake_navigeer intent
- Navigate to patient intakes page with toast feedback
- Update bouwplan: E5 now complete (6/7 epics done)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds 4 new intents for intake workflow:
- intake_status: shows completion percentage and section checklist
- intake_navigeer: navigation to specific intake tabs
- risico_query: displays risk assessments with severity indicators
- diagnose_query: shows primary/secondary diagnoses
New components:
- IntakeStatusBlock, RisicoBlock, DiagnoseBlock
- Shared block components (BlockLoading, BlockError, BlockEmpty, BlockSection, BlockItem, BlockFooter)
- useBlockData and useIntakeContext hooks
New API routes:
- GET /api/cortex/intake/status
- GET /api/cortex/intake/risico
- GET /api/cortex/intake/diagnose
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Updated DagnotatieBlock to use activePatient for prefill if no patientId is provided.
- Enhanced PatientDashboardBlock to fallback to activePatient for patientId and name.
- Adjusted usePatientSelection to handle pending actions and re-route after patient selection.
- Refined chat components to manage nudge messages and integrate them into the chat flow.
- Improved UI elements for better patient selection experience.
This update enhances user experience by ensuring that the active patient context is utilized across multiple components, streamlining workflows and reducing manual input.
Component was exported but never imported/used anywhere.
v3.0 architecture uses chat-input.tsx instead.
Voice features (useCortexVoice hook) remain available for future use.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
System prompt aangepast voor nuchtere, understated tone of voice:
- Kernkwaliteit "Nuchter" toegevoegd
- Tone of voice: droog en behulpzaam ipv vriendelijk
- Stijlvoorbeelden sectie met concrete frases
- 6 voorbeeldresponses aangepast naar kortere, drogere stijl
- Error messages menselijker ("Hmm, snap niet helemaal...")
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The @mention dropdown was only in command-input.tsx but users type in
chat-input.tsx (the v3.0 chat textarea). Added @mention support there:
- @mention state and detection logic
- PatientMentionDropdown rendering
- handleMentionSelect with activePatient setting
- Escape key closes dropdown before clearing input
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Inline patient selectie via @naam in de chat input.
YAGNI Versimpeling: 8→4 SP, 5→3 stories
- Geen selectedMentions array (activePatient is al beschikbaar)
- Geen API payload wijziging nodig
- Geen meerdere mentions tracking
E2.S1 - @-detectie:
- Detecteer laatste @ in input
- Track query en startIndex
- Actief als geen space na @ en minimaal 1 char
E2.S2 - PatientMentionDropdown:
- Hergebruik usePatientSearch (debounce 150ms, limit 5)
- Hergebruik PatientListItem (size="sm")
- Positioned above input (bottom-full)
- Escape sluit dropdown
E2.S3 - Selectie flow:
- Vervang @query met @naam in input
- Zet activePatient via usePatientSelection
- Sluit dropdown automatisch
Bouwplan v1.4: Epic 2 compleet (14/19 SP - 74%)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Voornaam zoeken werkte niet omdat name_given array case-sensitive is.
Capitalize nu de zoekterm (eerste letter hoofdletter) voordat deze
wordt gebruikt in de array search, zodat 'jan' matcht met 'Jan'.
Aangepast in beide search endpoints:
- /api/patients/search
- /api/cortex/patients/search
Remove 39 swift documentation files that were duplicated.
Original files are preserved in docs/archive/swift/.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Adjusted date handling in the agenda API to ensure optional parameters for start, end, and label are correctly processed.
- Enhanced chat input and action parser to support optional date labels for relative dates.
- Updated agenda components to handle date ranges and loading states more effectively.
- Improved error handling and loading indicators in the agenda block for better user experience.
This commit ensures consistency in date handling across the application, aligning with the new requirements for relative date inputs.
SOC: Parser en entity-extractor accepteren nu optionele referenceDate
parameter. Caller bepaalt wat "nu" is, niet de functies intern.
Wijzigingen:
- parseRelativeDate(input, referenceDate?) - referenceDate parameter
- extractEntities(input, intent, referenceDate?) - doorgeeft aan parser
- API routes gebruiken new Date() als referenceDate
Verwijderd (YAGNI):
- lib/utils/server-date.ts - wrapper om new Date() was overbodig
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements AI-powered multi-intent classification for Cortex V2.
When Reflex Arc (Layer 1) detects complexity, it escalates to
the Orchestrator for intelligent classification using Claude 3.5 Haiku.
E2.S1 - System prompt for Orchestrator
- ORCHESTRATOR_SYSTEM_PROMPT constant with Dutch instructions
- Multi-intent detection (en, daarna, ook, eerst, vervolgens)
- Pronoun resolution rules (hij/zij → active patient)
- JSON-only output format specification
E2.S2 - Context formatting for AI
- formatContextForPrompt() with emoji structure
- Dutch labels for shifts and views
- Graceful null handling, token limiting (max 5 agenda, 3 recent)
E2.S3 - AI classification endpoint
- classifyWithOrchestrator() calling Claude 3.5 Haiku
- Builds IntentChain from AI response
- Tracks tokens used and processing time
E2.S4 - IntentChain parsing with Zod
- parseAIResponse() with Zod schema validation
- Strips markdown code blocks
- Partial extraction for malformed responses
- Graceful fallback to intent: 'unknown'
E2.S5 - POST /api/cortex/classify hybrid endpoint
- Reflex first, escalate to Orchestrator if needed
- Response includes handledBy: 'reflex' | 'orchestrator'
- Auth check, feature flag check, request validation
E2.S6 - Graceful fallback
- buildFallbackChain() with confidence cap (0.6)
- buildChainFromReflex() for simple chains
- classifyWithTimeout() wrapper (5s default)
New files:
- lib/cortex/orchestrator.ts (~780 lines)
- app/api/cortex/classify/route.ts (~180 lines)
Key deliverable: "Zeg Jan af en maak notitie" correctly
parsed into 2 actions in an IntentChain.
Progress: 27 SP / 48 SP (56%) - E0, E1, E2 complete
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Added a new '/blog' route to middleware for improved navigation.
- Updated sitemap to dynamically include blog posts and series URLs.
- Enhanced blog page metadata with Open Graph and Twitter card information.
- Implemented structured data for blog posts and series to improve SEO.
- Removed outdated blog post "Week 1: De Kickoff" from content.
- Introduced optional OG image field in blog frontmatter for better sharing visuals.
- Epic 0 status: ⏳ To Do → ✅ Done
- All 5 stories (E0.S1-S5) marked as complete
- All done criteria checkboxes marked as checked
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Adjusted confidence threshold for executing simple commands from >0.9 to >=0.7 in architecture documentation and code.
- Updated API endpoint paths from `/api/intent/*` to `/api/cortex/*` for intent classification and execution.
- Modified related tests to reflect the new confidence threshold and endpoint changes.
This update enhances the system's responsiveness to user commands while maintaining clarity in API structure.
- Changed default interface preference in LoginForm component from 'klassiek' to 'cortex'.
- Updated redirect path logic to reflect the new 'cortex' preference.
- Modified button label and state management to align with the new interface preference terminology.
- Adjusted type definition for InterfacePreference to include 'cortex' instead of 'swift'.