Commit Graph
6 Commits
Author SHA1 Message Date
Lizandro GuarnizoandClaude Sonnet 4.6 e7c6bc794a feat(pacientes): sync de pacientes Firebird → WhatsApp Lab
- Nuevo servicio whatsapp_sync.py: mapeo de campos RIPS→lab_pacientes
  y cliente HTTP para /api/lab/ingest_paciente.php
- Nueva ruta /pacientes con sync masiva por rango de fechas o todos
- Hook en /terceros/send y /automation/run: sync silencioso a WhatsApp
  después de cada envío a TNS
- Config: campos whatsapp_url y whatsapp_api_key + botón probar conexión

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-09 10:49:00 -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 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 Guarnizo 8ae3b44bc9 Initial commit: RIPS Manager web system 2026-06-17 13:22:39 -05:00