feat: enrich sync log with exams, diagnosis, EPS and valor per patient

- scheduler.py: after sync_todos(), inject diagnostico, nit_empresa,
  valor_total and examenes_det (cups/nombre/precio) into each detalle entry
- whatsapp_sync.py: guardar_sync_log stores full enriched fields in detalle_json
- envios_erp.html: expanded row shows per-patient card with Dx, EPS, valor
  and a CUPS/examen/precio table — scrollable, max-h-96

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-07-17 09:52:08 -05:00
co-authored by Claude Sonnet 4.6
parent e044f21e3e
commit cd63683869
3 changed files with 79 additions and 19 deletions
+11 -3
View File
@@ -31,9 +31,17 @@ def guardar_sync_log(
detalle_json = None
if detalle_raw:
detalle_json = json.dumps(
[{"doc": d["doc"], "nombre": d["nombre"], "action": d.get("action", ""),
"examenes": d.get("examenes_guardados", 0)}
for d in detalle_raw],
[{
"doc": d["doc"],
"nombre": d["nombre"],
"action": d.get("action", ""),
"examenes_cnt": d.get("examenes_guardados", 0),
"diagnostico_cod": d.get("diagnostico_cod", ""),
"diagnostico_nombre": d.get("diagnostico_nombre", ""),
"nit_empresa": d.get("nit_empresa", ""),
"valor_total": d.get("valor_total"),
"examenes_det": d.get("examenes_det", []),
} for d in detalle_raw],
ensure_ascii=False,
)