From ea507c119aaf887010a1b155785cdabd5cd20ebc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Trevi=C3=B1o?= Date: Sun, 6 Dec 2026 03:33:26 -0600 Subject: [PATCH] TEA list reads the step and EEG result; CaCu's Trazabilidad has ten panels --- e2e/pages.spec.ts | 2 +- src/app/eeg-labels.ts | 1 + src/app/indicadores/labels.ts | 1 + src/app/indicadores/tab-riesgos-tea.html | 4 ++-- src/app/indicadores/tab-riesgos-tea.ts | 12 +++++++----- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/e2e/pages.spec.ts b/e2e/pages.spec.ts index 3c7c338..f686f30 100644 --- a/e2e/pages.spec.ts +++ b/e2e/pages.spec.ts @@ -60,7 +60,7 @@ test("indicators: the KPIs are the API's MeasureReports, every tab and the patie await expect(page.locator('app-tab-indicadores app-readings').first()).toBeVisible(); await page.getByRole('tab', { name: 'Trazabilidad' }).click(); - await expect(page.locator('app-tab-trazabilidad section.panel')).toHaveCount(9); + await expect(page.locator('app-tab-trazabilidad section.panel')).toHaveCount(10); await page.getByRole('tab', { name: 'Datos y definiciones' }).click(); await expect(page.locator('app-tab-definiciones details')).toHaveCount(21); diff --git a/src/app/eeg-labels.ts b/src/app/eeg-labels.ts index ea412cd..89ff905 100644 --- a/src/app/eeg-labels.ts +++ b/src/app/eeg-labels.ts @@ -3,6 +3,7 @@ import type { Figure } from './plot'; /** The EEG metrics (models.tea.eeg.biomarkers.CODES), as the pages name them. */ export const METRIC_NAMES: Record = { posterior_rhythm: 'Ritmo posterior (Hz)', + spindles: 'Husos de sueño NREM (por min)', spindles_n2: 'Husos de sueño N2 (por min)', spindles_n3: 'Husos de sueño N3 (por min)', paroxysmal_spikes: 'Picos paroxísticos (por min)', diff --git a/src/app/indicadores/labels.ts b/src/app/indicadores/labels.ts index dc13e23..ad797ff 100644 --- a/src/app/indicadores/labels.ts +++ b/src/app/indicadores/labels.ts @@ -32,6 +32,7 @@ export const LABELS: Record = { mchat_only: 'Solo M-CHAT', psychology: 'Psicología (ADOS-2)', neuropediatrics: 'Neuropediatría', + neurology: 'Neurología', eeg: 'EEG', good: 'Bueno', bad: 'Malo', diff --git a/src/app/indicadores/tab-riesgos-tea.html b/src/app/indicadores/tab-riesgos-tea.html index af86dca..2bfc921 100644 --- a/src/app/indicadores/tab-riesgos-tea.html +++ b/src/app/indicadores/tab-riesgos-tea.html @@ -125,7 +125,7 @@ Paciente Grupo de edad Estado del caso - Último EEG + Paso Puntaje M-CHAT CSS ADOS-2 Estatus de EEG @@ -141,7 +141,7 @@ {{ r.ageGroup ? ageLabel(r.ageGroup) : 'Sin dato' }} {{ cases[r.case] ?? r.case }} - {{ r.lastEeg ?? '—' }} + {{ label(r.step) }} {{ r.mchat ?? '—' }} {{ r.css ?? '—' }} {{ eegStatuses[r.eegStatus] ?? r.eegStatus }} diff --git a/src/app/indicadores/tab-riesgos-tea.ts b/src/app/indicadores/tab-riesgos-tea.ts index fed57c8..db798a7 100644 --- a/src/app/indicadores/tab-riesgos-tea.ts +++ b/src/app/indicadores/tab-riesgos-tea.ts @@ -21,9 +21,10 @@ export interface TeaRow { ageGroup: string; case: string; status: string; + /** the last step she reached by the cut-off (tea-step) */ + step: string; eegStatus: string; alterations: string[]; - lastEeg?: string; mchat?: number; css?: number; } @@ -38,10 +39,10 @@ export function teaRow(p: Patient): TeaRow { ageGroup: has(p, 'tea-age-group')[0]?.valueString ?? '', case: coded('tea-case'), status: coded('follow-up-status'), - eegStatus: coded('tea-eeg-status'), + step: coded('tea-step'), + eegStatus: coded('tea-eeg-result'), alterations: has(p, 'tea-eeg-alteration').map((e) => e.valueCoding?.code ?? ''), - lastEeg: has(p, 'tea-last-eeg')[0]?.valueDate, - mchat: has(p, 'mchat-score')[0]?.valueInteger, + mchat: has(p, 'mchat-score')[0]?.valueDecimal, css: has(p, 'ados2-css')[0]?.valueInteger, }; } @@ -62,13 +63,14 @@ const EEG_STATUS: Record = { normal: 'Normal', abnormal: 'Anormal', no_valid_eeg: 'Sin EEG válido', + not_scored: 'Sin analizar', }; const CASE: Record = { confirmed: 'Diagnóstico confirmado', in_process: 'En proceso', not_confirmed: 'Sin TEA', }; -/** `theta_power:above` → "theta_power (aumentado)". */ +/** An EEG metric outside its age curve (`spindles`), or with its side (`spindles:above`). */ export const alteration = (a: string) => { const [metric, side] = a.split(':'); const shown = (METRIC_NAMES[metric] ?? metric).replace(/ \(.*\)$/, '');