fix(cortex): update date handling in API and UI components

- 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.
This commit is contained in:
colinislit
2026-01-02 09:21:37 +01:00
parent 011815072b
commit 52e07aaf80
20 changed files with 2092 additions and 65 deletions

View File

@@ -0,0 +1,717 @@
# 📊 Analyse: Intents & Nudges — Cortex V2
**Datum:** 01-01-2026
**Status:** Analyse voor MVP uitbreiding
**Auteur:** Colin Lit (met AI-assistentie)
---
## 1. Samenvatting
Dit document bevat een uitgebreide analyse van:
- De huidige geïmplementeerde intents en nudges in Cortex V2
- De EPD-functionaliteit die beschikbaar is voor nudge triggers
- Aanbevelingen voor nieuwe nudges gebaseerd op zorgprotocollen
- **Nieuw:** Analyse van query/overzicht intents voor rapportages, behandelplannen en risico's
**Conclusies:**
1. De huidige 7 intents dekken basis acties, maar missen **query/overzicht** functionaliteit
2. Er worden 7 nieuwe nudges aanbevolen om de "proactieve AI collega" beter te demonstreren
3. Er worden 4 nieuwe query intents aanbevolen voor overzichten (rapportages, behandelplan, risico's, dashboard)
---
## 2. Huidige Implementatie
### 2.1 Intents (7 + unknown)
| Intent | Nederlands Label | UI Block | Categorie | Status |
|--------|-----------------|----------|-----------|--------|
| `dagnotitie` | Notitie | ✅ `dagnotitie-block.tsx` | Actie | Volledig |
| `zoeken` | Patiënt zoeken | ✅ `zoeken-block.tsx` | Query | Volledig |
| `overdracht` | Overdracht | ✅ `overdracht-block.tsx` | Query | Volledig |
| `agenda_query` | Agenda | ⚠️ Via artifact | Query | Basis |
| `create_appointment` | Nieuwe afspraak | ⚠️ Via artifact | Actie | Basis |
| `cancel_appointment` | Afspraak annuleren | ⚠️ Via artifact | Actie | Basis |
| `reschedule_appointment` | Afspraak verzetten | ⚠️ Via artifact | Actie | Basis |
| `unknown` | Fallback | — | — | N.v.t. |
**Locatie:** `lib/cortex/types.ts`
### 2.2 Overzicht Mogelijkheden (Query Intents)
#### ✅ Wat WEL via spraak bereikbaar is
| Intent | Input Voorbeeld | Output |
|--------|-----------------|--------|
| `agenda_query` | "Agenda vandaag", "Afspraken deze week" | `AgendaListView` - lijst van afspraken met periode filter |
| `overdracht` | "Overdracht", "Samenvatting" | `OverdrachtBlock` - AI-samenvatting per patiënt met aandachtspunten |
| `zoeken` | "Zoek Jan", "Wie is Marie" | `ZoekenBlock` - patiënt zoekresultaten |
De **OverdrachtBlock** is krachtig:
- Genereert AI-samenvatting per patiënt
- Toont aandachtspunten met bronverwijzingen
- Toont actiepunten
- Filterbaar per periode (1d, 3d, 7d, 14d)
- Filterbaar per rol (verpleegkundige/psychiater)
#### ❌ Wat NIET via spraak bereikbaar is
| Gewenste Input | Huidige Status | Bestaande UI |
|----------------|----------------|--------------|
| "Toon rapportages van Jan" | ❌ Geen intent | `app/epd/patients/[id]/rapportage/` bestaat |
| "Wat is het behandelplan van Jan?" | ❌ Geen intent | `components/behandelplan/` bestaat |
| "Wat zijn de risico's van Jan?" | ❌ Geen intent | `RisksBlock` in verpleegrapportage bestaat |
| "Overzicht Jan" / "Dashboard Jan" | ❌ Geen intent | ✅ `PatientDashboardBlock` bestaat maar niet bereikbaar!
### 2.3 Nudges (2 protocol rules)
| ID | Naam | Trigger | Suggestie | Priority |
|----|------|---------|-----------|----------|
| `wondzorg-controle` | Wondcontrole na verzorging | `dagnotitie` + content bevat "wond" | "Wondcontrole inplannen over 3 dagen?" → `create_appointment` | medium |
| `medicatie-controle` | Medicatie controle na wijziging | `dagnotitie` + content bevat "medicatie" EN "gewijzigd" | "Medicatie evaluatie inplannen over 1 week?" → `create_appointment` | medium |
**Locatie:** `lib/cortex/nudge.ts`
---
## 3. EPD Functionaliteit Analyse
### 3.1 Beschikbare Modules
| Module | Pad | Relevante Data voor Nudges |
|--------|-----|---------------------------|
| **Rapportage** | `app/epd/patients/[id]/rapportage/` | Report types, categories |
| **Risico Taxatie** | `intakes/[intakeId]/risk/` | Risk types, risk levels |
| **Verpleegrapportage** | `app/epd/verpleegrapportage/` | Vitals, AI samenvatting |
| **Agenda** | `app/epd/agenda/` | Appointment types |
| **Intake** | `intakes/[intakeId]/` | Anamnese, diagnose, kindcheck |
| **Behandelplan** | `patients/[id]/behandelplan/` | Leefgebieden, doelen |
| **Screening** | `patients/[id]/screening/` | Hulpvraag, besluit |
### 3.2 Report Types (voor nudge triggers)
```typescript
// lib/types/report.ts
export const REPORT_TYPES = [
'voortgang',
'observatie',
'incident', // → Trigger voor MIC-melding
'medicatie', // → Trigger voor evaluatie
'contact',
'crisis', // → Trigger voor team informeren
'intake',
'behandeladvies',
'vrije_notitie',
'verpleegkundig',
] as const;
```
### 3.3 Verpleegkundige Categorieën
```typescript
// lib/types/report.ts
export const VERPLEEGKUNDIG_CATEGORIES = [
'medicatie', // → Trigger voor medicatie nudges
'adl', // → Trigger voor zorgplan nudges
'gedrag', // → Trigger voor risico nudges
'incident', // → Trigger voor MIC nudges
'observatie',
] as const;
```
### 3.4 Risk Types (in EPD)
```typescript
// app/epd/patients/[id]/intakes/[intakeId]/risk/components/risk-manager.tsx
const riskTypeOptions = [
{ value: 'suicidaliteit', label: 'Suïcidaliteit' },
{ value: 'agressie', label: 'Agressie' },
{ value: 'zelfverwaarlozing', label: 'Zelfverwaarlozing' },
{ value: 'middelenmisbruik', label: 'Middelenmisbruik' },
{ value: 'verward_gedrag', label: 'Verward gedrag' },
{ value: 'overig', label: 'Overig' },
];
// app/epd/verpleegrapportage/components/blocks/risks-block.tsx (verpleegkunde)
const riskTypes = {
valrisico: 'Valrisico',
decubitus: 'Decubitus',
ondervoeding: 'Ondervoeding',
delier: 'Delier',
infectie: 'Infectie',
suiciderisico: 'Suïciderisico',
agressie: 'Agressie',
weglopen: 'Weglopen',
};
```
### 3.5 Appointment Types
```typescript
// lib/cortex/types.ts
appointmentType?: 'intake' | 'behandeling' | 'follow-up' | 'telefonisch' |
'huisbezoek' | 'online' | 'crisis' | 'overig';
```
---
## 4. Aanbevelingen: Nieuwe Nudges
### 4.1 Overzicht Aanbevolen Nudges
| # | ID | Trigger Intent | Conditions | Suggestie | Priority |
|---|-----|---------------|------------|-----------|----------|
| 1 | `suicidaliteit-veiligheidsplan` | dagnotitie | content matches `suïcida\|zelfmoord\|zelfbeschadig` | Veiligheidsplan actualiseren | 🔴 high |
| 2 | `crisis-team-informeren` | dagnotitie | content matches `crisis\|noodgeval\|acuut` | Crisisteam informeren | 🔴 high |
| 3 | `incident-mic-melding` | dagnotitie | category = `incident` | MIC-melding invullen | 🔴 high |
| 4 | `gedrag-risico-update` | dagnotitie | category = `gedrag` + content matches `agressie\|dreigend\|verward` | Risicotaxatie bijwerken | 🟡 medium |
| 5 | `adl-zorgplan-update` | dagnotitie | category = `adl` + content matches `hulp nodig\|verslechter` | Zorgplan bijwerken | 🟡 medium |
| 6 | `intake-behandelplan` | create_appointment | appointmentType = `intake` | Behandelplan opstellen | 🔵 low |
| 7 | `handover-mark` | dagnotitie | content matches `let op\|belangrijk\|doorgeven` | Opnemen in overdracht | 🔵 low |
### 4.2 Gedetailleerde Specificaties
#### 🔴 HIGH Priority — Safety & Compliance
**1. suicidaliteit-veiligheidsplan**
```typescript
{
id: 'suicidaliteit-veiligheidsplan',
name: 'Veiligheidsplan bij suïcidaliteit',
trigger: {
intent: 'dagnotitie',
conditions: [
{
field: 'content',
operator: 'matches',
value: 'suïcida|zelfmoord|zelfbeschadig|automutil'
},
],
},
suggestion: {
intent: 'dagnotitie',
message: '⚠️ Veiligheidsplan actualiseren en risicotaxatie bijwerken?',
prefillEntities: (source) => ({
patientName: source.patientName,
category: 'observatie',
}),
},
priority: 'high',
enabled: true,
expiresAfterMs: 10 * 60 * 1000, // 10 minuten - urgent
}
```
**Rationale:** Vereist door GGZ-richtlijnen. Bij suïcidaliteit moet altijd het veiligheidsplan geëvalueerd worden.
---
**2. crisis-team-informeren**
```typescript
{
id: 'crisis-team-informeren',
name: 'Team informeren bij crisis',
trigger: {
intent: 'dagnotitie',
conditions: [
{
field: 'content',
operator: 'matches',
value: 'crisis|noodgeval|acuut|spoed'
},
],
},
suggestion: {
intent: 'dagnotitie',
message: '🚨 Crisisteam en dienstdoende psychiater informeren?',
prefillEntities: (source) => ({
patientName: source.patientName,
category: 'incident',
}),
},
priority: 'high',
enabled: true,
expiresAfterMs: 10 * 60 * 1000,
}
```
**Rationale:** Crisis situaties vereisen multidisciplinaire afstemming.
---
**3. incident-mic-melding**
```typescript
{
id: 'incident-mic-melding',
name: 'MIC-melding na incident',
trigger: {
intent: 'dagnotitie',
conditions: [
{ field: 'category', operator: 'equals', value: 'incident' },
],
},
suggestion: {
intent: 'dagnotitie',
message: '⚠️ MIC-melding invullen voor dit incident?',
prefillEntities: (source) => ({
patientName: source.patientName,
category: 'incident',
}),
},
priority: 'high',
enabled: true,
expiresAfterMs: 15 * 60 * 1000,
}
```
**Rationale:** MIC (Melding Incidenten Cliënten) is wettelijk verplicht bij incidenten in de zorg.
---
#### 🟡 MEDIUM Priority — Protocol & Follow-up
**4. gedrag-risico-update**
```typescript
{
id: 'gedrag-risico-update',
name: 'Risicotaxatie bij gedragsverandering',
trigger: {
intent: 'dagnotitie',
conditions: [
{ field: 'category', operator: 'equals', value: 'gedrag' },
{
field: 'content',
operator: 'matches',
value: 'agressie|agressief|dreigend|onrustig|agitatie|verward'
},
],
},
suggestion: {
intent: 'dagnotitie',
message: '📋 Risicotaxatie bijwerken voor dit gedrag?',
prefillEntities: (source) => ({
patientName: source.patientName,
category: 'observatie',
}),
},
priority: 'medium',
enabled: true,
expiresAfterMs: 5 * 60 * 1000,
}
```
**Rationale:** Gedragsverandering kan indicatie zijn voor veranderd risicoprofiel.
---
**5. adl-zorgplan-update**
```typescript
{
id: 'adl-zorgplan-update',
name: 'Zorgplan update bij ADL wijziging',
trigger: {
intent: 'dagnotitie',
conditions: [
{ field: 'category', operator: 'equals', value: 'adl' },
{
field: 'content',
operator: 'matches',
value: 'hulp nodig|niet meer zelfstandig|verslechter|achteruit'
},
],
},
suggestion: {
intent: 'dagnotitie',
message: '🏠 Zorgplan/behandelplan bijwerken voor gewijzigde ADL?',
prefillEntities: (source) => ({
patientName: source.patientName,
category: 'observatie',
}),
},
priority: 'medium',
enabled: true,
expiresAfterMs: 5 * 60 * 1000,
}
```
**Rationale:** ADL-veranderingen moeten leiden tot zorgplan-aanpassingen.
---
#### 🔵 LOW Priority — Administratief & Workflow
**6. intake-behandelplan**
```typescript
{
id: 'intake-behandelplan',
name: 'Behandelplan na intake',
trigger: {
intent: 'create_appointment',
conditions: [
{ field: 'appointmentType', operator: 'equals', value: 'intake' },
],
},
suggestion: {
intent: 'dagnotitie',
message: '📝 Behandelplan opstellen na de intake?',
prefillEntities: (source) => ({
patientName: source.patientName,
category: 'observatie',
}),
},
priority: 'low',
enabled: true,
expiresAfterMs: 30 * 60 * 1000, // 30 minuten
}
```
**Rationale:** Na een intake hoort een behandelplan opgesteld te worden.
---
**7. handover-mark**
```typescript
{
id: 'handover-mark',
name: 'Opnemen in overdracht',
trigger: {
intent: 'dagnotitie',
conditions: [
{
field: 'content',
operator: 'matches',
value: 'let op|belangrijk|doorgeven|overdracht|collega|volgende dienst'
},
],
},
suggestion: {
intent: 'dagnotitie',
message: '📋 Deze notitie opnemen in de dienst-overdracht?',
prefillEntities: (source) => ({
patientName: source.patientName,
}),
},
priority: 'low',
enabled: true,
expiresAfterMs: 5 * 60 * 1000,
}
```
**Rationale:** Belangrijke informatie moet in de overdracht terechtkomen.
---
## 5. Totaaloverzicht na Implementatie
### 5.1 Alle Nudges (9 totaal)
| # | ID | Trigger | Priority | Expiry | Status |
|---|-----|---------|----------|--------|--------|
| 1 | `wondzorg-controle` | dagnotitie + "wond" | 🟡 medium | 5 min | ✅ Bestaand |
| 2 | `medicatie-controle` | dagnotitie + "medicatie" + "gewijzigd" | 🟡 medium | 5 min | ✅ Bestaand |
| 3 | `suicidaliteit-veiligheidsplan` | dagnotitie + suïcide keywords | 🔴 high | 10 min | 🆕 Nieuw |
| 4 | `crisis-team-informeren` | dagnotitie + crisis keywords | 🔴 high | 10 min | 🆕 Nieuw |
| 5 | `incident-mic-melding` | dagnotitie + category=incident | 🔴 high | 15 min | 🆕 Nieuw |
| 6 | `gedrag-risico-update` | dagnotitie + category=gedrag + agressie | 🟡 medium | 5 min | 🆕 Nieuw |
| 7 | `adl-zorgplan-update` | dagnotitie + category=adl + verslechtering | 🟡 medium | 5 min | 🆕 Nieuw |
| 8 | `intake-behandelplan` | create_appointment + type=intake | 🔵 low | 30 min | 🆕 Nieuw |
| 9 | `handover-mark` | dagnotitie + "belangrijk" keywords | 🔵 low | 5 min | 🆕 Nieuw |
### 5.2 Verdeling per Priority
- **🔴 HIGH (3):** Safety-gerelateerd, vereisen directe actie
- **🟡 MEDIUM (4):** Protocol-gerelateerd, binnen dienst afhandelen
- **🔵 LOW (2):** Administratief, handig maar niet urgent
### 5.3 Verdeling per Trigger Intent
- **dagnotitie (8):** Meeste nudges triggeren op notities
- **create_appointment (1):** Na intake afspraak
---
## 6. Demo Impact
### 6.1 Uitgebreide Demo Scene 4
Met de nieuwe nudges kan de demo uitgebreid worden:
| Stap | Input | Verwachte Nudge | Priority |
|------|-------|-----------------|----------|
| 4a | "Wond verzorgd, ziet er goed uit" | Wondcontrole inplannen | 🟡 medium |
| 4b | "Patient was vandaag erg agressief" | Risicotaxatie bijwerken | 🟡 medium |
| 4c | "Incident: patient gevallen in gang" | MIC-melding invullen | 🔴 high |
| 4d | "Crisis: acute suïcidaliteit gemeld" | Veiligheidsplan + team | 🔴 high |
### 6.2 Demo Script Aanpassing
```markdown
### Scene 4: Proactiviteit (uitgebreid - 2.5 min)
**Stap 1:** "Wond verzorgd, ziet er goed uit"
→ NudgeToast (medium/oranje): "Wondcontrole inplannen over 3 dagen?"
**Highlight:** "Systeem kent zorgprotocollen"
**Stap 2:** "Patient was vandaag agressief naar medepatiënt"
→ NudgeToast (medium/oranje): "Risicotaxatie bijwerken?"
**Highlight:** "Gedrag wordt gekoppeld aan risico-assessment"
**Stap 3:** "Crisis: patient spreekt over suïcide"
→ NudgeToast (high/rood): "⚠️ Veiligheidsplan actualiseren?"
**Highlight:** "Hoge prioriteit suggesties vallen direct op"
```
### 6.3 Potentiële Demo met Query Intents
Als de query intents geïmplementeerd worden:
```markdown
### Scene 5: Informatie Ophalen (1.5 min)
**Stap 1:** "Overzicht Jan"
→ PatientDashboardBlock met basisgegevens, intakes, afspraken
**Highlight:** "Direct patiëntinformatie zonder klikken"
**Stap 2:** "Wat zijn de risico's?"
→ Risico overzicht met levels en maatregelen
**Highlight:** "Contextueel - weet dat we over Jan praten"
**Stap 3:** "Toon rapportages van deze week"
→ Gefilterde rapportage lijst
**Highlight:** "Natuurlijke tijdsaanduiding werkt"
```
---
## 7. Technische Implementatie
### 7.1 Benodigde Wijzigingen
| Bestand | Actie |
|---------|-------|
| `lib/cortex/nudge.ts` | 7 nieuwe `ProtocolRule` entries toevoegen |
| `components/cortex/command-center/nudge-toast.tsx` | Styling voor high priority (rood) verifiëren |
| `docs/intent/demo-script-cortex-v2.md` | Demo script uitbreiden met nieuwe scenes |
### 7.2 Backward Compatibility
Alle nieuwe nudges zijn **additief** - bestaande functionaliteit blijft werken. De feature flag `CORTEX_NUDGE` moet `true` zijn om nudges te tonen.
---
## 8. Aanbevelingen: Nieuwe Query Intents
### 8.1 Overzicht Aanbevolen Query Intents
| # | Intent | Input Voorbeelden | Output | Prioriteit |
|---|--------|-------------------|--------|------------|
| 1 | `patient_overview` | "Overzicht Jan", "Dashboard Marie" | `PatientDashboardBlock` (bestaat al!) | 🔴 Hoog |
| 2 | `rapportage_query` | "Toon rapportages van Jan", "Notities deze week" | Rapportage lijst met filters | 🟡 Middel |
| 3 | `behandelplan_query` | "Wat is het behandelplan?", "Toon doelen" | Behandelplan overzicht | 🟡 Middel |
| 4 | `risico_query` | "Wat zijn de risico's?", "Risicotaxatie" | Risico overzicht | 🟡 Middel |
### 8.2 Gedetailleerde Specificaties Query Intents
#### 🔴 HIGH Priority — `patient_overview`
**Waarom hoog?** De UI (`PatientDashboardBlock`) bestaat al, alleen de intent routing ontbreekt.
**Input voorbeelden:**
- "Overzicht Jan"
- "Dashboard Marie"
- "Patiëntoverzicht"
**Pattern matching (Reflex):**
```typescript
patient_overview: [
{ pattern: /^overzicht\s+\w+/i, weight: 1.0 },
{ pattern: /^dashboard\s+\w+/i, weight: 1.0 },
{ pattern: /^pati[eë]nt(en)?overzicht\b/i, weight: 0.9 },
{ pattern: /^toon\s+(alles|info)\s+(van\s+)?\w+/i, weight: 0.85 },
]
```
**Entities:**
```typescript
{
patientName: string;
}
```
**Output:** `PatientDashboardBlock` - toont:
- Basisgegevens (naam, geboortedatum, BSN)
- Recente intakes
- Agenda afspraken
- Actief behandelplan (doelen/interventies count)
---
#### 🟡 MEDIUM Priority — `rapportage_query`
**Input voorbeelden:**
- "Toon rapportages van Jan"
- "Wat is er gerapporteerd deze week?"
- "Rapportages vandaag"
- "Notities van Marie"
**Pattern matching (Reflex):**
```typescript
rapportage_query: [
{ pattern: /^(toon\s+)?rapportages?\b/i, weight: 1.0 },
{ pattern: /^wat\s+is\s+er\s+gerapporteerd\b/i, weight: 0.95 },
{ pattern: /^overzicht\s+notities\b/i, weight: 0.9 },
{ pattern: /^rapportages?\s+(van\s+)?\w+/i, weight: 0.9 },
{ pattern: /^notities\s+(van\s+)?\w+/i, weight: 0.85 },
]
```
**Entities:**
```typescript
{
patientName?: string;
dateRange?: { start: Date; end: Date; label: string };
category?: VerpleegkundigCategory; // optioneel filter
}
```
**Benodigde UI:** `RapportageQueryBlock` (nieuw) - lijst van rapportages met:
- Periode filter (vandaag, week, maand)
- Categorie filter (medicatie, adl, gedrag, etc.)
- Sorteer opties (datum, categorie)
---
#### 🟡 MEDIUM Priority — `behandelplan_query`
**Input voorbeelden:**
- "Wat is het behandelplan van Jan?"
- "Toon doelen van Marie"
- "Behandelplan"
- "Welke interventies heeft Jan?"
**Pattern matching (Reflex):**
```typescript
behandelplan_query: [
{ pattern: /^(toon\s+)?behandelplan\b/i, weight: 1.0 },
{ pattern: /^wat\s+(zijn|is)\s+(het\s+)?behandelplan\b/i, weight: 0.95 },
{ pattern: /^(toon\s+)?doelen\b/i, weight: 0.9 },
{ pattern: /^(toon\s+)?interventies\b/i, weight: 0.9 },
{ pattern: /^behandelplan\s+(van\s+)?\w+/i, weight: 0.9 },
]
```
**Entities:**
```typescript
{
patientName?: string;
queryFocus?: 'doelen' | 'interventies' | 'leefgebieden' | 'alles';
}
```
**Benodigde UI:** `BehandelplanQueryBlock` (nieuw) of hergebruik `BehandelplanView`:
- Hulpvraag weergave
- Leefgebieden scores
- Doelen lijst
- Interventies lijst
---
#### 🟡 MEDIUM Priority — `risico_query`
**Input voorbeelden:**
- "Wat zijn de risico's van Jan?"
- "Toon risicotaxatie"
- "Risico's"
- "Veiligheidsplan"
**Pattern matching (Reflex):**
```typescript
risico_query: [
{ pattern: /^(toon\s+)?risico['']?s?\b/i, weight: 1.0 },
{ pattern: /^wat\s+zijn\s+(de\s+)?risico['']?s?\b/i, weight: 0.95 },
{ pattern: /^risicotaxatie\b/i, weight: 0.95 },
{ pattern: /^veiligheidsplan\b/i, weight: 0.8 },
{ pattern: /^risico['']?s?\s+(van\s+)?\w+/i, weight: 0.9 },
]
```
**Entities:**
```typescript
{
patientName?: string;
riskType?: 'suicidaliteit' | 'agressie' | 'valrisico' | 'all';
}
```
**Benodigde UI:** Hergebruik `RisksBlock` uit verpleegrapportage:
- Risico's gesorteerd op niveau (zeer_hoog → laag)
- Met rationale en maatregelen
- High risk count badge
---
### 8.3 Implementatie Impact Query Intents
| Intent | Types Wijziging | Patterns Wijziging | UI Wijziging | Complexiteit |
|--------|----------------|-------------------|--------------|--------------|
| `patient_overview` | ✅ Toevoegen | ✅ Toevoegen | ❌ Bestaat al | **Laag** |
| `rapportage_query` | ✅ Toevoegen | ✅ Toevoegen | 🆕 Nieuw block | **Middel** |
| `behandelplan_query` | ✅ Toevoegen | ✅ Toevoegen | ⚠️ Wrap bestaand | **Middel** |
| `risico_query` | ✅ Toevoegen | ✅ Toevoegen | ⚠️ Wrap bestaand | **Middel** |
---
## 9. Toekomstige Uitbreidingen (Post-MVP)
### 9.1 Potentiële Nieuwe Actie Intents
| Intent | Use Case | Prioriteit |
|--------|----------|------------|
| `medicatie_toediening` | "Geef Jan zijn medicatie" | Medium |
| `vitals_registratie` | "Bloeddruk Jan 120/80" | Medium |
| `taak_aanmaken` | "Herinnering morgen 10:00" | Low |
| `bericht_sturen` | "Mail naar huisarts" | Low |
### 9.2 Potentiële Nieuwe Nudges
| ID | Trigger | Suggestie |
|----|---------|-----------|
| `vitals-afwijkend` | Vitals met H/L interpretatie | Arts informeren |
| `lithium-lab` | Medicatie notitie + "lithium" | Lab aanvragen |
| `overdracht-einde-dienst` | Einde dienst nadert | Overdracht schrijven |
| `kindcheck-reminder` | Na intake met kinderen | Kindcheck uitvoeren |
---
## 10. Referenties
- Bouwplan: `docs/intent/bouwplan-cortex-v2.md`
- Architecture: `docs/intent/architecture-cortex-v2.md`
- MVP User Stories: `docs/intent/mvp-userstories-intent-system.md`
- Huidige nudge implementatie: `lib/cortex/nudge.ts`
- Intent types: `lib/cortex/types.ts`
- Reflex classifier: `lib/cortex/reflex-classifier.ts`
- Report types: `lib/types/report.ts`
- Risk types: `app/epd/patients/[id]/intakes/[intakeId]/risk/components/risk-manager.tsx`
- PatientDashboardBlock: `components/cortex/blocks/patient-dashboard-block.tsx`
- OverdrachtBlock: `components/cortex/blocks/overdracht-block.tsx`
- BehandelplanView: `components/behandelplan/behandelplan-view.tsx`
- RisksBlock: `app/epd/verpleegrapportage/components/blocks/risks-block.tsx`
---
## Versiehistorie
| Versie | Datum | Auteur | Wijziging |
|--------|-------|--------|-----------|
| v1.0 | 01-01-2026 | Colin Lit | Initiële analyse document |
| v1.1 | 01-01-2026 | Colin Lit | Query intents analyse toegevoegd (rapportage, behandelplan, risico, dashboard) |

View File

@@ -0,0 +1,86 @@
# Intent-Driven Design for Healthcare: A Framework Gap Analysis
The search for an established framework combining language-first interface design, multi-intent recognition, context-aware execution, and proactive suggestions for professional healthcare software reveals a significant gap. **No comprehensive, published methodology exists that matches all specified criteria**, though several emerging frameworks address individual components. This gap represents both a validation of the proposed approach's novelty and an opportunity for framework development.
## The closest existing framework: IBM's Natural Conversation Framework
The **IBM Natural Conversation Framework (NCF)**, published by ACM Books in 2019, represents the most academically rigorous methodology for language-first interface design. Developed by Robert J. Moore and Raphael Arar at IBM Research-Almaden, NCF is grounded in **Conversation Analysis** from social sciences and offers over 100 reusable conversational UX patterns organized into 15 activity modules.
NCF explicitly treats language as the primary interface paradigm rather than an add-on, replacing traditional wireframes with sample dialogs and sequence metrics. Its four core components—an interaction model of "expandable sequences," a six-slot content format, a pattern language, and navigation methods—provide systematic tools for designing conversational experiences. The framework handles context through sequential understanding across turns, distinguishes between local and global intents, and includes sophisticated repair mechanisms for error recovery.
However, NCF was designed for general enterprise applications and lacks healthcare-specific adaptations. It does not address clinical workflows, medical terminology handling, or the proactive suggestion patterns ("nudges") that distinguish modern agentic systems. While healthcare chapters exist in the broader NCF literature, these focus on chatbots rather than primary clinical interfaces.
## Emerging agentic AI design patterns fill part of the gap
Microsoft's **Agent UX Design Principles**, published in April 2025, introduces concepts that closely align with the proposed framework. The principle of "nudging more than notifying" explicitly describes systems that "proactively start chats, create artifacts, and dynamically generate cues" rather than delivering static notifications. Microsoft's temporal framework distinguishes between agents "reflecting on history" (using memory/context), operating in the present through nudges, and "adapting and evolving" for future interactions.
The **Shape of AI** pattern library offers the most comprehensive UX taxonomy for agentic interfaces, organizing patterns into categories including:
- **Wayfinders**: Suggestions, nudges, and follow-up patterns that help users navigate capabilities
- **Prompt Actions**: Transform, expand, summarize, and chained action patterns for multi-step execution
- **Governors**: Action plans, verification, and "stream of thought" patterns for human oversight
- **Trust Builders**: Citations, footprints, and consent patterns for transparency
Google Cloud's **Agentic AI Design Patterns** provides architectural templates including sequential, parallel, coordinator, and hierarchical task decomposition patterns—useful for implementing multi-intent recognition and complex clinical workflows.
## Healthcare NLI remains focused on documentation, not primary interfaces
The dominant paradigm in healthcare natural language interfaces is **ambient clinical intelligence**—systems like Nuance DAX Copilot and AWS HealthScribe that capture clinician-patient conversations and generate documentation. These operate as sophisticated assistants augmenting traditional EHR interfaces rather than replacing them. **70% of clinicians** using ambient AI report reduced burnout, validating the speech-first approach, but these systems address documentation burden rather than reimagining the entire interaction model.
**Oracle Health EHR**, which received regulatory approval in November 2025 for ambulatory use, represents the first major departure from this pattern. Designed explicitly as a "voice-first intelligent solution," Oracle's approach enables clinicians to navigate the entire EHR through spoken commands: "Show me the patient's latest MRI results" rather than multi-menu navigation. The system synthesizes data from multiple sources and delivers contextual insights conversationally. However, as a commercial product launched recently, published design methodology documentation remains limited.
Academic research identified several healthcare-specific design principles including the **TURF framework** for EHR usability and the **Three-Phase User-Centered XAI-CDSS Framework** for clinical decision support. A critical finding from Frontiers in Computer Science's systematic review of 127 papers: clinicians prefer documentation methods aligned with workflows, and many resist AI-CDSS when they perceive no need for data support—emphasizing that successful NLI design must integrate seamlessly with existing clinical mental models.
## The proposed CAPTURE-INTERPRET-GOAL-EXECUTE-NUDGE pattern appears novel
Mapping existing frameworks against the proposed pattern reveals partial coverage but no complete alignment:
| Framework | CAPTURE | INTERPRET | GOAL | EXECUTE | NUDGE |
|-----------|---------|-----------|------|---------|-------|
| IBM NCF | Opening patterns | Intent recognition, repair | Activity modules | Sequence closers | Next-topic patterns (limited) |
| Microsoft Agent UX | Accessible entry | Context awareness | User-defined goals | Multi-modal actions | **Explicit "nudging" principle** |
| Shape of AI | Wayfinders | Tuners, filters | Prompt actions | Chained actions | Suggestions, nudges |
| Ambient AI (DAX) | Speech capture | NLU parsing | Documentation focus | Note generation | None |
The **NUDGE component**—proactive, context-aware suggestions that anticipate clinician needs—represents the least developed aspect in existing frameworks. Microsoft's principle comes closest, describing agents that "dynamically generate cues" based on context, but no healthcare-specific implementation methodology exists. This proactive layer distinguishes intent-driven interfaces from reactive voice command systems.
## Dutch healthcare context reveals significant implementation gaps
The Netherlands has **no published frameworks** for conversational or intent-driven EPD design. Current Dutch healthcare AI focuses primarily on speech-to-text documentation automation through vendors like Wellcom Health and HealthTalk.ai, addressing "registratielast" (registration burden) rather than reimagining interface paradigms.
Key Dutch resources include **MedRoBERTa.nl**, the first domain-specific language model for Dutch Electronic Health Records developed at VU Amsterdam. Pre-trained on 13GB of text from nearly 10 million hospital notes, MedRoBERTa.nl addresses unique Dutch medical language characteristics—shorter sentences, omitted functional words, specialized vocabulary differing from standard Dutch. This provides a foundation for Dutch clinical NLU but lacks accompanying interface design methodology.
**Nictiz**, the national standards organization, maintains **Zorginformatiebouwstenen (ZIBs)**—healthcare information building blocks providing standardized definitions for medical concepts linked to SNOMED CT, LOINC, and ICD. The "Eenheid van Taal" (Unity of Language) principle establishes semantic foundations that could support intent-driven interfaces, but no guidance exists for conversational design patterns.
**Platform AiGGz** provides GGZ-specific AI guidance, and the AI Kompas voor de Geestelijke Gezondheidszorg offers implementation frameworks. However, author Nicky Hekster notes "veel versnippering" (much fragmentation)—applications don't scale and coordination is lacking. Mental healthcare presents additional design challenges: clinicians prefer narrative documentation to capture uncertainty and nuance, workarounds are common when systems don't fit psychiatric workflows, and the therapeutic relationship creates unique considerations for voice interfaces.
## Recommended framework synthesis approach
Given the absence of a single comprehensive methodology, constructing a framework requires synthesizing elements from multiple sources:
**For design methodology (replacing wireframes):** Adapt IBM NCF's sample dialog and sequence metric approaches. NCF's 15 activity modules and 70+ patterns provide systematic tools for mapping user utterances to system behaviors. Design artifacts should include intent-system maps, dialog flow documentation, and conversational activity patterns rather than traditional screen wireframes.
**For multi-intent recognition and context awareness:** Apply Google Cloud's agentic patterns for handling complex, multi-step clinical workflows. The coordinator and hierarchical task decomposition patterns address scenarios where clinicians express compound intents ("Check the medication interactions and schedule a follow-up if the renal function allows it").
**For proactive suggestions (nudges):** Extend Microsoft's "nudging more than notifying" principle with the Shape of AI's wayfinder patterns. Design for context-triggered suggestions that surface relevant clinical information before the clinician explicitly requests it—medication alerts based on documented symptoms, care pathway recommendations based on diagnosis patterns.
**For healthcare-specific adaptation:** Incorporate the user-centered XAI-CDSS framework's emphasis on workflow alignment, the ambient AI literature's integration patterns, and mental health-specific considerations from the GGZ literature regarding narrative flexibility and therapeutic context.
**For Dutch implementation:** Build on MedRoBERTa.nl for language understanding, align with ZIB semantic standards for clinical concept mapping, and address the "registratielast" concern by demonstrating documentation efficiency gains alongside the interface paradigm shift.
## Key terminology note: the field lacks standard vocabulary
The search revealed no established terminology for this design approach. "Intent-driven design," "language-first interface design," "utterance-driven design," and "conversational design for enterprise" return general conversational AI resources rather than specific methodologies. "Agentic interface design" yields results focused on technical architecture rather than UX methodology. The closest established terms are:
- **Conversational UX Design** (IBM NCF's preferred terminology)
- **Voice-First Design** (common but typically consumer-focused)
- **Agent UX** (Microsoft's emerging terminology)
- **Natural Language Interface Design** (academic, broader scope)
The absence of standardized terminology reinforces the novelty of the proposed approach and suggests opportunity for establishing definitional frameworks alongside the design methodology.
## Conclusion
The research confirms that while individual components of intent-driven healthcare interface design exist across multiple frameworks, **no comprehensive methodology combines language-first primary interfaces, multi-intent clinical workflow recognition, context-aware action execution, and proactive clinical suggestions**. IBM's Natural Conversation Framework provides the strongest methodological foundation for conversational design, Microsoft's Agent UX principles introduce the critical "nudging" concept, and Oracle's voice-first EHR demonstrates commercial viability of primary voice interfaces in clinical settings.
For Dutch GGZ EPD development, the opportunity exists to synthesize these elements into a novel framework. The combination of MedRoBERTa.nl for Dutch clinical NLU, ZIB semantic standards for concept mapping, and adapted NCF patterns for conversational structure could form the basis for a CAPTURE→INTERPRET→GOAL→EXECUTE→NUDGE methodology specifically designed for mental healthcare workflows. Given the documented fragmentation in Dutch healthcare AI initiatives and the absence of published frameworks, such a methodology would represent a genuine contribution to the field.

View File

@@ -0,0 +1,523 @@
# 📝 Dataset: GGZ Zinnen voor Cortex V2
**Datum:** 01-01-2026
**Status:** Training & Test Dataset
**Auteur:** Colin Lit (met AI-assistentie)
---
## 1. Inleiding
Dit document bevat een uitgebreide dataset van GGZ-specifieke zinnen die gebruikt kunnen worden voor:
- Training van het intent classificatiesysteem
- Testing van de Reflex Arc (Layer 1)
- Evaluatie van de AI Orchestrator (Layer 2)
- Validatie van Nudge triggers (Layer 3)
### 1.1 Structuur per Zin
```typescript
{
input: string; // De invoerzin
expectedIntent: CortexIntent | CortexIntent[]; // Verwachte intent(s)
expectedEntities?: object; // Verwachte entities
shouldEscalate?: boolean; // Of Layer 2 nodig is
shouldTriggerNudge?: string; // Welke nudge verwacht wordt
priority?: 'high' | 'medium' | 'low'; // GGZ urgentie
context?: string; // GGZ context/scenario
}
```
---
## 2. Single Intent Zinnen
### 2.1 Dagnotitie — Medicatie
| Input | Expected Intent | Entities | Nudge Trigger | Context |
|-------|-----------------|----------|---------------|---------|
| "Notitie Jan medicatie ingenomen" | `dagnotitie` | `{patientName: "Jan", category: "medicatie"}` | — | Routine medicatie registratie |
| "Jan heeft zijn antipsychotica geweigerd" | `dagnotitie` | `{patientName: "Jan", category: "medicatie", content: "antipsychotica geweigerd"}` | — | Medicatie weigering |
| "Medicatie Jan gewijzigd naar Olanzapine 10mg" | `dagnotitie` | `{patientName: "Jan", category: "medicatie"}` | `medicatie-controle` | Medicatie aanpassing |
| "Marie gestart met Lithium vandaag" | `dagnotitie` | `{patientName: "Marie", category: "medicatie"}` | `medicatie-controle` | Nieuwe medicatie start |
| "Piet klaagt over bijwerkingen quetiapine" | `dagnotitie` | `{patientName: "Piet", category: "medicatie"}` | — | Bijwerkingen |
| "Depakine spiegel afgenomen bij Sophie" | `dagnotitie` | `{patientName: "Sophie", category: "medicatie"}` | — | Lab controle |
| "PRN Oxazepam 10mg gegeven aan Kees om 14:00" | `dagnotitie` | `{patientName: "Kees", category: "medicatie"}` | — | PRN medicatie |
| "Medicatie voor Anna klaargelegd voor de nacht" | `dagnotitie` | `{patientName: "Anna", category: "medicatie"}` | — | Medicatie voorbereiding |
| "Jan weigert al 3 dagen zijn medicatie" | `dagnotitie` | `{patientName: "Jan", category: "medicatie", severity: "high"}` | `gedrag-risico-update` | Langdurige weigering |
| "Clozapine spiegel te laag, dosering verhoogd" | `dagnotitie` | `{category: "medicatie"}` | `medicatie-controle` | Dosisaanpassing |
### 2.2 Dagnotitie — Gedrag & Observatie
| Input | Expected Intent | Entities | Nudge Trigger | Context |
|-------|-----------------|----------|---------------|---------|
| "Jan is vandaag rustig en coöperatief" | `dagnotitie` | `{patientName: "Jan", category: "observatie"}` | — | Positieve observatie |
| "Marie vertoont toenemende onrust" | `dagnotitie` | `{patientName: "Marie", category: "gedrag"}` | `gedrag-risico-update` | Gedragsverandering |
| "Piet was agressief naar medepatiënt" | `dagnotitie` | `{patientName: "Piet", category: "gedrag"}` | `gedrag-risico-update` | Agressie incident |
| "Sophie hoort stemmen sinds gisteren" | `dagnotitie` | `{patientName: "Sophie", category: "observatie"}` | — | Psychotische symptomen |
| "Kees is geagiteerd en loopt veel te ijsberen" | `dagnotitie` | `{patientName: "Kees", category: "gedrag"}` | `gedrag-risico-update` | Agitatie |
| "Anna heeft slecht geslapen afgelopen nacht" | `dagnotitie` | `{patientName: "Anna", category: "observatie"}` | — | Slaapprobleem |
| "Jan trekt zich terug en communiceert minimaal" | `dagnotitie` | `{patientName: "Jan", category: "gedrag"}` | — | Sociaal terugtrekken |
| "Marie is verward en gedesoriënteerd" | `dagnotitie` | `{patientName: "Marie", category: "observatie"}` | `gedrag-risico-update` | Verwardheid |
| "Piet heeft goed gegeten vandaag" | `dagnotitie` | `{patientName: "Piet", category: "adl"}` | — | ADL positief |
| "Sophie weigert te eten sinds 2 dagen" | `dagnotitie` | `{patientName: "Sophie", category: "adl"}` | `adl-zorgplan-update` | ADL verslechtering |
### 2.3 Dagnotitie — Crisis & Veiligheid (HIGH PRIORITY)
| Input | Expected Intent | Entities | Nudge Trigger | Priority | Context |
|-------|-----------------|----------|---------------|----------|---------|
| "Jan spreekt over suïcide" | `dagnotitie` | `{patientName: "Jan", category: "observatie", severity: "high"}` | `suicidaliteit-veiligheidsplan` | 🔴 HIGH | Suïcidaliteit signaal |
| "Marie heeft zelfbeschadiging gepleegd" | `dagnotitie` | `{patientName: "Marie", category: "incident", severity: "high"}` | `suicidaliteit-veiligheidsplan` | 🔴 HIGH | Automutilatie |
| "Crisis: Piet dreigt met geweld" | `dagnotitie` | `{patientName: "Piet", category: "incident", severity: "high"}` | `crisis-team-informeren` | 🔴 HIGH | Geweld dreiging |
| "Sophie probeert weg te lopen" | `dagnotitie` | `{patientName: "Sophie", category: "incident"}` | `incident-mic-melding` | 🔴 HIGH | Weglopen |
| "Acuut: Kees is psychotisch en onhandelbaar" | `dagnotitie` | `{patientName: "Kees", category: "incident", severity: "high"}` | `crisis-team-informeren` | 🔴 HIGH | Acute psychose |
| "Jan heeft doodswensen geuit vanavond" | `dagnotitie` | `{patientName: "Jan", severity: "high"}` | `suicidaliteit-veiligheidsplan` | 🔴 HIGH | Suïcidaliteit |
| "Separatie ingezet bij Marie om 15:00" | `dagnotitie` | `{patientName: "Marie", category: "incident"}` | `incident-mic-melding` | 🔴 HIGH | Separatie |
| "Dwangmedicatie toegediend bij Piet" | `dagnotitie` | `{patientName: "Piet", category: "medicatie", severity: "high"}` | `incident-mic-melding` | 🔴 HIGH | Dwangmedicatie |
| "Jan gevallen in gang, geen letsel" | `dagnotitie` | `{patientName: "Jan", category: "incident"}` | `incident-mic-melding` | 🟡 MEDIUM | Valincident |
| "Fixatie toegepast na agressie incident" | `dagnotitie` | `{category: "incident", severity: "high"}` | `incident-mic-melding` | 🔴 HIGH | Fixatie |
### 2.4 Dagnotitie — ADL & Zorg
| Input | Expected Intent | Entities | Nudge Trigger | Context |
|-------|-----------------|----------|---------------|---------|
| "Jan geholpen met douchen" | `dagnotitie` | `{patientName: "Jan", category: "adl"}` | — | ADL ondersteuning |
| "Marie weigert persoonlijke verzorging" | `dagnotitie` | `{patientName: "Marie", category: "adl"}` | `adl-zorgplan-update` | ADL weigering |
| "Wond verzorgd bij Piet, ziet er goed uit" | `dagnotitie` | `{patientName: "Piet", category: "adl"}` | `wondzorg-controle` | Wondzorg |
| "Sophie heeft hulp nodig bij aankleden" | `dagnotitie` | `{patientName: "Sophie", category: "adl"}` | `adl-zorgplan-update` | Toenemende hulpbehoefte |
| "Decubitus plek gecontroleerd, graad 2" | `dagnotitie` | `{category: "adl"}` | `wondzorg-controle` | Decubitus |
| "Kees kan niet meer zelfstandig naar toilet" | `dagnotitie` | `{patientName: "Kees", category: "adl"}` | `adl-zorgplan-update` | ADL achteruitgang |
| "Anna heeft goed ontbeten vandaag" | `dagnotitie` | `{patientName: "Anna", category: "adl"}` | — | Voeding positief |
| "Jan is 3 kilo afgevallen deze week" | `dagnotitie` | `{patientName: "Jan", category: "observatie"}` | — | Gewichtsverlies |
### 2.5 Zoeken
| Input | Expected Intent | Entities | Context |
|-------|-----------------|----------|---------|
| "Zoek Jan" | `zoeken` | `{query: "Jan"}` | Simpel zoeken |
| "Wie is mevrouw De Vries?" | `zoeken` | `{query: "De Vries"}` | Formeel zoeken |
| "Dossier Marie" | `zoeken` | `{query: "Marie"}` | Dossier opvragen |
| "Vind patiënt Pietersen" | `zoeken` | `{query: "Pietersen"}` | Achternaam zoeken |
| "Zoek BSN 123456789" | `zoeken` | `{query: "123456789"}` | BSN zoeken |
| "Patiënt met kamer 12" | `zoeken` | `{query: "kamer 12"}` | Locatie zoeken |
| "Wie ligt er op afdeling 3?" | `zoeken` | `{query: "afdeling 3"}` | Afdeling zoeken |
### 2.6 Agenda Query
| Input | Expected Intent | Entities | Context |
|-------|-----------------|----------|---------|
| "Agenda vandaag" | `agenda_query` | `{dateRange: {label: "vandaag"}}` | Dag overzicht |
| "Wat heb ik morgen?" | `agenda_query` | `{dateRange: {label: "morgen"}}` | Morgen |
| "Afspraken deze week" | `agenda_query` | `{dateRange: {label: "deze week"}}` | Week overzicht |
| "Hoeveel intakes heb ik nog?" | `agenda_query` | `{appointmentType: "intake"}` | Type filter |
| "Wanneer is mijn volgende afspraak met Jan?" | `agenda_query` | `{patientName: "Jan"}` | Patiënt filter |
| "Alle huisbezoeken komende week" | `agenda_query` | `{appointmentType: "huisbezoek", dateRange: {label: "volgende week"}}` | Type + periode |
| "Crisisdienst schema" | `agenda_query` | `{appointmentType: "crisis"}` | Crisis planning |
### 2.7 Overdracht
| Input | Expected Intent | Entities | Context |
|-------|-----------------|----------|---------|
| "Overdracht" | `overdracht` | `{}` | Standaard overdracht |
| "Dienst afronden" | `overdracht` | `{}` | Einde dienst |
| "Samenvatting voor collega" | `overdracht` | `{}` | Collega overdracht |
| "Wat is er gebeurd vandaag?" | `overdracht` | `{dateRange: {label: "vandaag"}}` | Dag samenvatting |
| "Overdracht avonddienst" | `overdracht` | `{shift: "avond"}` | Avond overdracht |
| "Aandachtspunten voor de nacht" | `overdracht` | `{shift: "nacht"}` | Nacht overdracht |
### 2.8 Afspraak Maken
| Input | Expected Intent | Entities | Context |
|-------|-----------------|----------|---------|
| "Plan intake Jan morgen 14:00" | `create_appointment` | `{patientName: "Jan", appointmentType: "intake", datetime: {...}}` | Intake plannen |
| "Maak behandelafspraak Marie vrijdag" | `create_appointment` | `{patientName: "Marie", appointmentType: "behandeling"}` | Behandeling |
| "Huisbezoek bij Piet volgende week" | `create_appointment` | `{patientName: "Piet", appointmentType: "huisbezoek"}` | Huisbezoek |
| "Online consult Sophie woensdag 10:00" | `create_appointment` | `{patientName: "Sophie", appointmentType: "online", datetime: {...}}` | Online |
| "Plan evaluatie medicatie voor Kees" | `create_appointment` | `{patientName: "Kees", appointmentType: "follow-up"}` | Follow-up |
| "Crisisafspraak vandaag voor Anna" | `create_appointment` | `{patientName: "Anna", appointmentType: "crisis", dateRange: {label: "vandaag"}}` | Crisis |
| "Bel-afspraak Jan overmorgen" | `create_appointment` | `{patientName: "Jan", appointmentType: "telefonisch"}` | Telefonisch |
### 2.9 Afspraak Annuleren
| Input | Expected Intent | Entities | Context |
|-------|-----------------|----------|---------|
| "Annuleer afspraak Jan" | `cancel_appointment` | `{patientName: "Jan"}` | Simpel annuleren |
| "Zeg Marie van morgen af" | `cancel_appointment` | `{patientName: "Marie", datetime: {...}}` | Specifieke dag |
| "Cancel intake Piet" | `cancel_appointment` | `{patientName: "Piet", appointmentType: "intake"}` | Type specifiek |
| "Afspraak van 14:00 afzeggen" | `cancel_appointment` | `{datetime: {time: "14:00"}}` | Tijd specifiek |
### 2.10 Afspraak Verzetten
| Input | Expected Intent | Entities | Context |
|-------|-----------------|----------|---------|
| "Verzet Jan naar volgende week" | `reschedule_appointment` | `{patientName: "Jan", newDatetime: {...}}` | Verzetten |
| "Verplaats de intake naar vrijdag" | `reschedule_appointment` | `{appointmentType: "intake", newDatetime: {...}}` | Type specifiek |
| "Marie's afspraak 1 uur later" | `reschedule_appointment` | `{patientName: "Marie", newDatetime: {...}}` | Relatief |
---
## 3. Query Intents (Nieuw in V2)
### 3.1 Patient Overview
| Input | Expected Intent | Entities | Context |
|-------|-----------------|----------|---------|
| "Overzicht Jan" | `patient_overview` | `{patientName: "Jan"}` | Basis overzicht |
| "Dashboard Marie" | `patient_overview` | `{patientName: "Marie"}` | Dashboard |
| "Toon alles van Piet" | `patient_overview` | `{patientName: "Piet"}` | Volledig overzicht |
| "Patiëntoverzicht Sophie" | `patient_overview` | `{patientName: "Sophie"}` | Formeel |
| "Wie is Jan en wat speelt er?" | `patient_overview` | `{patientName: "Jan"}` | Context vraag |
| "Geef me info over Kees" | `patient_overview` | `{patientName: "Kees"}` | Informeel |
### 3.2 Rapportage Query
| Input | Expected Intent | Entities | Context |
|-------|-----------------|----------|---------|
| "Toon rapportages Jan" | `rapportage_query` | `{patientName: "Jan"}` | Alle rapportages |
| "Wat is er gerapporteerd deze week?" | `rapportage_query` | `{dateRange: {label: "deze week"}}` | Periode filter |
| "Medicatie notities Marie afgelopen maand" | `rapportage_query` | `{patientName: "Marie", category: "medicatie", dateRange: {...}}` | Categorie filter |
| "Incidenten van Piet" | `rapportage_query` | `{patientName: "Piet", category: "incident"}` | Incident filter |
| "Alle gedragsobservaties vandaag" | `rapportage_query` | `{category: "gedrag", dateRange: {label: "vandaag"}}` | Type + periode |
| "Voortgangsrapportages Sophie" | `rapportage_query` | `{patientName: "Sophie", reportType: "voortgang"}` | Report type |
| "Laatste 5 notities van Jan" | `rapportage_query` | `{patientName: "Jan", limit: 5}` | Limiet |
### 3.3 Behandelplan Query
| Input | Expected Intent | Entities | Context |
|-------|-----------------|----------|---------|
| "Wat is het behandelplan van Jan?" | `behandelplan_query` | `{patientName: "Jan"}` | Volledig plan |
| "Toon doelen van Marie" | `behandelplan_query` | `{patientName: "Marie", queryFocus: "doelen"}` | Doelen focus |
| "Behandelplan" | `behandelplan_query` | `{}` | Context-afhankelijk |
| "Welke interventies heeft Piet?" | `behandelplan_query` | `{patientName: "Piet", queryFocus: "interventies"}` | Interventies |
| "Leefgebieden scores Sophie" | `behandelplan_query` | `{patientName: "Sophie", queryFocus: "leefgebieden"}` | Leefgebieden |
| "Hulpvraag van Kees" | `behandelplan_query` | `{patientName: "Kees", queryFocus: "hulpvraag"}` | Hulpvraag |
### 3.4 Risico Query
| Input | Expected Intent | Entities | Context |
|-------|-----------------|----------|---------|
| "Wat zijn de risico's van Jan?" | `risico_query` | `{patientName: "Jan"}` | Alle risico's |
| "Toon risicotaxatie Marie" | `risico_query` | `{patientName: "Marie"}` | Risicotaxatie |
| "Suïciderisico van Piet" | `risico_query` | `{patientName: "Piet", riskType: "suicidaliteit"}` | Specifiek risico |
| "Risico's" | `risico_query` | `{}` | Context-afhankelijk |
| "Veiligheidsplan Sophie" | `risico_query` | `{patientName: "Sophie", riskType: "suicidaliteit"}` | Veiligheidsplan |
| "Agressierisico van Kees" | `risico_query` | `{patientName: "Kees", riskType: "agressie"}` | Specifiek |
| "Wie heeft hoog risico?" | `risico_query` | `{riskLevel: "hoog"}` | Niveau filter |
---
## 4. Multi-Intent Zinnen (Layer 2 Required)
### 4.1 Notitie + Afspraak
| Input | Expected Intents | Entities | Context |
|-------|------------------|----------|---------|
| "Zeg Jan af en maak notitie dat hij ziek is" | `[cancel_appointment, dagnotitie]` | `[{patientName: "Jan"}, {patientName: "Jan", content: "ziek"}]` | Annulering + reden |
| "Plan follow-up Marie en noteer dat medicatie werkt" | `[create_appointment, dagnotitie]` | `[{patientName: "Marie", appointmentType: "follow-up"}, {patientName: "Marie", category: "medicatie"}]` | Afspraak + notitie |
| "Intake gedaan bij Piet, plan evaluatie over 2 weken" | `[dagnotitie, create_appointment]` | `[{patientName: "Piet", category: "observatie"}, {patientName: "Piet", appointmentType: "follow-up"}]` | Notitie + follow-up |
### 4.2 Notitie + Notitie
| Input | Expected Intents | Entities | Context |
|-------|------------------|----------|---------|
| "Jan medicatie gegeven en hij is rustig vandaag" | `[dagnotitie, dagnotitie]` | `[{patientName: "Jan", category: "medicatie"}, {patientName: "Jan", category: "observatie"}]` | Meerdere categorieën |
| "Marie heeft gegeten en is gedoucht met hulp" | `[dagnotitie, dagnotitie]` | `[{patientName: "Marie", category: "adl"}, {patientName: "Marie", category: "adl"}]` | Meerdere ADL |
### 4.3 Query + Actie
| Input | Expected Intents | Entities | Context |
|-------|------------------|----------|---------|
| "Toon agenda en plan intake Jan morgen" | `[agenda_query, create_appointment]` | `[{dateRange: {...}}, {patientName: "Jan", appointmentType: "intake"}]` | Overzicht + actie |
| "Check risico's van Marie en maak notitie" | `[risico_query, dagnotitie]` | `[{patientName: "Marie"}, {patientName: "Marie"}]` | Query + notitie |
### 4.4 GGZ-Specifieke Combinaties
| Input | Expected Intents | Entities | Priority | Context |
|-------|------------------|----------|----------|---------|
| "Crisis bij Jan, separeer en informeer psychiater" | `[dagnotitie, dagnotitie]` | `[{patientName: "Jan", category: "incident"}, {patientName: "Jan", category: "incident"}]` | 🔴 HIGH | Crisis protocol |
| "Dwangmedicatie bij Marie, MIC invullen" | `[dagnotitie, dagnotitie]` | `[{patientName: "Marie", category: "medicatie"}, {patientName: "Marie", category: "incident"}]` | 🔴 HIGH | Dwang + melding |
| "Plan ontslaggesprek Piet en maak overdracht" | `[create_appointment, overdracht]` | `[{patientName: "Piet"}, {}]` | 🟡 MEDIUM | Ontslag planning |
---
## 5. Context-Afhankelijke Zinnen (Pronoun Resolution)
### 5.1 Pronoun "Hij/Zij/Hem/Haar"
| Input | Context | Expected Resolution | Expected Intent |
|-------|---------|---------------------|-----------------|
| "Maak notitie voor hem" | activePatient: Jan | patientName: "Jan", patientResolution: "pronoun" | `dagnotitie` |
| "Zij is vandaag rustig" | activePatient: Marie | patientName: "Marie", patientResolution: "pronoun" | `dagnotitie` |
| "Geef hem zijn medicatie" | activePatient: Piet | patientName: "Piet", patientResolution: "pronoun" | `dagnotitie` |
| "Plan afspraak voor haar" | activePatient: Sophie | patientName: "Sophie", patientResolution: "pronoun" | `create_appointment` |
| "Wat zijn zijn risico's?" | activePatient: Kees | patientName: "Kees", patientResolution: "pronoun" | `risico_query` |
### 5.2 Demonstratief "Die/Deze/Dezelfde"
| Input | Context | Expected Resolution | Expected Intent |
|-------|---------|---------------------|-----------------|
| "Verzet die afspraak naar morgen" | recentIntent: cancel_appointment voor Jan | patientName: "Jan" | `reschedule_appointment` |
| "Annuleer deze intake" | currentView: appointment detail Jan | patientName: "Jan", appointmentType: "intake" | `cancel_appointment` |
| "Notitie voor dezelfde patiënt" | lastPatient: Marie | patientName: "Marie" | `dagnotitie` |
### 5.3 Impliciete Context
| Input | Context | Expected Resolution | Expected Intent |
|-------|---------|---------------------|-----------------|
| "Medicatie gegeven" | activePatient: Jan | patientName: "Jan", category: "medicatie" | `dagnotitie` |
| "Is rustig vandaag" | activePatient: Marie | patientName: "Marie", category: "observatie" | `dagnotitie` |
| "Behandelplan updaten" | activePatient: Piet | patientName: "Piet" | `behandelplan_query` |
---
## 6. Ambigue Zinnen (Clarification Required)
### 6.1 Intent Ambigu
| Input | Clarification Question | Options | Context |
|-------|------------------------|---------|---------|
| "Jan wondzorg" | "Wil je een notitie maken over wondzorg of een afspraak plannen?" | ["Notitie maken", "Afspraak plannen"] | Onduidelijk actie type |
| "Medicatie Marie" | "Wil je medicatie registreren of de medicatielijst bekijken?" | ["Medicatie notitie", "Medicatielijst"] | Notitie vs query |
| "Plan Jan" | "Wat wil je plannen voor Jan?" | ["Intake", "Behandelafspraak", "Follow-up", "Huisbezoek"] | Type ontbreekt |
| "Overdracht Sophie" | "Wil je de overdracht bekijken of een notitie maken voor overdracht?" | ["Overdracht bekijken", "Notitie voor overdracht"] | Bekijken vs maken |
### 6.2 Patiënt Ambigu
| Input | Clarification Question | Options | Context |
|-------|------------------------|---------|---------|
| "Notitie voor Jan" | "Welke Jan bedoel je?" | ["Jan de Vries (kamer 12)", "Jan Pietersen (kamer 8)"] | Meerdere Jans |
| "Afspraak Marie" | "Bedoel je Marie Bakker of Marie Smit?" | ["Marie Bakker", "Marie Smit"] | Meerdere Maries |
### 6.3 Tijd Ambigu
| Input | Clarification Question | Options | Context |
|-------|------------------------|---------|---------|
| "Plan intake snel" | "Wanneer wil je de intake plannen?" | ["Vandaag", "Morgen", "Deze week"] | Vage tijd |
| "Afspraak binnenkort" | "Welke dag heeft je voorkeur?" | ["Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag"] | Vage tijd |
---
## 7. Nudge-Triggerende Zinnen
### 7.1 HIGH Priority Nudges
| Input | Expected Nudge | Nudge Message | Context |
|-------|----------------|---------------|---------|
| "Jan spreekt over suïcide" | `suicidaliteit-veiligheidsplan` | "⚠️ Veiligheidsplan actualiseren en risicotaxatie bijwerken?" | Suïcidaliteit signaal |
| "Marie heeft zichzelf gesneden" | `suicidaliteit-veiligheidsplan` | "⚠️ Veiligheidsplan actualiseren en risicotaxatie bijwerken?" | Automutilatie |
| "Crisis bij Piet, acuut suïcidaal" | `crisis-team-informeren` | "🚨 Crisisteam en dienstdoende psychiater informeren?" | Acute crisis |
| "Incident: Sophie gevallen met letsel" | `incident-mic-melding` | "⚠️ MIC-melding invullen voor dit incident?" | Val met letsel |
| "Noodgeval: Kees psychotisch en agressief" | `crisis-team-informeren` | "🚨 Crisisteam en dienstdoende psychiater informeren?" | Acute psychose |
| "Fixatie toegepast bij Anna" | `incident-mic-melding` | "⚠️ MIC-melding invullen voor dit incident?" | Vrijheidsbeperkende maatregel |
### 7.2 MEDIUM Priority Nudges
| Input | Expected Nudge | Nudge Message | Context |
|-------|----------------|---------------|---------|
| "Jan was agressief naar verpleegkundige" | `gedrag-risico-update` | "📋 Risicotaxatie bijwerken voor dit gedrag?" | Agressie |
| "Marie vertoont verward gedrag" | `gedrag-risico-update` | "📋 Risicotaxatie bijwerken voor dit gedrag?" | Verwardheid |
| "Piet kan niet meer zelfstandig lopen" | `adl-zorgplan-update` | "🏠 Zorgplan/behandelplan bijwerken voor gewijzigde ADL?" | ADL verslechtering |
| "Sophie weigert persoonlijke verzorging" | `adl-zorgplan-update` | "🏠 Zorgplan/behandelplan bijwerken voor gewijzigde ADL?" | ADL weigering |
| "Wond verzorgd, ziet er goed uit" | `wondzorg-controle` | "Wondcontrole inplannen over 3 dagen?" | Wondzorg |
| "Medicatie gewijzigd naar hogere dosis" | `medicatie-controle` | "Medicatie evaluatie inplannen over 1 week?" | Medicatie wijziging |
### 7.3 LOW Priority Nudges
| Input | Expected Nudge | Nudge Message | Context |
|-------|----------------|---------------|---------|
| "Intake afspraak gepland" | `intake-behandelplan` | "📝 Behandelplan opstellen na de intake?" | Post-intake |
| "Let op: Jan moet extra gecontroleerd worden" | `handover-mark` | "📋 Deze notitie opnemen in de dienst-overdracht?" | Overdracht markering |
| "Belangrijk voor collega: Sophie heeft onrust" | `handover-mark` | "📋 Deze notitie opnemen in de dienst-overdracht?" | Overdracht markering |
---
## 8. Domein-Specifieke Terminologie
### 8.1 GGZ Diagnosen & Symptomen
| Term | Variaties | Context |
|------|-----------|---------|
| Psychose | psychotisch, psychotische symptomen, hallucinaties | Psychiatrisch |
| Depressie | depressief, depressieve, somber, neerslachtig | Stemmingsstoornis |
| Manie | manisch, manische, ontremd | Bipolair |
| Angst | angstig, angststoornis, paniekerig | Angststoornis |
| Persoonlijkheidsstoornis | borderline, antisociaal, vermijdend | Persoonlijkheid |
| Schizofrenie | schizofreen, wanen, stemmen horen | Psychotisch |
| ADHD | hyperactief, ongeconcentreerd, impulsief | Ontwikkeling |
| Autisme | autistisch, prikkelgevoelig, sociale interactie | Ontwikkeling |
| Verslaving | middelengebruik, alcohol, drugs, afhankelijk | Verslaving |
| Dementie | dement, geheugenproblemen, vergeetachtig | Cognitief |
### 8.2 GGZ Interventies
| Term | Variaties | Context |
|------|-----------|---------|
| Separatie | separeren, afgezonderd, isolatie | Dwangmaatregel |
| Fixatie | gefixeerd, bed vastgelegd | Dwangmaatregel |
| Dwangmedicatie | noodmedicatie, gedwongen medicatie | Dwangmaatregel |
| ECT | electroshock, elektroconvulsietherapie | Behandeling |
| CGT | cognitieve gedragstherapie | Therapie |
| EMDR | traumaverwerking | Therapie |
| Groepstherapie | groepsgesprek, groepsbehandeling | Therapie |
### 8.3 GGZ Rollen
| Term | Variaties | Context |
|------|-----------|---------|
| Psychiater | arts, dienstdoende arts | Medisch |
| Verpleegkundige | verpleging, vpk | Zorg |
| Psycholoog | GZ-psycholoog, klinisch psycholoog | Behandeling |
| Sociaal werker | maatschappelijk werker, SW | Begeleiding |
| Ervaringsdeskundige | ED, peer support | Ondersteuning |
| Diëtist | voedingsdeskundige | Zorg |
| Vaktherapeut | beeldend therapeut, PMT | Therapie |
---
## 9. Edge Cases & Speciale Scenarios
### 9.1 Lege of Minimale Input
| Input | Expected Behavior | Handling |
|-------|-------------------|----------|
| "" | Error | "Geen invoer ontvangen" |
| " " | Error | "Geen invoer ontvangen" |
| "hallo" | `unknown` + clarification | "Waarmee kan ik je helpen?" |
| "ja" | Context-afhankelijk | Check pending confirmation |
| "nee" | Context-afhankelijk | Check pending dismissal |
### 9.2 Spelfouten & Variaties
| Input (met fout) | Correcte Interpretatie | Expected Intent |
|------------------|------------------------|-----------------|
| "Medicatei gegeven" | "Medicatie gegeven" | `dagnotitie` |
| "Aganda vandaag" | "Agenda vandaag" | `agenda_query` |
| "Suïcide gedachten" | "Suïcidale gedachten" | `dagnotitie` + nudge |
| "Notiteie Jan" | "Notitie Jan" | `dagnotitie` |
| "Psyhcose" | "Psychose" | `dagnotitie` |
### 9.3 Informele Taal
| Input | Expected Intent | Entities | Context |
|-------|-----------------|----------|---------|
| "Jansen is weer aan het flippen" | `dagnotitie` | `{patientName: "Jansen", category: "gedrag"}` | Informeel gedrag |
| "Die vent wil niet eten" | `dagnotitie` | `{category: "adl"}` | Context-afhankelijk |
| "Pil gegeven om 8 uur" | `dagnotitie` | `{category: "medicatie"}` | Informele medicatie |
| "Mevrouw is weer helemaal de weg kwijt" | `dagnotitie` | `{category: "observatie"}` | Verwardheid |
### 9.4 Gecombineerde Urgentie
| Input | Priority | Expected Behavior |
|-------|----------|-------------------|
| "Crisis bij Jan, suïcidaal en agressief" | 🔴 HIGHEST | Dubbele nudge: `suicidaliteit-veiligheidsplan` + `crisis-team-informeren` |
| "Incident: fixatie na suïcidepoging" | 🔴 HIGHEST | Dubbele nudge: `incident-mic-melding` + `suicidaliteit-veiligheidsplan` |
---
## 10. Testset Statistieken
### 10.1 Verdeling per Intent
| Intent | Aantal Zinnen | Percentage |
|--------|---------------|------------|
| `dagnotitie` | ~85 | 45% |
| `zoeken` | ~10 | 5% |
| `agenda_query` | ~10 | 5% |
| `overdracht` | ~10 | 5% |
| `create_appointment` | ~15 | 8% |
| `cancel_appointment` | ~8 | 4% |
| `reschedule_appointment` | ~6 | 3% |
| `patient_overview` | ~10 | 5% |
| `rapportage_query` | ~12 | 6% |
| `behandelplan_query` | ~10 | 5% |
| `risico_query` | ~10 | 5% |
| Multi-intent | ~15 | 8% |
| **Totaal** | **~190** | **100%** |
### 10.2 Verdeling per Complexity
| Complexity | Aantal | Layer | Beschrijving |
|------------|--------|-------|--------------|
| Simple | ~120 | Layer 1 (Reflex) | Hoge confidence, single intent |
| Context-dependent | ~30 | Layer 2 (AI) | Pronoun resolution nodig |
| Multi-intent | ~20 | Layer 2 (AI) | Meerdere acties |
| Ambiguous | ~20 | Layer 2 (AI) | Clarification nodig |
### 10.3 Verdeling per Priority
| Priority | Aantal | Nudge Required |
|----------|--------|----------------|
| 🔴 HIGH | ~25 | Ja (safety-related) |
| 🟡 MEDIUM | ~50 | Mogelijk |
| 🔵 LOW | ~115 | Nee |
---
## 11. Implementatie Aanbevelingen
### 11.1 Training Data Format
```json
{
"version": "1.0",
"language": "nl",
"domain": "ggz",
"sentences": [
{
"id": "ggz-001",
"input": "Jan spreekt over suïcide",
"expected": {
"intent": "dagnotitie",
"entities": {
"patientName": "Jan",
"category": "observatie",
"severity": "high"
},
"nudge": "suicidaliteit-veiligheidsplan"
},
"complexity": "simple",
"priority": "high",
"tags": ["crisis", "safety", "suicidality"]
}
]
}
```
### 11.2 Evaluatie Metrics
| Metric | Beschrijving | Target |
|--------|--------------|--------|
| Intent Accuracy | Correct intent geclassificeerd | ≥95% |
| Entity Extraction | Correcte entities geëxtraheerd | ≥90% |
| Nudge Precision | Correcte nudge getriggerd | ≥90% |
| Escalation Rate | % dat naar Layer 2 gaat | 20-30% |
| Clarification Rate | % dat verduidelijking vraagt | <10% |
| Response Time L1 | Reflex Arc latency | <20ms |
| Response Time L2 | AI Orchestrator latency | <500ms |
### 11.3 Continuous Improvement
1. **Log alle classificaties** met intent, confidence, entities
2. **Track nudge acceptance rate** per rule
3. **Monitor escalation reasons** voor pattern verbeteringen
4. **Verzamel user corrections** voor fine-tuning
5. **A/B test** nieuwe patterns voordat ze live gaan
---
## Versiehistorie
| Versie | Datum | Auteur | Wijziging |
|--------|-------|--------|-----------|
| v1.0 | 01-01-2026 | Colin Lit | Initieel dataset document |
---
## Referenties
- [Analyse Intents & Nudges](./analyse-intents-nudges.md)
- [Architecture Cortex V2](./architecture-cortex-v2.md)
- [Bouwplan Cortex V2](../bouwplan-cortex-v2.md)
- Intent types: `lib/cortex/types.ts`
- Report types: `lib/types/report.ts`