diff --git a/modules/turnero/api/get_historial.php b/modules/turnero/api/get_historial.php index d86025d..0d224b0 100644 --- a/modules/turnero/api/get_historial.php +++ b/modules/turnero/api/get_historial.php @@ -144,7 +144,6 @@ $turnoIds = array_column($turnos, 'id'); $examenes = []; $consentimientos = []; $comentarios = []; -$tomas = []; if ($turnoIds) { $ph = implode(',', array_fill(0, count($turnoIds), '?')); @@ -195,25 +194,6 @@ if ($turnoIds) { } } - // Tomas de muestra — batch (una solicitud por turno, varias tomas por solicitud) - $stmtTom = $pdo->prepare( - "SELECT ts.turno_id, tm.tipo_muestra, tm.estado, tm.creado_at, tm.recibida_at, - ar.full_name AS recibida_por_nombre - FROM turnero_muestras tm - JOIN turnero_solicitudes ts ON ts.id = tm.solicitud_id - LEFT JOIN admin_users ar ON ar.id = tm.recibida_por - WHERE ts.turno_id IN ($ph) - ORDER BY tm.creado_at ASC" - ); - $stmtTom->execute($turnoIds); - foreach ($stmtTom->fetchAll(PDO::FETCH_ASSOC) as $row) { - $tid = (int)$row['turno_id']; - unset($row['turno_id']); - $row['tiempo_min'] = ($row['creado_at'] && $row['recibida_at']) - ? round((strtotime($row['recibida_at']) - strtotime($row['creado_at'])) / 60, 1) - : null; - $tomas[$tid][] = $row; - } } foreach ($turnos as &$turno) { @@ -221,7 +201,6 @@ foreach ($turnos as &$turno) { $turno['examenes'] = $examenes[$tid] ?? []; $turno['consentimientos'] = $consentimientos[$tid] ?? []; $turno['comentarios'] = $comentarios[$tid] ?? []; - $turno['tomas'] = $tomas[$tid] ?? []; } // ── Resumen por estado (del rango filtrado) ─────────────────── diff --git a/modules/turnero/views/historial.php b/modules/turnero/views/historial.php index 4116270..1e16069 100644 --- a/modules/turnero/views/historial.php +++ b/modules/turnero/views/historial.php @@ -533,25 +533,6 @@ function renderDetalle(t) { `; } - // Tomas de muestra (solo si hay más de una — turno prolongado por varias tomas) - let tomasHtml = ''; - if (t.tomas && t.tomas.length > 1) { - tomasHtml = `
| Muestra | Recibió | Recibida | Tiempo |
|---|---|---|---|
| ${esc(m.tipo_muestra)} | -${esc(m.recibida_por_nombre || '—')} | -${m.recibida_at ? new Date(m.recibida_at.replace(' ','T')).toLocaleTimeString('es-CO',{hour:'2-digit',minute:'2-digit'}) : '—'} | -${m.tiempo_min != null ? m.tiempo_min + ' m' : '—'} | -