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:
@@ -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'),
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user