fix(cortex): integrate intake intents into full chat + artifact flow
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>
This commit is contained in:
@@ -18,6 +18,10 @@ import { ZoekenBlock } from '../blocks/zoeken-block';
|
||||
import { OverdrachtBlock } from '../blocks/overdracht-block';
|
||||
import { PatientDashboardBlock } from '../blocks/patient-dashboard-block';
|
||||
import { FallbackPicker } from '../blocks/fallback-picker';
|
||||
// Intake MVP blocks
|
||||
import { IntakeStatusBlock } from '../blocks/intake-status-block';
|
||||
import { RisicoBlock } from '../blocks/risico-block';
|
||||
import { DiagnoseBlock } from '../blocks/diagnose-block';
|
||||
import { APPOINTMENT_TYPES, type AppointmentTypeCode, type LocationClassCode } from '@/app/epd/agenda/types';
|
||||
import type { Artifact, BlockType } from '@/stores/cortex-store';
|
||||
import { parseRelativeDate, isDateRange } from '@/lib/cortex/date-time-parser';
|
||||
@@ -194,6 +198,13 @@ function renderArtifactBlock(artifact: Artifact, onCloseArtifact: (id: string) =
|
||||
return <PatientDashboardBlock key={artifact.id} prefill={artifact.prefill} />;
|
||||
case 'fallback':
|
||||
return <FallbackPicker key={artifact.id} originalInput={artifact.prefill?.content} />;
|
||||
// Intake MVP blocks
|
||||
case 'intake_status':
|
||||
return <IntakeStatusBlock key={artifact.id} prefill={artifact.prefill} />;
|
||||
case 'risico_query':
|
||||
return <RisicoBlock key={artifact.id} prefill={artifact.prefill} />;
|
||||
case 'diagnose_query':
|
||||
return <DiagnoseBlock key={artifact.id} prefill={artifact.prefill} />;
|
||||
default:
|
||||
return (
|
||||
<div className="p-4 text-slate-500">
|
||||
@@ -232,6 +243,13 @@ export function getArtifactTitle(type: BlockType, prefill?: any): string {
|
||||
return prefill?.patientName
|
||||
? `Dashboard - ${prefill.patientName}`
|
||||
: 'Patiëntoverzicht';
|
||||
// Intake MVP blocks
|
||||
case 'intake_status':
|
||||
return 'Intake Status';
|
||||
case 'risico_query':
|
||||
return 'Risicotaxatie';
|
||||
case 'diagnose_query':
|
||||
return 'Diagnoses';
|
||||
default:
|
||||
return 'Artifact';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user