Fix NameError: mover autorizacion después de definir es_particular

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-06-26 20:28:57 -05:00
co-authored by Claude Sonnet 4.6
parent 5c03e58639
commit bdc0e244fc
+1 -2
View File
@@ -139,8 +139,6 @@ def generar_rda_paciente(rows: list, default_profesional: str = "", default_espe
"fechaHoraRealizacion": fecha_real or egreso,
})
autorizacion = None if es_particular else (str(h.get("AUTORIZACION") or "").strip() or None)
nit_empresa = str(h.get("NIT_EMPRESA") or "").strip()
cod_contrato_raw = str(h.get("CODCONTRATO") or "").strip()
# Particular: por NIT_EMPRESA "PART" o por contrato "12"/"012"
@@ -150,6 +148,7 @@ def generar_rda_paciente(rows: list, default_profesional: str = "", default_espe
)
cod_contrato = cod_contrato_raw or ("012" if es_particular else None)
cod_forma_pago = "CLIP" if es_particular else "INST"
autorizacion = None if es_particular else (str(h.get("AUTORIZACION") or "").strip() or None)
# tipousuario: particular siempre "12"; para convenios usar TIPOUSUSISPRO o derivar
_TIPOUSU_MAP = {"1": "11", "5": "07"} # EPS→11, Póliza→07