3a26c63931
Keep the route, title, subtitle, domain navigation and composition in
gobernanza.{ts,html,scss}. Ejecución keeps mode and health in execution.ts.
Add models.{ts,html,scss} to own the actions, run monitor, status, versions,
reports, figures, clinical validation, and checks and lineage dialogs.
Render training.ts after Modelos with the existing source, configuration,
promotion checkbox, input sets and upload. Keep ZIP export and import in
bundles.ts. Keep scope, study list, EDF upload and run progress in
tea/studies.{ts,html}, and render tea/preview.ts separately for TEA with
its EDF and ADOS-2 selection, results and PDF export.
Use a page grid for section spacing and the global card style. Keep
table, action and dialog styles local to Modelos. Use Material fields
for editable values and Material buttons to open native file pickers,
retaining input labels and showing the selected filenames. Keep the
native suggestion lists for scheduler and input set names.
Default the training target to all on domain changes. Both Modelos
training actions focus the Entrenamiento heading and use the same
Formly submit path. Use the existing shared start flag and version
refresh via the Modelos component. Reset the training promotion
checkbox on domain changes and the upload selection with its input
listing. Ignore training submissions that finish in a different domain.
Move gobernanza.spec.ts to models.spec.ts alongside checkActions.
Keep bundles, execution, training, run-monitor, figures and preview PDF
logic specs. Update e2e/pages.spec.ts for Material selections and
the Modelos monitor, and check section order and training focus.
Prettier 3.10.1 and git diff --cached --check passed. The main checkout
has no local Prettier installation, so use the available lockfile
version directly from the requested working directory. Angular builds,
unit tests and Playwright are deferred to the VM per the spec.
151 lines
4.5 KiB
HTML
151 lines
4.5 KiB
HTML
<section class="card" aria-labelledby="studies-heading">
|
|
<h2 id="studies-heading">Estudios EEG</h2>
|
|
<form (ngSubmit)="analyze()">
|
|
<mat-form-field appearance="outline">
|
|
<mat-label>Alcance</mat-label>
|
|
<mat-select name="scope" [(ngModel)]="mode">
|
|
<mat-option value="pending">Pendientes</mat-option>
|
|
<mat-option value="first_n">Primeros N</mat-option>
|
|
<mat-option value="ids">Por ID</mat-option>
|
|
</mat-select>
|
|
</mat-form-field>
|
|
@if (mode() === 'first_n') {
|
|
<mat-form-field appearance="outline">
|
|
<mat-label>Número de estudios</mat-label>
|
|
<input matInput type="number" name="count" min="1" required [(ngModel)]="count" />
|
|
</mat-form-field>
|
|
}
|
|
@if (mode() === 'ids') {
|
|
<mat-form-field appearance="outline">
|
|
<mat-label>ID de estudios (uno por línea)</mat-label>
|
|
<textarea matInput name="ids" required [(ngModel)]="ids"></textarea>
|
|
</mat-form-field>
|
|
}
|
|
<button mat-flat-button type="submit" [disabled]="busy() || !execution()">Analizar</button>
|
|
</form>
|
|
<form (ngSubmit)="upload(files)">
|
|
<input
|
|
#files
|
|
type="file"
|
|
accept=".edf"
|
|
multiple
|
|
required
|
|
hidden
|
|
aria-label="Archivos EDF"
|
|
(change)="selectedFiles.set(files.files)"
|
|
/>
|
|
<button mat-stroked-button type="button" (click)="files.click()">Archivos EDF</button>
|
|
@for (file of selectedFiles(); track $index) {
|
|
<span>{{ file.name }}</span>
|
|
}
|
|
<button mat-stroked-button type="submit" [disabled]="busy() || !selectedFiles()?.length">
|
|
Subir EDF
|
|
</button>
|
|
</form>
|
|
@if (error()) {
|
|
<p role="alert">{{ error() }}</p>
|
|
}
|
|
@if (runId(); as id) {
|
|
<app-run-monitor [runId]="id" (finished)="finish()" />
|
|
}
|
|
<h3>Resumen</h3>
|
|
@if (summary.hasValue()) {
|
|
<dl>
|
|
@for (count of summary.value() | keyvalue; track count.key) {
|
|
<dt>{{ labels[count.key] ?? count.key }}</dt>
|
|
<dd>{{ count.value }}</dd>
|
|
}
|
|
</dl>
|
|
} @else if (summary.error(); as error) {
|
|
<p role="alert">{{ errorText(error) }}</p>
|
|
}
|
|
@if (history.hasValue()) {
|
|
@if (history.value().last; as last) {
|
|
<p>
|
|
Última ejecución TEA: {{ last.status }}
|
|
@if (last.ended != null) {
|
|
· {{ last.ended * 1000 | date: 'short' }}
|
|
}
|
|
</p>
|
|
}
|
|
<p>
|
|
{{
|
|
history.value().current
|
|
? 'Indicadores al día'
|
|
: 'Indicadores pendientes: corre el análisis TEA'
|
|
}}
|
|
</p>
|
|
} @else if (history.error(); as error) {
|
|
<p role="alert">{{ errorText(error) }}</p>
|
|
}
|
|
@if (eegs.error(); as error) {
|
|
<p role="alert">{{ errorText(error) }}</p>
|
|
}
|
|
@if (eegMetrics.error(); as error) {
|
|
<p role="alert">{{ errorText(error) }}</p>
|
|
}
|
|
<div class="model">
|
|
<table class="plain eegs">
|
|
<thead>
|
|
<tr>
|
|
<th>Fecha</th>
|
|
<th>Registro</th>
|
|
<th>Análisis</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@for (e of eegs.hasValue() ? eegs.value() : []; track e.id) {
|
|
<tr>
|
|
<td>
|
|
<button
|
|
mat-stroked-button
|
|
type="button"
|
|
[disabled]="!e.analysed"
|
|
(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.hasValue() && 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>
|