From 82d5644c2839f395be010ead6c3ea85ea741353f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Gustavo?= <166467972+JoaoGustavo-dev@users.noreply.github.com> Date: Thu, 30 Oct 2025 23:20:49 -0300 Subject: [PATCH] fix-doctor-ID --- susconecta/app/paciente/page.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/susconecta/app/paciente/page.tsx b/susconecta/app/paciente/page.tsx index 4058a86..5e427d1 100644 --- a/susconecta/app/paciente/page.tsx +++ b/susconecta/app/paciente/page.tsx @@ -1153,10 +1153,20 @@ export default function PacientePage() { { // prefer the resolved doctor name; while resolving, show a loading indicator instead of raw IDs (() => { + const looksLikeIdStr = (s: any) => { + try { + const hexOnly = String(s || '').replace(/[^0-9a-fA-F]/g, '') + const len = (typeof hexOnly === 'string') ? hexOnly.length : (Number(hexOnly) || 0) + return len >= 8 + } catch { return false } + } const maybeId = selectedReport?.doctor_id || selectedReport?.created_by || selectedReport?.doctor || null - if (reportDoctorName) return