Numero TNS = formato RIPS limpio: LHXC03990 sin sufijo idrecepcion
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
88f684a006
commit
d7afbe9b7d
@@ -271,9 +271,8 @@ async def test_enviar(request: Request, user: dict = Depends(get_current_user)):
|
|||||||
for id_rec, grupo_rows in grupos.items():
|
for id_rec, grupo_rows in grupos.items():
|
||||||
num_factura = str(grupo_rows[0].get("NUM_FACTURA") or "").strip()
|
num_factura = str(grupo_rows[0].get("NUM_FACTURA") or "").strip()
|
||||||
prefijo_fb = str(grupo_rows[0].get("PREFIJO") or "").strip()
|
prefijo_fb = str(grupo_rows[0].get("PREFIJO") or "").strip()
|
||||||
# Formato completo como RIPS: LHXC03990-314522 (único por IDRECEPCION)
|
# Formato igual al RIPS: LHXC03990
|
||||||
num_fmt = f"{prefijo_fb}{num_factura.zfill(5)}" if prefijo_fb else num_factura
|
numero_override = f"{prefijo_fb}{num_factura.zfill(5)}" if prefijo_fb and num_factura else num_factura
|
||||||
numero_override = f"{num_fmt}-{id_rec}" if num_fmt else str(id_rec)
|
|
||||||
rda_json = generar_rda_paciente(grupo_rows, prof_def, esp_def, remis_def, prefijo_def, numero_override)
|
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]
|
examenes = [r.get("COD_EXAMEN", "") for r in grupo_rows]
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -148,8 +148,7 @@ async def send_one(
|
|||||||
|
|
||||||
num_factura_one = str(grupo_rows[0].get("NUM_FACTURA") or "").strip()
|
num_factura_one = str(grupo_rows[0].get("NUM_FACTURA") or "").strip()
|
||||||
prefijo_one = str(grupo_rows[0].get("PREFIJO") or "").strip()
|
prefijo_one = str(grupo_rows[0].get("PREFIJO") or "").strip()
|
||||||
num_fmt_one = f"{prefijo_one}{num_factura_one.zfill(5)}" if prefijo_one else num_factura_one
|
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 = f"{num_fmt_one}-{idrecepcion}" if num_fmt_one else str(idrecepcion)
|
|
||||||
rda_json = generar_rda_paciente(
|
rda_json = generar_rda_paciente(
|
||||||
grupo_rows,
|
grupo_rows,
|
||||||
cfg.get("profesional_default", ""),
|
cfg.get("profesional_default", ""),
|
||||||
@@ -237,8 +236,7 @@ async def send_transaccion(
|
|||||||
for id_rec, grupo_rows in grupos.items():
|
for id_rec, grupo_rows in grupos.items():
|
||||||
num_factura = str(grupo_rows[0].get("NUM_FACTURA") or "").strip()
|
num_factura = str(grupo_rows[0].get("NUM_FACTURA") or "").strip()
|
||||||
prefijo_fb = str(grupo_rows[0].get("PREFIJO") or "").strip()
|
prefijo_fb = str(grupo_rows[0].get("PREFIJO") or "").strip()
|
||||||
num_fmt = f"{prefijo_fb}{num_factura.zfill(5)}" if prefijo_fb else num_factura
|
numero_override = f"{prefijo_fb}{num_factura.zfill(5)}" if prefijo_fb and num_factura else num_factura
|
||||||
numero_override = f"{num_fmt}-{id_rec}" if num_fmt else str(id_rec)
|
|
||||||
rda_json = generar_rda_paciente(
|
rda_json = generar_rda_paciente(
|
||||||
grupo_rows,
|
grupo_rows,
|
||||||
cfg.get("profesional_default", ""),
|
cfg.get("profesional_default", ""),
|
||||||
|
|||||||
Reference in New Issue
Block a user