tmp: script buscar paciente en db

This commit is contained in:
Lizandro Guarnizo
2026-07-22 22:52:26 -05:00
parent 9bd247219e
commit 36ace04c35
+22
View File
@@ -0,0 +1,22 @@
import sqlite3
conn = sqlite3.connect("rips_manager.db")
conn.row_factory = sqlite3.Row
rows = conn.execute("""
SELECT id, tipo, factura, status, mensaje_tns, contrato, created_at
FROM envios
WHERE json_enviado LIKE '%88272630%'
ORDER BY created_at DESC
LIMIT 20
""").fetchall()
if not rows:
print("Sin resultados para 88272630")
else:
for r in rows:
print(f"id={r['id']} tipo={r['tipo']} factura={r['factura']} status={r['status']} contrato={r['contrato']} fecha={r['created_at']}")
print(f" msg: {r['mensaje_tns']}")
print()
conn.close()