diff --git a/app/services/json_generator.py b/app/services/json_generator.py index aabd831..12d1e14 100644 --- a/app/services/json_generator.py +++ b/app/services/json_generator.py @@ -117,7 +117,10 @@ def generar_rda_paciente(rows: list, default_profesional: str = "", default_espe row.get("FECHA_REPORTADO") if str(row.get("FECHA_REPORTADO") or "")[:4] != "1900" else h.get("FECHA_RECEPCION") ) - cedula_medico = str(row.get("DOCIDMEDICO") or "").strip() + # TNS solo acepta dígitos en profesionalRemisionante; limpiar "9410/86" → "941086" + import re as _re + _doc = str(row.get("DOCIDMEDICO") or "").strip() + cedula_medico = _re.sub(r"[^0-9]", "", _doc) detalle_pedido.append({ "codigoMaterial": str(row.get("COD_EXAMEN") or "").strip(), "codigoBodega": "00", diff --git a/app/templates/test_rda.html b/app/templates/test_rda.html index fc0697a..57ec4da 100644 --- a/app/templates/test_rda.html +++ b/app/templates/test_rda.html @@ -309,46 +309,61 @@ async function enviarRDA() { if (p.tipo === 'tercero') { html += `
Tercero: ${p.codigo} — ${p.nombre}
-${p.mensaje}
+Tercero: ${p.codigo} — ${esc(p.nombre || '')}
+${esc(p.mensaje || '')}
- IDRECEPCION ${p.idrecepcion} - · Factura ${p.factura} - · Contrato ${p.contrato} - HTTP ${p.status || '?'} -
-Exámenes: ${(p.examenes || []).join(', ')}
-Exámenes: ${esc((p.examenes||[]).join(', '))}
+${respTns.replace(/
- ${jsonStr.replace(/
+ ${respHtml}
+ ${jsonHtml}