Ajustar indicadores, fecha de corte y ficha de CaMa y CaCu

This commit is contained in:
2026-12-03 19:33:13 -06:00
parent 0fe772ed6f
commit cbcb524902
18 changed files with 333 additions and 120 deletions
+7 -7
View File
@@ -9,7 +9,7 @@ test.beforeEach(async ({ page }) => {
const ROUND = { name: 'Por detección inicial y subsecuente' };
const VIEWS_LABEL = 'Lectura de la distribución citológica y del VPH por genotipo';
const VIEWS = ['General', 'Por grupo de edad', 'Por estatus de seguimiento', ROUND.name];
const VIEWS = ['General', 'Por grupo de edad', ROUND.name];
const TITLES = {
cytology: 'Distribución de resultados citológicos',
genotype: 'Resultados de VPH por genotipo',
@@ -28,9 +28,7 @@ test('indicadores cacu: its sections in order, each card read one mode at a time
const headings = await tab
.locator('h2, app-readings h3')
.evaluateAll((els) => els.map((e) => (e as HTMLElement).innerText.trim()));
expect(headings.slice(headings.indexOf('Indicadores de oportunidad'))).toEqual([
'Indicadores de oportunidad',
'Tiempos de tamizaje',
expect(headings.slice(headings.indexOf('Indicadores clínicos'))).toEqual([
'Indicadores clínicos',
'Resultados de citología, VPH y biopsia',
'Distribución de resultados citológicos',
@@ -38,9 +36,11 @@ test('indicadores cacu: its sections in order, each card read one mode at a time
'Resultados de biopsia cervical',
'Tasa de confirmación histopatológica',
'Tasa de confirmación histopatológica de referencia a colposcopía',
'Indicadores de oportunidad',
'Tiempos de tamizaje',
]);
const route = tab.locator('app-readings').first();
for (const mode of ['Por ventana de tiempo', 'Primer diagnóstico', 'Diagnóstico tras biopsia', 'Acumulado desde la toma']) {
const route = tab.locator('app-readings').filter({ has: page.getByRole('heading', { name: 'Tiempos de tamizaje' }) });
for (const mode of ['Por ventana de tiempo', 'Diagnóstico precolposcópico', '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.')),
@@ -107,7 +107,7 @@ test('indicadores cacu: its sections in order, each card read one mode at a time
await expect(
tab.getByRole('heading', { name: 'Tasa de confirmación histopatológica de referencia a biopsia' }),
).toBeVisible();
await tab.getByRole('radio', { name: 'Solicitudes' }).click();
await expect(tab.getByRole('radio', { name: 'Solicitudes' })).toHaveCount(0);
});
test('riesgos cacu: ages filter the whole list and a row opens its stages', async ({ page }) => {
+22 -3
View File
@@ -251,9 +251,28 @@ for (const domain of ['cama', 'tea']) {
.locator('h2, h3')
.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(domain === 'cama' ? i.text.replace(/^Tiempo de /, 'Días de ') : i.text)),
);
if (domain === 'cama') {
const ordered = [
'Días de toma de mastografía a interpretación radiológica',
'Días de interpretación radiológica a diagnóstico',
'Días de tamizaje a diagnóstico',
'Porcentaje de mastografías con resultado BI-RADS 4, 5 ó 6',
'Pacientes evaluadas con BI-RADS 4, 5 o 6',
'Resultado histopatológico por categoría BI-RADS',
'Confirmación histopatológica',
'Tasa de detección histopatológica',
];
let last = -1;
for (const title of ordered) {
const next = headings.findIndex((h, index) => index > last && h.startsWith(title));
expect(next, title).toBeGreaterThan(last);
last = next;
}
} else {
expect(headings.slice(from).map(period)).toEqual(
old.filter((i) => i.kind !== 'plot').map((i) => period(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
.locator('.js-plotly-plot')