Simplify CaCu distribution descriptions

This commit is contained in:
Angel Capetillo Zavala
2026-12-02 14:09:02 -06:00
parent 9ae8254dee
commit f119ba048a
2 changed files with 12 additions and 39 deletions
+7 -2
View File
@@ -64,6 +64,10 @@ test('indicadores cacu: its sections in order, each card read one mode at a time
});
// each card has no toggle of its own: the selector drives both
await expect(readings.getByRole('radio')).toHaveCount(0);
// no long description beside the bars: the cards read from their title, note and legend
await expect(readings).not.toContainText(
/Cada barra|Cada paciente cuenta una vez|«Detección inicial»|una barra vacía|«Positivo»/,
);
await expect(
readings
.locator('.group')
@@ -286,12 +290,13 @@ for (const card of ['cytology', 'genotype'] as const) {
});
}
test('rondas (simulado): the genotype card never shows the incomplete positives, and says where they went', async ({
test('rondas (simulado): the genotype card never shows the incomplete positives, and carries no long description', async ({
page,
}) => {
const { card, view } = await withRounds(page, 'as-is');
const readings = card(TITLES.genotype);
await expect(readings).toContainText('«Positivo»');
await expect(readings).not.toContainText('«Positivo»');
await expect(readings).not.toContainText('Cada barra');
await expect(readings.getByRole('rowheader')).not.toContainText([
'Otro de alto riesgo',
'incompleto',
+5 -37
View File
@@ -85,14 +85,6 @@ const BY_STATUS = 'Por estatus de seguimiento';
const BY_ROUND = 'Por detección inicial y subsecuente';
const AGE_GROUPS = ['<25', '25-34', '35-44', '45-54', '55-64', '65+', 'no_data'];
const STATUSES = ['pre_colposcopy', 'post_colposcopy', 'post_treatment', 'case', 'no_data'];
const ROUND_MEANING =
'«Detección inicial»: primera vez en la vida y sin colposcopía ni tratamiento a la toma. ' +
'«Detección subsecuente»: con detección previa registrada, o ya con colposcopía o tratamiento a la toma. ' +
'«Sin dato»: sin detección previa registrada y sin colposcopía ni tratamiento. ';
const CYTOLOGY_BARS =
'Cada barra suma 100 % de las pacientes del grupo con resultado citológico (n indica cuántas son).';
const POSITIVE_MEANING =
'«Positivo»: VPH de alto riesgo positivo con los genotipos 16 y 18 reportados negativos; los positivos para 16, 18 o ambos se muestran aparte.';
/** HPV categories the cards do not draw (their reports stay in the total and the percentages). */
const HPV_HIDDEN = {
codes: ['positive_incomplete', 'inconsistent', 'no_result'],
@@ -104,13 +96,12 @@ const groupViews = (
measure: string,
catalog: { code: string; label: string; color: string }[],
unit: string,
caption: { age: string; status: string; round: string },
more: { ofAll?: boolean; hidden?: { codes: string[]; unit: string } } = {},
): Mode[] =>
[
{ label: BY_AGE, stratum: 'age_group', order: AGE_GROUPS, caption: caption.age },
{ label: BY_STATUS, stratum: 'follow_up_status', order: STATUSES, caption: caption.status },
{ label: BY_ROUND, stratum: 'round', order: ROUNDS, caption: caption.round, complete: true },
{ label: BY_AGE, stratum: 'age_group', order: AGE_GROUPS },
{ label: BY_STATUS, stratum: 'follow_up_status', order: STATUSES },
{ label: BY_ROUND, stratum: 'round', order: ROUNDS, complete: true },
].map((v) => ({
kind: 'grouped' as const,
measure,
@@ -256,19 +247,7 @@ export const CACU: Page = {
note: 'Pacientes, por su última muestra válida del periodo.',
modes: [
{ kind: 'counts', label: GENERAL, measure: 'CACU_EU7', catalog: CYTOLOGY.categories },
...groupViews('CACU_EU7', CYTOLOGY.categories, 'pacientes', {
age:
'Cada paciente cuenta una vez, con su última muestra válida del periodo; la edad es la de la paciente al inicio del periodo. ' +
CYTOLOGY_BARS,
status:
'Cada paciente cuenta una vez, con su última muestra válida del periodo; el estatus es el de la paciente al inicio del periodo. ' +
CYTOLOGY_BARS,
round:
'Cada paciente cuenta una vez, con su última muestra válida del periodo; la detección es la de esa muestra (fecha de toma). ' +
ROUND_MEANING +
CYTOLOGY_BARS +
' Si hay pacientes en «Sin dato», una barra vacía significa que no hay pacientes clasificadas en esa detección según la información disponible.',
}),
...groupViews('CACU_EU7', CYTOLOGY.categories, 'pacientes'),
],
},
{
@@ -283,19 +262,8 @@ export const CACU: Page = {
measure: 'CACU_VPH_GENOTIPO',
catalog: HPV,
hidden: HPV_HIDDEN,
caption: POSITIVE_MEANING,
},
...groupViews(
'CACU_VPH_GENOTIPO',
HPV,
'reportes',
{
age: `Cada barra son los reportes de VPH del grupo de edad de la paciente al inicio del periodo. ${POSITIVE_MEANING}`,
status: `Cada barra son los reportes de VPH del estatus de la paciente al inicio del periodo. ${POSITIVE_MEANING}`,
round: `Cada barra son los reportes de VPH de las muestras de esa detección (fecha de toma). ${ROUND_MEANING}Si hay reportes en «Sin dato», una barra vacía significa que no hay reportes de muestras clasificadas en esa detección según la información disponible. ${POSITIVE_MEANING}`,
},
{ ofAll: true, hidden: HPV_HIDDEN },
),
...groupViews('CACU_VPH_GENOTIPO', HPV, 'reportes', { ofAll: true, hidden: HPV_HIDDEN }),
],
},
{