/** * Basisgegevens Page * E3.S3: Patient basic information with edit and delete functionality */ import { getPatient } from '../../actions'; import { PatientForm } from '../../components/patient-form'; import { DeletePatientButton } from '../../components/delete-patient-button'; import { AlertCircle } from 'lucide-react'; export default async function BasisgegevensPage({ params, }: { params: Promise<{ id: string }>; }) { const { id } = await params; const patient = await getPatient(id); // Get patient name for delete confirmation const patientName = patient.name?.[0] ? [ ...(patient.name[0].given || []), patient.name[0].family, ] .filter(Boolean) .join(' ') : 'deze patiƫnt'; // Check if John Doe const isJohnDoe = (patient as any).extension?.find( (ext: any) => ext.url === 'http://mini-epd.local/fhir/StructureDefinition/john-doe' )?.valueBoolean; // Check if BSN is missing or placeholder const bsn = patient.identifier?.find( (id) => id.system === 'http://fhir.nl/fhir/NamingSystem/bsn' )?.value; const hasMissingBSN = !bsn || bsn === '999999990'; return (
{/* John Doe Warning */} {isJohnDoe && hasMissingBSN && (

Incomplete gegevens - John Doe registratie

Vul BSN aan zodra deze beschikbaar is voor volledige registratie.

)} {/* Patient Form */}
{/* Delete Patient Button */}
); }