diff --git a/e2e/cacu.spec.ts b/e2e/cacu.spec.ts index 0f9a4b9..ce3f7a1 100644 --- a/e2e/cacu.spec.ts +++ b/e2e/cacu.spec.ts @@ -14,8 +14,8 @@ const TITLES = { cytology: 'Distribución de resultados citológicos', genotype: 'Resultados de VPH por genotipo', biopsy: 'Resultados de biopsia cervical', - colposcopy: 'Valor predictivo positivo de la colposcopía', - ppvBiopsy: 'Valor predictivo positivo de la biopsia', + colposcopy: 'Tasa de confirmación histopatológica de referencia a colposcopía', + ppvBiopsy: 'Tasa de confirmación histopatológica de referencia a biopsia', }; test('indicadores cacu: its sections in order, each card read one mode at a time', async ({ @@ -30,17 +30,17 @@ test('indicadores cacu: its sections in order, each card read one mode at a time .evaluateAll((els) => els.map((e) => (e as HTMLElement).innerText.trim())); expect(headings.slice(headings.indexOf('Indicadores de oportunidad'))).toEqual([ 'Indicadores de oportunidad', - 'Tiempos de la ruta del tamizaje', + 'Días de la ruta del tamizaje', 'Indicadores clínicos', 'Resultados de citología, VPH y biopsia', 'Distribución de resultados citológicos', 'Resultados de VPH por genotipo', 'Resultados de biopsia cervical', 'Tasa de confirmación histopatológica', - 'Valor predictivo positivo de la colposcopía', + 'Tasa de confirmación histopatológica de referencia a colposcopía', ]); const route = tab.locator('app-readings').first(); - for (const mode of ['Por pasos', 'Por CIE-10', 'Acumulado desde la toma']) { + for (const mode of ['Por pasos', 'Primer diagnóstico', 'Diagnóstico tras biopsia', 'Acumulado desde la toma']) { await route.getByRole('radio', { name: mode }).click(); await expect( route.getByRole('table', { name: mode }).or(route.getByText('Sin datos en el periodo.')), @@ -105,14 +105,14 @@ test('indicadores cacu: its sections in order, each card read one mode at a time .getByRole('radio', ROUND) .click(); await expect( - tab.getByRole('heading', { name: 'Valor predictivo positivo de la biopsia' }), + tab.getByRole('heading', { name: 'Tasa de confirmación histopatológica de referencia a biopsia' }), ).toBeVisible(); await tab.getByRole('radio', { name: 'Solicitudes' }).click(); }); test('riesgos cacu: ages filter the whole list and a row opens its stages', async ({ page }) => { await page.goto('/indicadores/cacu'); - await page.getByRole('tab', { name: 'Análisis de riesgos' }).click(); + await page.getByRole('tab', { name: 'Seguimiento' }).click(); const list = page.locator('table.worklist tbody tr'); await expect(list.first().locator('app-stages li')).toHaveCount(5); await list.first().getByRole('button', { name: 'Detalle' }).click(); diff --git a/e2e/ficha-cacu.spec.ts b/e2e/ficha-cacu.spec.ts index 917a428..82de6a2 100644 --- a/e2e/ficha-cacu.spec.ts +++ b/e2e/ficha-cacu.spec.ts @@ -14,7 +14,7 @@ test.beforeEach(async ({ page }) => { /** The record of the first patient of the risk list, as an address. */ async function firstRecord(page: Page): Promise<{ url: string; sample: string }> { await page.goto('/indicadores/cacu'); - await page.getByRole('tab', { name: 'Análisis de riesgos' }).click(); + await page.getByRole('tab', { name: 'Seguimiento' }).click(); const link = page.locator('table.worklist tbody tr a').first(); await link.waitFor({ timeout: 120_000 }); const url = (await link.getAttribute('href'))!; @@ -1587,7 +1587,7 @@ test('elegibilidad (simulado): a new patient never inherits the previous risk ex await open(page, firstUrl); await expect(reason).toBeVisible(); await page.getByRole('link', { name: 'Regresar' }).click(); - await page.getByRole('tab', { name: 'Análisis de riesgos' }).click(); + await page.getByRole('tab', { name: 'Seguimiento' }).click(); await page.locator(`a[href*="/pacientes/${secondId}?"]`).first().click(); await expect(historial(page)).toBeVisible({ timeout: 120_000 }); await expect(riskBox(page).locator('app-risk-scales')).toBeVisible(); diff --git a/e2e/pages.spec.ts b/e2e/pages.spec.ts index 04e226a..2e6800a 100644 --- a/e2e/pages.spec.ts +++ b/e2e/pages.spec.ts @@ -58,14 +58,14 @@ test("indicators: the KPIs are the API's MeasureReports, every tab and the patie ); await expect(page.locator('app-tab-indicadores app-plot').first()).toBeVisible(); - await page.getByRole('tab', { name: 'Trazabilidad' }).click(); + await page.getByRole('tab', { name: 'Histórico' }).click(); await expect(page.locator('app-tab-trazabilidad section.panel')).toHaveCount(9); await page.getByRole('tab', { name: 'Datos y definiciones' }).click(); await expect(page.locator('app-tab-definiciones details')).toHaveCount(21); const list = page.waitForResponse((r) => r.url().includes('/fhir/Patient?')); - await page.getByRole('tab', { name: 'Análisis de riesgos' }).click(); + await page.getByRole('tab', { name: 'Seguimiento' }).click(); const bundle = await (await list).json(); const patient = bundle.entry.find((e: any) => e.search.mode === 'match').resource; const first = patient.name?.[0]?.text ?? patient.id.slice(0, 10); @@ -85,7 +85,7 @@ test("indicators: the KPIs are the API's MeasureReports, every tab and the patie await page.goto('/indicadores/cama'); await expect(page.getByRole('tab', { name: 'Indicadores' })).toBeVisible(); - await page.getByRole('tab', { name: 'Análisis de riesgos' }).click(); + await page.getByRole('tab', { name: 'Seguimiento' }).click(); await page.locator('mat-form-field', { hasText: 'Ventana' }).click(); await page.getByRole('option', { name: '12 meses' }).click(); const camaRows = page.locator('table.worklist tbody tr'); @@ -205,6 +205,16 @@ function captured(domain: string) { const period = (text: string) => text.replace(/, \d{4}-(S[12]|\d{2})$/, ', '); const kindOf = (types: string[]) => [...new Set(types)].sort().join('+'); +for (const domain of ['cacu', 'cama', 'tea']) { + test(`pestañas de indicadores ${domain} tienen nombres únicos`, async ({ page }) => { + await page.goto(`/indicadores/${domain}`); + await expect(page.getByRole('tab', { name: 'Seguimiento', exact: true })).toHaveCount(1); + await expect(page.getByRole('tab', { name: 'Histórico', exact: true })).toHaveCount(1); + const labels = await page.getByRole('tab').allTextContents(); + expect(new Set(labels.map((s) => s.trim())).size).toBe(labels.length); + }); +} + // CaCu's page is its own (Phase 6); CaMa's and TEA's follow the old one. for (const domain of ['cama', 'tea']) { test(`indicadores ${domain}: the old page's headings, in order, and the same kinds of plots`, async ({ @@ -242,7 +252,7 @@ for (const domain of ['cama', 'tea']) { .evaluateAll((els) => els.map((e) => (e as HTMLElement).innerText.trim())); const from = headings.indexOf('Indicadores de oportunidad'); expect(headings.slice(from).map(period)).toEqual( - old.filter((i) => i.kind !== 'plot').map((i) => period(i.text)), + old.filter((i) => i.kind !== 'plot').map((i) => period(domain === 'cama' ? i.text.replace(/^Tiempo de /, 'Días de ') : i.text)), ); // Each figure drawn is one of the old kinds (a figure with no data in the period is named). const drawn = await tab @@ -268,7 +278,7 @@ for (const domain of ['cacu', 'cama', 'tea']) { ['h2', 'h3', 'plot'].includes(i.kind), ); await page.goto(`/indicadores/${domain}`); - await page.getByRole('tab', { name: 'Trazabilidad' }).click(); + await page.getByRole('tab', { name: 'Histórico' }).click(); const tab = page.locator('app-tab-trazabilidad'); await expect(tab.getByRole('heading', { name: 'Filtros' })).toBeVisible(); await expect(tab.locator('app-loading')).toHaveCount(0, { timeout: 5 * 60_000 }); diff --git a/src/app/indicadores/indicadores.ts b/src/app/indicadores/indicadores.ts index eb103a3..3664672 100644 --- a/src/app/indicadores/indicadores.ts +++ b/src/app/indicadores/indicadores.ts @@ -39,25 +39,25 @@ import { Loading } from '../loading'; - + @if (domain() === 'cacu') { - + } @else if (domain() === 'tea') { - + } @else if (domain() === 'cama') { - + diff --git a/src/app/indicadores/pages-cacu.ts b/src/app/indicadores/pages-cacu.ts index d8b8c58..be9d931 100644 --- a/src/app/indicadores/pages-cacu.ts +++ b/src/app/indicadores/pages-cacu.ts @@ -212,7 +212,10 @@ export const CACU: Page = { { label: 'Días de toma de citología a resultado', measure: 'CACU_EU_TIEMPO_REPORTE' }, { label: 'Resultado de colposcopía', measure: 'CACU_DIAS_TOMA_COLPOSCOPIA' }, { label: 'Resultado de biopsia', measure: 'CACU_DIAS_TOMA_BIOPSIA' }, - { label: 'Diagnóstico tras biopsia', measure: 'CACU_DIAS_TOMA_DIAGNOSTICO_POST_BIOPSIA' }, + { + label: 'Diagnóstico tras biopsia', + measure: 'CACU_DIAS_TOMA_DIAGNOSTICO_POST_BIOPSIA', + }, ], }, { @@ -221,7 +224,10 @@ export const CACU: Page = { label: 'Por pasos', caption: 'Cada paso mide a sus propias pacientes: las medianas no se suman.', steps: [ - { label: 'Días de toma de citología a resultado', measure: 'CACU_EU_TIEMPO_REPORTE' }, + { + label: 'Días de toma de citología a resultado', + measure: 'CACU_EU_TIEMPO_REPORTE', + }, { label: 'Resultado a colposcopía', measure: 'CACU_DIAS_RESULTADO_COLPOSCOPIA' }, { label: 'Colposcopía a biopsia', measure: 'CACU_DIAS_COLPOSCOPIA_BIOPSIA' }, { label: 'Biopsia a diagnóstico', measure: 'CACU_DIAS_BIOPSIA_DIAGNOSTICO' }, @@ -237,7 +243,12 @@ export const CACU: Page = { kind: 'days', tint: TINT, label: 'Diagnóstico tras biopsia', - steps: [{ label: 'Toma a diagnóstico tras biopsia', measure: 'CACU_DIAS_TOMA_DIAGNOSTICO_POST_BIOPSIA' }], + steps: [ + { + label: 'Toma a diagnóstico tras biopsia', + measure: 'CACU_DIAS_TOMA_DIAGNOSTICO_POST_BIOPSIA', + }, + ], }, ], }, @@ -272,7 +283,10 @@ export const CACU: Page = { catalog: HPV, hidden: HPV_HIDDEN, }, - ...groupViews('CACU_VPH_GENOTIPO', HPV, 'reportes', { ofAll: true, hidden: HPV_HIDDEN }), + ...groupViews('CACU_VPH_GENOTIPO', HPV, 'reportes', { + ofAll: true, + hidden: HPV_HIDDEN, + }), ], }, { diff --git a/src/app/indicadores/pages.ts b/src/app/indicadores/pages.ts index e2913bd..836f47a 100644 --- a/src/app/indicadores/pages.ts +++ b/src/app/indicadores/pages.ts @@ -263,16 +263,16 @@ export const PAGES: Record = { }, { measure: 'CAMA_EU38A', - title: 'Tiempo de toma de mastografía a interpretación radiológica', + title: 'Días de toma de mastografía a interpretación radiológica', ...CAMA_DAYS, }, { measure: 'CAMA_DIAS_RESULTADO_DIAGNOSTICO', - title: 'Tiempo de interpretación radiológica a diagnóstico', + title: 'Días de interpretación radiológica a diagnóstico', ...CAMA_DAYS, }, { - title: 'Tiempo de diagnóstico a tratamiento', + title: 'Días de diagnóstico a tratamiento', value: 'Indicador no disponible', note: PENDING, }, @@ -280,12 +280,12 @@ export const PAGES: Record = { opportunity: [ { kind: 'route', - title: 'Tiempo de tamizaje a diagnóstico', + title: 'Días de tamizaje a diagnóstico', // from the mammography: only the two measures that start at it sample: [ { label: 'Interpretación radiológica', measure: 'CAMA_EU38A' }, { - label: 'Diagnóstico (tiempo total de tamizaje a diagnóstico)', + label: 'Diagnóstico (días de tamizaje a diagnóstico)', measure: 'CAMA_DIAS_TOMA_DIAGNOSTICO', }, ], diff --git a/src/app/indicadores/tab-trazabilidad.ts b/src/app/indicadores/tab-trazabilidad.ts index e108d96..50d5aa9 100644 --- a/src/app/indicadores/tab-trazabilidad.ts +++ b/src/app/indicadores/tab-trazabilidad.ts @@ -33,10 +33,10 @@ interface Drawn { @if (series.isLoading()) { - + } @else if (series.error()) { } @else {