From 83ce80a74b1b3eff14997797cf2d4f615794c910 Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Fri, 26 Jun 2026 16:43:31 -0500 Subject: [PATCH] Send profesional/especialidad as null instead of empty string when no value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TNS schema marks both as optional — null may bypass company-level validation that rejects empty string "". Falls back to config default if set. Co-Authored-By: Claude Sonnet 4.6 --- app/services/json_generator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/json_generator.py b/app/services/json_generator.py index ac966ca..589d655 100644 --- a/app/services/json_generator.py +++ b/app/services/json_generator.py @@ -126,8 +126,8 @@ def generar_rda_paciente(rows: list, default_profesional: str = "", default_espe "porcentajeIva": 0, "impConsumo": 0, "observacion": "", - "profesional": str(row.get("profesional") or "").strip() or default_profesional, - "especialidad": (lambda e: e if e not in (".", "-", "0", "00") else default_especialidad)(str(row.get("COD_ESPECIALIDAD") or "").strip()), + "profesional": str(row.get("profesional") or "").strip() or default_profesional or None, + "especialidad": (lambda e: e if e not in (".", "-", "0", "00") else default_especialidad or None)(str(row.get("COD_ESPECIALIDAD") or "").strip()), "diagnosticoprincipal": str(h.get("DIAG_PPAL") or "").strip(), "fechaHoraRealizacion": fecha_real or egreso, })