feat(overdracht): E2 + E3 - API overdracht en dagregistratie UI
Epic 2 - API Overdracht: - GET /api/overdracht/patients (patiënten met alerts) - GET /api/overdracht/[patientId] (detail met vitals, reports, logs, risks) - POST /api/overdracht/generate (AI samenvatting met bronverwijzingen) - lib/ai/overdracht-prompt.ts (system + user prompt) - lib/types/overdracht.ts (TypeScript types) Epic 3 - Dagregistratie UI: - /epd/dagregistratie/[patientId] pagina - Quick entry form (categorie, tijd, tekst, overdracht checkbox) - Edit/Delete functionaliteit met inline editing - Confirm delete dialog - Summary cards (totaal, overdracht, incidenten) Bouwplan bijgewerkt naar v1.2 (10/19 stories voltooid) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
103
lib/types/overdracht.ts
Normal file
103
lib/types/overdracht.ts
Normal file
@@ -0,0 +1,103 @@
|
||||
import { z } from 'zod';
|
||||
import type { NursingLog } from './nursing-log';
|
||||
|
||||
// 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;
|
||||
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[];
|
||||
nursingLogs: NursingLog[];
|
||||
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)
|
||||
export interface Report {
|
||||
id: string;
|
||||
type: string;
|
||||
content: string;
|
||||
created_at: string;
|
||||
created_by: 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' | 'dagnotitie' | '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'),
|
||||
});
|
||||
|
||||
export type GenerateOverdrachtInput = z.infer<typeof GenerateOverdrachtSchema>;
|
||||
Reference in New Issue
Block a user