fix: send numero sin prefijo LHXC en RDA TNS
TNS espera solo el numero numerico (ej: "4001"), no el formato combinado con prefijo (ej: "LHXC04001"). El codigoPrefijo "00" ya referencia la serie correcta en la configuracion de TNS. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
90de09b22c
commit
be1910b5d8
@@ -265,8 +265,7 @@ async def run_automation(
|
||||
async with httpx.AsyncClient(timeout=timeout) as client:
|
||||
for id_recepcion, grupo_rows in grupos.items():
|
||||
num_fac = str(grupo_rows[0].get("NUM_FACTURA") or "").strip()
|
||||
prefijo_fb = str(grupo_rows[0].get("PREFIJO") or "").strip()
|
||||
num_override = f"{prefijo_fb}{num_fac.zfill(5)}" if prefijo_fb and num_fac else num_fac
|
||||
num_override = num_fac
|
||||
rda_json = generar_rda_paciente(grupo_rows, prof_def, esp_def, remis_def, prefijo_def, num_override)
|
||||
factura = num_override or str(id_recepcion)
|
||||
try:
|
||||
|
||||
@@ -292,9 +292,7 @@ async def test_enviar(request: Request, user: dict = Depends(get_current_user)):
|
||||
async with httpx.AsyncClient(timeout=30) as client:
|
||||
for id_rec, grupo_rows in grupos.items():
|
||||
num_factura = str(grupo_rows[0].get("NUM_FACTURA") or "").strip()
|
||||
prefijo_fb = str(grupo_rows[0].get("PREFIJO") or "").strip()
|
||||
# Formato igual al RIPS: LHXC03990
|
||||
numero_override = f"{prefijo_fb}{num_factura.zfill(5)}" if prefijo_fb and num_factura else num_factura
|
||||
numero_override = num_factura
|
||||
rda_json = generar_rda_paciente(grupo_rows, prof_def, esp_def, remis_def, prefijo_def, numero_override)
|
||||
examenes = [r.get("COD_EXAMEN", "") for r in grupo_rows]
|
||||
try:
|
||||
|
||||
@@ -152,8 +152,7 @@ async def send_one(
|
||||
endpoint = f"{TNS_BASE}/v2/rda/RdaPaciente/Insertar?codigosucursal={api_sucursal}"
|
||||
|
||||
num_factura_one = str(grupo_rows[0].get("NUM_FACTURA") or "").strip()
|
||||
prefijo_one = str(grupo_rows[0].get("PREFIJO") or "").strip()
|
||||
numero_override_one = f"{prefijo_one}{num_factura_one.zfill(5)}" if prefijo_one and num_factura_one else num_factura_one
|
||||
numero_override_one = num_factura_one
|
||||
rda_json = generar_rda_paciente(
|
||||
grupo_rows,
|
||||
cfg.get("profesional_default", ""),
|
||||
@@ -243,8 +242,7 @@ async def send_transaccion(
|
||||
async with httpx.AsyncClient(timeout=int(cfg.get("api_timeout", 30))) as client:
|
||||
for id_rec, grupo_rows in grupos.items():
|
||||
num_factura = str(grupo_rows[0].get("NUM_FACTURA") or "").strip()
|
||||
prefijo_fb = str(grupo_rows[0].get("PREFIJO") or "").strip()
|
||||
numero_override = f"{prefijo_fb}{num_factura.zfill(5)}" if prefijo_fb and num_factura else num_factura
|
||||
numero_override = num_factura
|
||||
rda_json = generar_rda_paciente(
|
||||
grupo_rows,
|
||||
cfg.get("profesional_default", ""),
|
||||
|
||||
Reference in New Issue
Block a user