Send profesional/especialidad as null instead of empty string when no value

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 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-06-26 16:43:31 -05:00
co-authored by Claude Sonnet 4.6
parent c70f0f1062
commit 83ce80a74b
+2 -2
View File
@@ -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,
})