feat(tea): abrir las alteraciones del EEG con un mapa visible

Al desplegar un paciente se abre su primera alteración, o la primera métrica
si no tiene alteraciones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-06 13:46:26 -06:00
parent ef631e2c0b
commit a1ea31039e
2 changed files with 23 additions and 8 deletions
@@ -81,7 +81,13 @@ export class TeaPacienteResumen implements OnInit {
load() {
this.status.set('loading');
this.service.detalle(this.id).pipe(takeUntilDestroyed(this.destroy)).subscribe({
next: d => { this.mapaElegido = undefined; this.figura = undefined; this.detalle.set(d); this.status.set('ready'); },
next: d => {
// Opens on the first altered metric, or on the first one if none is altered.
const e = d.eeg, inicial = e?.mapas.find(m => e.alteraciones.some(a => a.codigo === m.codigo && a.estado !== 'normal')) ?? e?.mapas[0];
this.mapaElegido = inicial?.codigo;
this.figura = e && inicial ? mapaFigure(e, inicial, this.fondo()) : undefined;
this.detalle.set(d); this.status.set('ready');
},
error: () => this.status.set('error'),
});
}