let appConfigCache = null; let doctorsCache = null; let topicsCache = null; async function loadAppConfig() { if (appConfigCache) return appConfigCache; const data = await apiGet("config.php"); appConfigCache = data; return data; } async function loadDoctors() { if (doctorsCache) return doctorsCache; const res = await apiGet("doctors.php"); doctorsCache = res.data || []; return doctorsCache; } async function loadTopics() { if (topicsCache) return topicsCache; const res = await apiGet("topics.php"); topicsCache = res.data || []; return topicsCache; } function getDoctorById(doctors, id) { return doctors.find((d) => d.id === id) || null; }