Commit Graph
29 Commits
Author SHA1 Message Date
Lizandro GuarnizoandClaude Sonnet 4.6 69372a5673 Agrega filtro convenio en automation/transaccion/test-rda y fix particular (contrato 12)
- automation: filtro contrato en SQL pacientes+RDA, numero LHXC en run()
- transaccion: filtro contrato en preview/send-one/send
- test-rda: filtro tipo_usuario (11/07/12), default contrato "12", acepta "12"/"012"
- json_generator: detecta particular por CODCONTRATO "12"/"012" además de NIT_EMPRESA PART; fuerza tipousuario="12", codFormaPago="CLIP", plazoDias="0"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 20:23:00 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 7e0c6039b8 Fix profesionalRemisionante con slash y mejora display resultado test-rda
- json_generator: limpia DOCIDMEDICO a solo dígitos (eg "9410/86" → "941086") para que TNS acepte el código
- test_rda.html: resultado con syntax highlight en JSON enviado y respuesta TNS, mejor legibilidad del error TNS, botones Resp.TNS y JSON env. con íconos

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 19:44:46 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 7699303a53 Mejora Transacción y Historial: estado por fila, envío individual y filtros avanzados
- Transacción: tabla con estado Enviado/Pendiente/Error por IDRECEPCION, botón enviar fila a fila o masivo, modal con JSON + respuesta TNS por registro
- Historial: filtros por fecha, tipo, IDRECEPCION/contrato; paginación 50 por página; modal con 3 tabs (JSON enviado / Respuesta TNS / Mensaje)
- DB: migración automática para agregar columnas idrecepcion, contrato, mensaje_tns a tabla envios
- Logs route: nuevo endpoint /logs/detalle/{id} para cargar detalle completo vía JS

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 19:40:11 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 ef71a1db56 test-rda: add preview, ver más pagination, sent tracking, default contrato=011
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 19:32:53 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 e477aa2bea Fix error display: show TNS response separately, default filter contrato=011
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 19:25:33 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 b5e56f2238 Fix error display in test-rda, remove PO from default article filter
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 19:19:06 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 c1cbe54105 Fix candidatos: uppercase column keys, filter by TNS-configured articles, show last 10
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 19:15:26 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 c64a68ec6f Add test-rda page, fix prefijo/remisionante/especialidad for TNS RDA sends
- New /test-rda route: list Firebird candidates with valid contract/factura,
  send individual RDA with auto tercero creation and full result display
- json_generator: use prefijo_tns_default config instead of Firebird PREFIJO,
  add profesionalRemisionante from DOCIDMEDICO or remisionante_default config
- All queries: add DOCIDMEDICO column from MEDICO JOIN
- automation/transaccion: add remisionante_default and prefijo_tns_default params
- config: add remisionante_default (00) and prefijo_tns_default (00) keys
- automation SQL: filter NUM_FACTURA > 0 to skip unbilled records
- config.html: add UI fields for new config keys

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 18:57:54 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 3017c7956e Fix numeroContrato: use EMPRESA.CODCONTRATO from Firebird, sucursal default 00
- Join EMPRESA table in all RDA queries to get CODCONTRATO (TNS contract code)
- Use EMPRESA.CODCONTRATO as numeroContrato instead of raw NIT_EMPRESA
- Especialidad always uses default_especialidad (ignore Firebird COD_ESPECIALIDAD)
- sucursal defaults to '00' (not empty) in config and endpoints
- Fix config template label: especialidad default is TNS code not Firebird code

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 18:01:32 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 f0514641b3 Add profesional_default and especialidad_default fields to config page
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 17:19:37 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 f5cd5a233f Automation: replace confirm() with validation modal before sending
Show a modal with full summary (pacientes, recepciones, examenes,
patient list with RDA count) and a warning before the actual API
call. Requires explicit "Confirmar y enviar" click.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 19:50:51 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 dbaf49b30e Automation preview: show RDA per patient on click
Preview now returns all patients with their grouped receptions.
Clicking a patient row expands/collapses their RDA list showing
factura, fecha, exam count, diagnosis, and total value.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 19:49:21 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 c920b45640 Audit fixes: date format, prefijo query, and UI labels
- transaccion: append " 00:00:00" / " 23:59:59" to date params so Firebird BETWEEN works correctly with TIMESTAMP columns
- queries.py QUERY_DEFAULTS: remove :prefijo from RDA por factura (matches DB state)
- terceros.html: mark doc_num as required with visual indicator

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 19:31:53 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 b4a7271d8d Fix param validation errors and add TNS config section
- terceros/transaccion: return clear error when required params (doc_num, num_factura) are missing instead of passing empty dict to Firebird causing Column unknown error
- transaccion: remove prefijo from 'por factura' query; parse num_factura as int when digit
- automation: add /preview endpoint to show patient/reception counts before sending; update UI with preview step and disabled run button until preview loads
- config: add TNS credentials section (tns_empresa, tns_usuario, tns_password, api_sucursal) with test-connection button
- config: add POST /config/test-tns endpoint

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 19:29:32 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 3755a51562 feat: envío masivo por fecha — Terceros + RDA en un solo paso
- automation: reescrito para filtrar por fecha (default hoy), obtener
  pacientes únicos del día vía JOIN RECEPCION+PACIENTE+CIUDAD, luego
  agrupar recepciones por IDRECEPCION y enviar Tercero/Crear + RdaPaciente/Insertar a TNS v2
- template: UI simplificada con datepicker (default hoy), tabla de
  resultados por paciente/factura con estado OK/error por ítem

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 19:08:01 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 1111da578f Fix: botón descargar JSON no aparecía — classList.replace por remove/add + style.display
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 15:27:19 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 e41382db4e feat: botón descargar JSON en panel de resultados
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 15:25:09 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 a212578b37 Fix: esquema no expandía tablas — JSON.stringify con comillas rompía el onclick
Reemplazado innerHTML con template literals por createElement + addEventListener.
Eliminado JSON embebido en atributos HTML. selectAll ahora busca en el array global.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 14:31:04 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 122d21df09 Fix: editar consulta no hacía nada — comillas dobles en onclick rompían el HTML
Cambio tojson en atributos onclick por data-* con |e.
dataset decodifica automáticamente &quot; → " sin riesgo de romper el atributo.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 13:16:48 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 eb6bcebff8 feat: autocomplete SQL al escribir en vez de Ctrl+Space
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 13:05:07 -05:00
Lizandro Guarnizo 408ea50d21 hola 2026-06-18 12:25:44 -05:00
Lizandro Guarnizo 1e4b895913 Reorganize queries page: Probador, Constructor with results, Editor tab 2026-06-18 11:02:56 -05:00
Lizandro Guarnizo 25e90e7e28 Fix: auto-trigger hints while typing 2026-06-18 10:54:19 -05:00
Lizandro Guarnizo 181943bf00 Add CodeMirror SQL editor with autocomplete for tables and columns 2026-06-18 10:43:09 -05:00
Lizandro Guarnizo b3a0717287 Add visual query builder with table/column picker and SQL generator 2026-06-18 09:34:55 -05:00
Lizandro Guarnizo 71c94375b3 Add 'Ver tablas' button to list Firebird tables 2026-06-18 09:30:27 -05:00
Lizandro Guarnizo c589090110 Add Test button for queries with result viewer 2026-06-18 09:25:38 -05:00
Lizandro Guarnizo 25ca4a504c Add console credits, README with documentation and U-SITE credits 2026-06-17 18:13:14 -05:00
Lizandro Guarnizo 8ae3b44bc9 Initial commit: RIPS Manager web system 2026-06-17 13:22:39 -05:00