feat(cortex): add Intake Blocks MVP for voice/text commands
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>
This commit is contained in:
@@ -152,6 +152,60 @@ const INTENT_PATTERNS: Record<Exclude<CortexIntent, 'unknown'>, PatternConfig[]>
|
||||
{ pattern: /^(verzet|verplaats)\s+\d{1,2}[:.]\d{2}\b/i, weight: 0.9 },
|
||||
{ pattern: /^verzet\s+\w+\s+naar\b/i, weight: 0.85 }, // "verzet jan naar dinsdag"
|
||||
],
|
||||
|
||||
// Intake intents (MVP)
|
||||
intake_status: [
|
||||
// Exact commands - voortgang/status check
|
||||
{ pattern: /^(wat\s+)?moet\s+ik\s+nog\s+(doen|invullen)/i, weight: 1.0 },
|
||||
{ pattern: /^is\s+(de\s+)?intake\s+compleet/i, weight: 0.95 },
|
||||
{ pattern: /^intake\s+status\b/i, weight: 1.0 },
|
||||
{ pattern: /^voortgang\s+(intake|invullen)\b/i, weight: 0.95 },
|
||||
{ pattern: /^welke\s+(velden|onderdelen)\s+(missen|ontbreken)/i, weight: 0.9 },
|
||||
{ pattern: /^(hoeveel|wat)\s+(is|staat)\s+er\s+(nog\s+)?open\b/i, weight: 0.9 },
|
||||
{ pattern: /^status\s+(intake|invullen)\b/i, weight: 0.95 },
|
||||
{ pattern: /^checklist\s+intake\b/i, weight: 0.85 },
|
||||
],
|
||||
|
||||
intake_navigeer: [
|
||||
// Navigation to specific intake tabs/sections
|
||||
{ pattern: /^ga\s+naar\s+(de\s+)?(risico|risicotaxatie)/i, weight: 1.0 },
|
||||
{ pattern: /^ga\s+naar\s+(de\s+)?diagnose[ns]?/i, weight: 1.0 },
|
||||
{ pattern: /^ga\s+naar\s+(de\s+)?anamnese/i, weight: 1.0 },
|
||||
{ pattern: /^ga\s+naar\s+(de\s+)?behandelgeschiedenis/i, weight: 1.0 },
|
||||
{ pattern: /^ga\s+naar\s+(de\s+)?medicatie/i, weight: 1.0 },
|
||||
{ pattern: /^ga\s+naar\s+(de\s+)?meetinstrumenten/i, weight: 1.0 },
|
||||
{ pattern: /^ga\s+naar\s+(het\s+)?netwerk/i, weight: 1.0 },
|
||||
{ pattern: /^ga\s+naar\s+(de\s+)?doelen/i, weight: 1.0 },
|
||||
{ pattern: /^ga\s+naar\s+(de\s+)?samenvatting/i, weight: 1.0 },
|
||||
// Open patterns
|
||||
{ pattern: /^open\s+(de\s+)?(risico|diagnose|anamnese|medicatie|netwerk|doelen|samenvatting)/i, weight: 0.95 },
|
||||
// Show patterns
|
||||
{ pattern: /^(toon|laat\s+zien)\s+(de\s+)?(risico|diagnose|anamnese|medicatie|netwerk|doelen|samenvatting)/i, weight: 0.9 },
|
||||
],
|
||||
|
||||
risico_query: [
|
||||
// Exact commands - risk information
|
||||
{ pattern: /^(wat\s+zijn\s+)?(de\s+)?risico'?s/i, weight: 1.0 },
|
||||
{ pattern: /^risicotaxatie\b/i, weight: 1.0 },
|
||||
{ pattern: /^welke\s+risico'?s\s+(zijn|hebben)/i, weight: 0.95 },
|
||||
{ pattern: /^(is\s+er\s+)?(suïcide|suicide)\s*risico/i, weight: 1.0 },
|
||||
{ pattern: /^(wat\s+is\s+)?(de\s+)?(sui[cï]daliteit|zelfbeschadiging)/i, weight: 0.95 },
|
||||
{ pattern: /^risico'?s\s+(van|bij|voor)\s+\w+/i, weight: 0.9 },
|
||||
{ pattern: /^toon\s+(de\s+)?risico'?s/i, weight: 0.9 },
|
||||
{ pattern: /^geef\s+(een\s+)?(overzicht|samenvatting)\s+(van\s+)?(de\s+)?risico'?s/i, weight: 0.85 },
|
||||
],
|
||||
|
||||
diagnose_query: [
|
||||
// Exact commands - diagnosis information
|
||||
{ pattern: /^(welke\s+)?diagnose[ns]?(\s+heeft)?/i, weight: 1.0 },
|
||||
{ pattern: /^dsm[- ]?(5|iv|diagnose)/i, weight: 1.0 },
|
||||
{ pattern: /^(wat\s+is\s+)?(de\s+)?hoofddiagnose/i, weight: 1.0 },
|
||||
{ pattern: /^(wat\s+zijn\s+)?(de\s+)?nevendiagnose[ns]?/i, weight: 0.95 },
|
||||
{ pattern: /^toon\s+(de\s+)?diagnose[ns]?/i, weight: 0.9 },
|
||||
{ pattern: /^diagnose[ns]?\s+(van|bij|voor)\s+\w+/i, weight: 0.9 },
|
||||
{ pattern: /^geef\s+(een\s+)?(overzicht|samenvatting)\s+(van\s+)?(de\s+)?diagnose[ns]?/i, weight: 0.85 },
|
||||
{ pattern: /^(is\s+er\s+)?(een\s+)?persoonlijkheidsstoornis/i, weight: 0.9 },
|
||||
],
|
||||
};
|
||||
|
||||
// Help patterns (separate, always check)
|
||||
|
||||
Reference in New Issue
Block a user