From 3313337672ea2c2ea2aff5feea93c9e8e13b97fd Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Sat, 11 Jul 2026 10:19:42 -0500 Subject: [PATCH] fix: usar COD_ESPECIALIDAD de la BD en detallePedido MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit La especialidad ahora toma el valor del campo COD_ESPECIALIDAD de la tabla MEDICO (ya presente en todos los SELECTs), con fallback al default de config. El profesional sigue viniendo de configuración en todos los flujos. Co-Authored-By: Claude Sonnet 4.6 --- app/services/json_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/json_generator.py b/app/services/json_generator.py index b5068ac..6e08cd1 100644 --- a/app/services/json_generator.py +++ b/app/services/json_generator.py @@ -156,7 +156,7 @@ def generar_rda_paciente(rows: list, default_profesional: str = "", default_espe "cantidad": 1, "observacion": "", "profesional": default_profesional or None, - "especialidad": default_especialidad or None, + "especialidad": str(row.get("COD_ESPECIALIDAD") or "").strip() or default_especialidad or None, "profesionalRemisionante": cedula_medico or default_remisionante or None, "diagnosticoprincipal": str(h.get("DIAG_PPAL") or "").strip(), "fechaHoraRealizacion": fecha_real or recepcion_dt,