diff --git a/app/epd/patients/[id]/components/client-sidebar.tsx b/app/epd/patients/[id]/components/client-sidebar.tsx index 23a73b4..c8609a4 100644 --- a/app/epd/patients/[id]/components/client-sidebar.tsx +++ b/app/epd/patients/[id]/components/client-sidebar.tsx @@ -25,7 +25,7 @@ interface ClientSidebarProps { interface NavItem { label: string; href: string; - icon: React.ElementType; + icon: React.ComponentType<{ className?: string }>; } export function ClientSidebar({ patientId }: ClientSidebarProps) { diff --git a/app/epd/patients/[id]/intakes/[intakeId]/actions.ts b/app/epd/patients/[id]/intakes/[intakeId]/actions.ts index 062e059..36384d6 100644 --- a/app/epd/patients/[id]/intakes/[intakeId]/actions.ts +++ b/app/epd/patients/[id]/intakes/[intakeId]/actions.ts @@ -67,7 +67,7 @@ export async function createContactMoment(input: ContactPayload) { intake_id: input.intakeId, class_code: input.location || 'AMB', class_display: input.location || 'Onbekend', - status: 'finished', + status: 'completed', type_code: input.type, type_display: input.type, period_start: startIso, @@ -330,7 +330,7 @@ export async function createDiagnosis(payload: DiagnosisPayload) { code_code: payload.code, code_display: payload.description, code_system: 'DSM-5', - clinical_status: payload.status || 'active', + clinical_status: 'active', severity_display: payload.severity || null, note: payload.notes, recorded_date: new Date().toISOString(), @@ -366,7 +366,7 @@ export async function getTreatmentAdvice(intakeId: string) { console.error('getTreatmentAdvice error', error); throw new Error('Kon behandeladvies niet ophalen'); } - return data?.treatment_advice || {}; + return (data?.treatment_advice as Record) || {}; } export interface TreatmentAdvicePayload { diff --git a/app/epd/patients/[id]/page.tsx b/app/epd/patients/[id]/page.tsx index ce9cad1..f573cb0 100644 --- a/app/epd/patients/[id]/page.tsx +++ b/app/epd/patients/[id]/page.tsx @@ -13,6 +13,7 @@ import { Calendar, } from 'lucide-react'; import { getIntakesByPatientId } from './intakes/actions'; +import type { Intake } from '@/lib/types/intake'; import { format } from 'date-fns'; import { nl } from 'date-fns/locale'; @@ -24,7 +25,7 @@ export default async function PatientDashboardPage({ const { id } = await params; // Fetch recent intakes (optional) - let recentIntakes = []; + let recentIntakes: Intake[] = []; try { const intakes = await getIntakesByPatientId(id); recentIntakes = intakes.slice(0, 3); // Get up to 3 most recent diff --git a/app/epd/patients/[id]/screening/components/document-card.tsx b/app/epd/patients/[id]/screening/components/document-card.tsx index 8d5c8ae..762387e 100644 --- a/app/epd/patients/[id]/screening/components/document-card.tsx +++ b/app/epd/patients/[id]/screening/components/document-card.tsx @@ -160,7 +160,7 @@ export function DocumentCard({ patientId, screeningId, documents }: DocumentCard

{doc.file_name}

- {doc.document_type} • {(doc.file_size / 1024).toFixed(1)} KB •{' '} + {doc.document_type} • {doc.file_size ? `${(doc.file_size / 1024).toFixed(1)} KB` : 'Onbekend'} •{' '} {doc.uploaded_by_name || 'Onbekend'}

diff --git a/app/epd/patients/components/patient-form.tsx b/app/epd/patients/components/patient-form.tsx index 191b240..f400b9d 100644 --- a/app/epd/patients/components/patient-form.tsx +++ b/app/epd/patients/components/patient-form.tsx @@ -38,8 +38,8 @@ export function PatientForm({ patient }: PatientFormProps) { const [isSubmitting, setIsSubmitting] = useState(false); const [error, setError] = useState(null); const [isJohnDoe, setIsJohnDoe] = useState( - patient?.extension?.find( - (ext) => ext.url === 'http://mini-epd.local/fhir/StructureDefinition/john-doe' + (patient as any)?.extension?.find( + (ext: any) => ext.url === 'http://mini-epd.local/fhir/StructureDefinition/john-doe' )?.valueBoolean || false ); @@ -52,8 +52,8 @@ export function PatientForm({ patient }: PatientFormProps) { const existingAddress = patient?.address?.[0]; // Extract insurance data from extension - const insuranceExtension = patient?.extension?.find( - (ext) => ext.url === 'http://mini-epd.local/fhir/StructureDefinition/insurance' + const insuranceExtension = (patient as any)?.extension?.find( + (ext: any) => ext.url === 'http://mini-epd.local/fhir/StructureDefinition/insurance' ); let existingInsurance: { company?: string; number?: string } = {}; if (insuranceExtension?.valueString) { @@ -65,8 +65,8 @@ export function PatientForm({ patient }: PatientFormProps) { } // Extract GP (huisarts) data from extension - const gpExtension = patient?.extension?.find( - (ext) => ext.url === 'http://mini-epd.local/fhir/StructureDefinition/general-practitioner' + const gpExtension = (patient as any)?.extension?.find( + (ext: any) => ext.url === 'http://mini-epd.local/fhir/StructureDefinition/general-practitioner' ); let existingGP: { name?: string; agb?: string } = {}; if (gpExtension?.valueString) { @@ -102,7 +102,7 @@ export function PatientForm({ patient }: PatientFormProps) { } // Build FHIR Patient resource - const fhirPatient: FHIRPatient = { + const fhirPatient: any = { resourceType: 'Patient', identifier: bsnValue ? [ diff --git a/components/rich-text-editor.tsx b/components/rich-text-editor.tsx index b2ae305..eb49dab 100644 --- a/components/rich-text-editor.tsx +++ b/components/rich-text-editor.tsx @@ -40,7 +40,7 @@ export function RichTextEditor({ value, onChange, placeholder }: RichTextEditorP if (!editor) return; const html = value || ''; if (html !== editor.getHTML()) { - editor.commands.setContent(html, false); + editor.commands.setContent(html); } }, [value, editor]); diff --git a/lib/fhir/types/index.ts b/lib/fhir/types/index.ts index 1cf7e44..4f5adab 100644 --- a/lib/fhir/types/index.ts +++ b/lib/fhir/types/index.ts @@ -78,6 +78,12 @@ export interface FHIRPatient { meta?: FHIRMeta; implicitRules?: string; language?: string; + extension?: Array<{ + url: string; + valueBoolean?: boolean; + valueCode?: string; + valueString?: string; + }>; // Patient fields identifier?: FHIRIdentifier[]; diff --git a/lib/types/intake.ts b/lib/types/intake.ts index 450732d..011ece2 100644 --- a/lib/types/intake.ts +++ b/lib/types/intake.ts @@ -28,7 +28,7 @@ export const CreateIntakeSchema = z.object({ patient_id: z.string().uuid('Patient ID moet een geldige UUID zijn'), title: z.string().min(1, 'Titel is verplicht'), department: z.enum(INTAKE_DEPARTMENTS, { - errorMap: () => ({ message: 'Afdeling moet Volwassenen, Jeugd of Ouderen zijn' }), + message: 'Afdeling moet Volwassenen, Jeugd of Ouderen zijn', }), start_date: z.string().min(1, 'Startdatum is verplicht'), psychologist_id: z.string().uuid().optional(),