TEA indicators, EEG section in governance

This commit is contained in:
Roberto Treviño
2026-11-26 07:06:52 -06:00
parent 53a6393cb2
commit 471ed3a18c
23 changed files with 614 additions and 20 deletions
+63
View File
@@ -19,6 +19,9 @@
</mat-form-field>
<button mat-flat-button type="button" (click)="start('train')">Entrenar</button>
<button mat-stroked-button type="button" (click)="start('score')">Calcular riesgos</button>
@if (domain() === 'tea') {
<button mat-stroked-button type="button" (click)="analyzeEegs()">Analizar EEG</button>
}
@if (run(); as r) {
<span class="muted" role="status">{{ r.kind }}: {{ r.status }}</span>
}
@@ -113,4 +116,64 @@
}
</div>
}
@if (domain() === 'tea') {
<div class="card model">
<h2>Electroencefalogramas</h2>
<table class="plain eegs">
<thead>
<tr>
<th>Fecha</th>
<th>Registro</th>
<th>Análisis</th>
</tr>
</thead>
<tbody>
@for (e of eegs.value() ?? []; track e.id) {
<tr>
<td>
<button mat-button type="button" (click)="eeg.set(e.id)">{{ e.study_date }}</button>
</td>
<td>{{ e.lab_record_id ?? '—' }}</td>
<td>
{{ !e.analysed ? 'Sin analizar' : e.valid ? 'Válido' : 'No válido' }}
{{ e.level ? '(' + e.level + ')' : '' }}
</td>
</tr>
} @empty {
<tr>
<td colspan="3" class="muted">Sin EEG cargados.</td>
</tr>
}
</tbody>
</table>
@if (eegMetrics.value(); as m) {
<h3>EEG {{ m.id }} · {{ m.age_months ?? '—' }} meses</h3>
<table class="plain">
<thead>
<tr>
<th>Métrica</th>
<th>Valor</th>
<th>z</th>
<th>Curva</th>
</tr>
</thead>
<tbody>
@for (x of m.metrics; track x.code) {
<tr>
<td>{{ metricNames[x.code] ?? x.code }}</td>
<td class="num">{{ x.value | number: '1.2-2' }}</td>
<td class="num">{{ x.z === null ? '—' : (x.z | number: '1.2-2') }}</td>
<td>{{ x.model ?? 'sin curva en producción' }}</td>
</tr>
} @empty {
<tr>
<td colspan="4" class="muted">Sin métricas (EEG no válido).</td>
</tr>
}
</tbody>
</table>
}
</div>
}
</section>