Fix profesional/especialidad: use MEDICO.CODIGO first, add config defaults

- SQL query now prioritizes MEDICO.CODIGO over RECEPCION.USUARIO as profesional
  (USUARIO is the billing clerk; MEDICO is the medical professional)
- Add profesional_default and especialidad_default config keys for when
  Firebird data is empty or contains invalid values (e.g. especialidad = ".")
- generar_rda_paciente accepts default_profesional and default_especialidad params
- ensure_defaults in queries.py now updates existing query records on startup

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-06-26 16:12:16 -05:00
co-authored by Claude Sonnet 4.6
parent fbdce1c790
commit c70f0f1062
5 changed files with 22 additions and 9 deletions
+2
View File
@@ -23,6 +23,8 @@ DEFAULT_KEYS = [
("tns_password", "Nicolas2796*+"),
("num_documento_obligado", ""),
("cod_prestador", ""),
("profesional_default", ""),
("especialidad_default", ""),
]