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'.
- Updated comments and documentation to reflect the new branding of the chat API and related components.
- Renamed functions and variables to align with the Swift Assistent terminology.
- Enhanced UI components with animations using Framer Motion for a smoother user experience.
- Removed outdated architecture documentation related to the Medical Scribe system.
This change is part of the transition to the Swift Assistent branding, ensuring consistency across the application.
- Add AgendaBlock core component with list, create, cancel, reschedule modes
- Implement AgendaListView with patient/type/location details and actions
- Implement AgendaCreateForm with fuzzy patient search and validation
- Implement AgendaCancelView with disambiguation support
- Implement AgendaRescheduleForm with date/time picker
- Integrate with server actions (create, cancel, reschedule)
- Add radio-group UI component
- Update documentation and status
Epic 2 compleet: NLP-helpers voor datum en tijd interpretatie.
Implementatie:
- parseRelativeDate(): ondersteunt "vandaag", "morgen", "deze week",
weekdagen (maandag-zondag), en absolute datums (30 december, 28-12-2024)
- parseTime(): ondersteunt "14:00", "14", "half drie", "kwart voor drie",
en natuurlijke taal tijdsaanduidingen
- combineDatetime(): combineert datum + tijd naar ISO string
- isNotInPast(): validatie voor toekomstige datums
- isDateRange(): type guard voor datum ranges
Integratie:
- Entity extractor gebruikt date/time parser voor agenda intents
- Normaliseert ruwe strings ("morgen", "14:00") naar Date objecten
- Ondersteunt Nederlandse tijdsaanduidingen
Tests & validatie:
- Unit tests voor alle parser functies
- Verify script voor handmatige testing
- Review document met bevindingen en suggesties
Story points: 7 SP (E2.S1: 3, E2.S2: 2, E2.S3: 2)