Ajustar pestañas y etiquetas de días

This commit is contained in:
2026-12-02 21:54:54 -06:00
parent 5201340a13
commit c08a0b8874
7 changed files with 53 additions and 29 deletions
+7 -7
View File
@@ -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();
+2 -2
View File
@@ -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();
+15 -5
View File
@@ -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})$/, ', <periodo>');
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 });
+4 -4
View File
@@ -39,25 +39,25 @@ import { Loading } from '../loading';
<mat-tab [label]="domain() === 'tea' ? 'Resumen' : 'Indicadores'">
<app-tab-indicadores [domain]="domain()" [measures]="measures.value()!" />
</mat-tab>
<mat-tab label="Trazabilidad">
<mat-tab label="Histórico">
<ng-template matTabContent>
<app-tab-trazabilidad [domain]="domain()" [measures]="measures.value()!" />
</ng-template>
</mat-tab>
@if (domain() === 'cacu') {
<mat-tab label="Análisis de riesgos">
<mat-tab label="Seguimiento">
<ng-template matTabContent>
<app-tab-riesgos [domain]="domain()" />
</ng-template>
</mat-tab>
} @else if (domain() === 'tea') {
<mat-tab label="Análisis de Riesgo">
<mat-tab label="Seguimiento">
<ng-template matTabContent>
<app-tab-riesgos-tea [domain]="domain()" />
</ng-template>
</mat-tab>
} @else if (domain() === 'cama') {
<mat-tab label="Análisis de riesgos">
<mat-tab label="Seguimiento">
<ng-template matTabContent>
<app-tab-seguimiento [domain]="domain()" />
</ng-template>
+18 -4
View File
@@ -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,
}),
],
},
{
+5 -5
View File
@@ -263,16 +263,16 @@ export const PAGES: Record<string, Page> = {
},
{
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<string, Page> = {
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',
},
],
+2 -2
View File
@@ -33,10 +33,10 @@ interface Drawn {
</mat-button-toggle-group>
</section>
@if (series.isLoading()) {
<app-loading what="la trazabilidad" text="Cargando trazabilidad…" />
<app-loading what="el histórico" text="Cargando histórico…" />
} @else if (series.error()) {
<p class="muted" role="alert">
No se pudo cargar la trazabilidad.
No se pudo cargar el histórico.
<button type="button" class="retry" (click)="series.reload()">Reintentar</button>
</p>
} @else {