Files
triqura-ecd/lib/types/overdracht.ts
colinislit 593bef4dcf feat(overdracht): Incident badges + expandable rapportage content
Incident telling:
- Nieuwe incident_count in PatientOverzicht alerts
- Telt type='incident', 'crisis' én verpleegkundig category='incident'
- Oranje badge in patiëntenlijst
- "Met alerts" filter includeert nu ook incidenten

Expandable content:
- Rapportages in timeline tonen nu volledige tekst
- "Lees meer" / "Minder tonen" toggle voor berichten >5 regels
- Behoudt whitespace/regeleinden in tekst

Opruiming:
- Oude screenshots verwijderd

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-08 14:26:07 +01:00

108 lines
2.4 KiB
TypeScript

import { z } from 'zod';
import type { Json } from '@/lib/supabase/database.types';
// Patient overview for list view
export interface PatientOverzicht {
id: string;
name_given: string[];
name_family: string;
birth_date: string;
gender: string;
alerts: {
high_risk_count: number;
abnormal_vitals_count: number;
marked_logs_count: number;
incident_count: number;
total: number;
};
}
export interface PatientOverzichtResponse {
patients: PatientOverzicht[];
total: number;
date: string;
}
// Patient detail for detail view
export interface PatientDetail {
patient: {
id: string;
name_given: string[];
name_family: string;
name_prefix?: string;
birth_date: string;
gender: string;
};
vitals: VitalSign[];
reports: Report[];
risks: RiskAssessment[];
conditions: Condition[];
}
// Vital sign with interpretation
export interface VitalSign {
id: string;
code_display: string;
value_quantity_value: number | null;
value_quantity_unit: string | null;
interpretation_code?: string | null; // 'H' | 'L' | 'N'
effective_datetime: string;
}
// Report (rapportage) - now includes verpleegkundig type (was nursing_logs)
export interface Report {
id: string;
type: string;
content: string;
created_at: string;
created_by: string | null;
structured_data?: Json | null; // Contains category for verpleegkundig
include_in_handover?: boolean | null;
shift_date?: string | null;
}
// Risk assessment
export interface RiskAssessment {
id: string;
risk_type: string;
risk_level: string;
rationale?: string | null;
created_at: string | null;
}
// Condition (diagnose)
export interface Condition {
id: string;
code_display: string;
clinical_status: string;
onset_datetime?: string;
}
// AI Summary types
export interface AISamenvatting {
samenvatting: string;
aandachtspunten: Aandachtspunt[];
actiepunten: string[];
generatedAt: string;
durationMs: number;
}
export interface Aandachtspunt {
tekst: string;
urgent: boolean;
bron: {
type: 'observatie' | 'rapportage' | 'verpleegkundig' | 'risico';
id: string;
datum: string;
label: string;
};
}
// Zod schema for generate request
export const GenerateOverdrachtSchema = z.object({
patientId: z.string().uuid('Patient ID moet een geldige UUID zijn'),
period: z.enum(['1d', '3d', '7d', '14d']).optional().default('1d'),
});
export type GenerateOverdrachtInput = z.infer<typeof GenerateOverdrachtSchema>;