From 63f6e16d193e087546e27f1a59a0e2720223ccd7 Mon Sep 17 00:00:00 2001 From: Angel Capetillo Zavala Date: Thu, 3 Dec 2026 15:18:22 -0600 Subject: [PATCH] Clarify CaCu and CaMa chart labels --- e2e/cacu.spec.ts | 14 ++++---- e2e/exportaciones-cama.spec.ts | 2 +- e2e/ficha-cacu.spec.ts | 4 +-- e2e/pages.spec.ts | 16 ++++----- src/app/indicadores/bars.spec.ts | 14 ++++---- src/app/indicadores/bars.ts | 51 ++++++++++++++++++++++------ src/app/indicadores/figures.ts | 8 +++-- src/app/indicadores/indicadores.ts | 10 +++--- src/app/indicadores/measures.ts | 1 + src/app/indicadores/pages-cacu.ts | 40 ++++++++++++++++++---- src/app/indicadores/pages.ts | 4 +++ src/app/indicadores/readings.ts | 7 +++- src/app/indicadores/tab-riesgos.html | 2 +- 13 files changed, 122 insertions(+), 51 deletions(-) diff --git a/e2e/cacu.spec.ts b/e2e/cacu.spec.ts index ce3f7a1..4001cf7 100644 --- a/e2e/cacu.spec.ts +++ b/e2e/cacu.spec.ts @@ -30,7 +30,7 @@ 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', - 'Días de la ruta del tamizaje', + 'Tiempos de tamizaje', 'Indicadores clínicos', 'Resultados de citología, VPH y biopsia', 'Distribución de resultados citológicos', @@ -40,7 +40,7 @@ test('indicadores cacu: its sections in order, each card read one mode at a time 'Tasa de confirmación histopatológica de referencia a colposcopía', ]); const route = tab.locator('app-readings').first(); - for (const mode of ['Por pasos', 'Primer diagnóstico', 'Diagnóstico tras biopsia', 'Acumulado desde la toma']) { + for (const mode of ['Por ventana de tiempo', '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.')), @@ -112,7 +112,7 @@ test('indicadores cacu: its sections in order, each card read one mode at a time 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: 'Seguimiento' }).click(); + await page.getByRole('tab', { name: 'Análisis de Riesgo' }).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(); @@ -187,7 +187,7 @@ async function withRounds(page: Page, how: Simulation) { } /** The first group of independent bars of a card (the cytology and genotype breakdowns). */ const plotOf = (readings: Locator) => readings.locator('.group').first(); -/** The groups of a card as the page draws them: "label
n = N", the width of the first bar and the colour of +/** The groups of a card as the page draws them: "label
unit: N", the width of the first bar and the colour of * each category (the first group's rows), in hex. */ const traces = (readings: Locator) => readings.evaluate((el) => { @@ -202,7 +202,7 @@ const traces = (readings: Locator) => return { y: groups.map( (g) => - `${g.querySelector('h4')!.childNodes[0].textContent!.trim()}
n = ${g.querySelector('.n')!.textContent!.replace('n = ', '').trim()}`, + `${g.querySelector('h4')!.childNodes[0].textContent!.trim()}
${g.querySelector('.n')!.textContent!.trim()}`, ), x: groups.map((g) => parseFloat((g.querySelector('.fill') as HTMLElement).style.width)), colours: Object.fromEntries( @@ -277,7 +277,7 @@ for (const card of ['cytology', 'genotype'] as const) { const { card: of, view } = await withRounds(page, 'no-initial'); await view(ROUND.name); const found = await traces(of(TITLES[card])); - expect(found.y[0]).toBe('Detección inicial
n = 0'); + expect(found.y[0]).toBe('Detección inicial
Pacientes: 0'); expect(found.x[0]).toBe(0); }); @@ -307,7 +307,7 @@ test('rondas (simulado): the genotype card never shows the incomplete positives, 'VPH 16', 'VPH 18', 'VPH 16 y 18', - 'Positivo', + 'Positivo sin genotipo', ]); for (const name of VIEWS.slice(1)) { await view(name); diff --git a/e2e/exportaciones-cama.spec.ts b/e2e/exportaciones-cama.spec.ts index e8e7679..455b122 100644 --- a/e2e/exportaciones-cama.spec.ts +++ b/e2e/exportaciones-cama.spec.ts @@ -25,7 +25,7 @@ const isXlsx = (b: Buffer) => b.subarray(0, 2).toString() === 'PK'; // a zip con async function followUp(page: Page, domain: 'cama' | 'cacu') { await page.goto(`/indicadores/${domain}`); - await page.getByRole('tab', { name: 'Seguimiento' }).click(); + await page.getByRole('tab', { name: 'Análisis de Riesgo' }).click(); await page.locator('table.worklist tbody tr').first().waitFor({ timeout: 120_000 }); } diff --git a/e2e/ficha-cacu.spec.ts b/e2e/ficha-cacu.spec.ts index 82de6a2..6464fac 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: 'Seguimiento' }).click(); + await page.getByRole('tab', { name: 'Análisis de Riesgo' }).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: 'Seguimiento' }).click(); + await page.getByRole('tab', { name: 'Análisis de Riesgo' }).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 309de9f..a3c53ab 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: 'Histórico' }).click(); + await page.getByRole('tab', { name: 'Trazabilidad' }).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: 'Seguimiento' }).click(); + await page.getByRole('tab', { name: 'Análisis de Riesgo' }).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); @@ -84,14 +84,14 @@ test("indicators: the KPIs are the API's MeasureReports, every tab and the patie ).not.toContainText('Sin estudios'); await page.goto('/indicadores/cama'); - await expect(page.getByRole('tab', { name: 'Resumen' })).toBeVisible(); - await page.getByRole('tab', { name: 'Seguimiento' }).click(); + await expect(page.getByRole('tab', { name: 'Indicadores' })).toBeVisible(); + await page.getByRole('tab', { name: 'Análisis de Riesgo' }).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'); await expect(camaRows.first()).toContainText('BI-RADS'); await page.goto('/indicadores/tea'); - await expect(page.getByRole('tab', { name: 'Resumen' })).toBeVisible(); + await expect(page.getByRole('tab', { name: 'Indicadores' })).toBeVisible(); expect(problems).toEqual([]); }); @@ -208,8 +208,8 @@ 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); + await expect(page.getByRole('tab', { name: 'Análisis de Riesgo', exact: true })).toHaveCount(1); + await expect(page.getByRole('tab', { name: 'Trazabilidad', exact: true })).toHaveCount(1); const labels = await page.getByRole('tab').allTextContents(); expect(new Set(labels.map((s) => s.trim())).size).toBe(labels.length); }); @@ -278,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: 'Histórico' }).click(); + await page.getByRole('tab', { name: 'Trazabilidad' }).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/bars.spec.ts b/src/app/indicadores/bars.spec.ts index 605cad1..9287f00 100644 --- a/src/app/indicadores/bars.spec.ts +++ b/src/app/indicadores/bars.spec.ts @@ -157,15 +157,15 @@ describe('bars', () => { ); const y = (f.data[0] as any).y; expect(y).toEqual([ - 'Detección inicial
n = 0', - 'Detección subsecuente
n = 8', - 'Sin dato
n = 2', + 'Detección inicial
Pacientes: 0', + 'Detección subsecuente
Pacientes: 8', + 'Sin dato
Pacientes: 2', ]); expect((f.data[0] as any).x).toEqual([0, 75, 100]); }); it('leaves out a group that does not reconcile', () => { const f = draw(reading({ 'subsequent|NILM': 6 }, 10)); - expect((f.data[0] as any).y).toEqual(['Detección subsecuente
n = 6']); + expect((f.data[0] as any).y).toEqual(['Detección subsecuente
Pacientes: 6']); }); }); }); @@ -173,7 +173,7 @@ describe('bars', () => { describe('shared views of cytology and HPV by genotype', () => { const HPV = [ { code: 'negative', label: 'Negativo', color: '#42A77E', group: '' }, - { code: 'positive_other', label: 'Positivo', color: '#A8C243', group: '' }, + { code: 'positive_other', label: 'Positivo sin genotipo', color: '#A8C243', group: '' }, ]; const reading = (cells: Record): Reading => ({ populations: { 'initial-population': Object.values(cells).reduce((a, b) => a + b, 0) }, @@ -198,7 +198,7 @@ describe('shared views of cytology and HPV by genotype', () => { it('does not list a hidden category but keeps it in the total and the percentages', () => { const t = bars(counts, () => reading({}))!; - expect(t.rows.map((x) => x.label)).toEqual(['Negativo', 'Positivo']); + expect(t.rows.map((x) => x.label)).toEqual(['Negativo', 'Positivo sin genotipo']); expect(t.rows.map((x) => x.cells)).toEqual([ ['5', '50.0 %'], ['2', '20.0 %'], @@ -247,7 +247,7 @@ describe('shared views of cytology and HPV by genotype', () => { }); expect((own.data[0] as any).x).toEqual([80]); // 4 of the 5 the catalog draws expect((all.data[0] as any).x).toEqual([40]); // 4 of the group's 10 reports - expect((all.data[0] as any).y).toEqual(['25-34
n = 10']); + expect((all.data[0] as any).y).toEqual(['25-34
Reportes: 10']); }); }); diff --git a/src/app/indicadores/bars.ts b/src/app/indicadores/bars.ts index 5bb4f5f..a69359d 100644 --- a/src/app/indicadores/bars.ts +++ b/src/app/indicadores/bars.ts @@ -16,6 +16,10 @@ export type Mode = { kind: 'counts'; measure: string; catalog: Category[]; + /** The records counted in the category distribution. */ + unit?: string; + /** What the share in the second column is a share of. */ + percentLabel?: string; hidden?: Hidden; /** every bar on a fixed scale of 0 to 100 %, so its length is the share shown */ percent?: boolean; @@ -27,6 +31,7 @@ export type Mode = { order: string[]; complete?: boolean; colors?: Colors; + percentLabel?: string; } | { kind: 'positives'; @@ -35,8 +40,15 @@ export type Mode = { order: string[]; complete?: boolean; colors?: Colors; + percentLabel?: string; + } + | { + kind: 'signs'; + measure: string; + strata: string[]; + colors?: Colors; + percentLabel?: string; } - | { kind: 'signs'; measure: string; strata: string[]; colors?: Colors } | { kind: 'grouped'; measure: string; @@ -47,6 +59,8 @@ export type Mode = { order: string[]; /** what the records are called ("pacientes", "reportes") */ unit: string; + /** The denominator of the percentage shown with each grouped result. */ + percentLabel?: string; /** draw an empty group of `order` when the counts reconcile (see `reconciles`) */ complete?: boolean; /** each group's denominator is all its records, not only those of the catalog's categories */ @@ -55,10 +69,18 @@ export type Mode = { } | { kind: 'days'; steps: { label: string; measure: string }[]; tint?: Tint } /** A proportion as one bar of 0 to 100 %, its 95 % interval as the two marks on it */ - | { kind: 'ratio'; measure: string; colors?: Colors } + | { kind: 'ratio'; measure: string; colors?: Colors; percentLabel?: string } | { kind: 'days-by'; measure: string; stratum: string; tint?: Tint } /** A proportion as its two parts (what counted and what did not), in units, with the shares */ - | { kind: 'split'; measure: string; yes: string; no: string; colors?: [string, string] } + | { + kind: 'split'; + measure: string; + yes: string; + no: string; + colors?: [string, string]; + unit?: string; + percentLabel?: string; + } /** Each row's units by result (a bar in segments), and the share of the row's units with a * result that are `malignant`; a row with units and no result is not a row with none */ | { @@ -213,7 +235,7 @@ export function bars(mode: Mode, of: (measure: string) => Reading | undefined): if (r?.score === undefined || !total) return undefined; const ends = r.low !== undefined && r.high !== undefined ? [r.low, r.high] : []; return { - head: ['n/N', '%', 'IC 95 %'], + head: ['n/N', mode.percentLabel ?? 'Porcentaje', 'IC 95 %'], rows: [ { label: 'Total', @@ -239,7 +261,7 @@ export function bars(mode: Mode, of: (measure: string) => Reading | undefined): ]; const most = mode.percent ? total : Math.max(...Object.values(cells).map(size)); return { - head: ['n', '%'], + head: [mode.unit ?? 'n', mode.percentLabel ?? 'Porcentaje'], rows: all.map(({ code, label, color }) => { const n = size(cells[code]); const cols = [`${n}`, pct(n, total)]; @@ -261,6 +283,7 @@ export function bars(mode: Mode, of: (measure: string) => Reading | undefined): cells[c]['denominator'] ?? 0, mode.colors?.[c], ]), + mode.percentLabel, ); if (!patients(r) || !Object.keys(cells).length) return undefined; const sound = (c: string) => @@ -277,6 +300,7 @@ export function bars(mode: Mode, of: (measure: string) => Reading | undefined): ok, (c) => (sound(c) ? [cells[c]['numerator'], cells[c]['denominator']] : undefined), mode.colors, + mode.percentLabel, ); } case 'positives': { @@ -291,6 +315,7 @@ export function bars(mode: Mode, of: (measure: string) => Reading | undefined): const positive = size(cells[`${c}|positive`]); return [name(c), positive, positive + size(cells[`${c}|negative`]), mode.colors?.[c]]; }), + mode.percentLabel, ); if (!patients(r) || !found.size) return undefined; const ok = reconciles( @@ -306,6 +331,7 @@ export function bars(mode: Mode, of: (measure: string) => Reading | undefined): return [positive, positive + size(cells[`${c}|negative`])]; }, mode.colors, + mode.percentLabel, ); } case 'signs': { @@ -317,6 +343,7 @@ export function bars(mode: Mode, of: (measure: string) => Reading | undefined): const positive = size(strata[s]['positive']); return [name(s), positive, positive + size(strata[s]['negative']), mode.colors?.[s]]; }), + mode.percentLabel, ); } case 'days': @@ -349,7 +376,7 @@ export function bars(mode: Mode, of: (measure: string) => Reading | undefined): [mode.no, denominator - numerator], ]; return { - head: ['n', '%'], + head: [mode.unit ?? 'n', mode.percentLabel ?? 'Porcentaje'], rows: parts.map(([label, n], i) => ({ label, color: mode.colors?.[i], @@ -480,6 +507,7 @@ function complete( reconciled: boolean, counts: (code: string) => [number, number] | undefined, colors: Colors = {}, + percentLabel = 'Porcentaje', ): Bars { const extra = listed.filter((c) => !order.includes(c)); const rows: Bar[] = [...order, ...extra].map((code) => { @@ -507,7 +535,7 @@ function complete( const none = empty.length === classified.length; const unclassified = counts('no_data')?.[1] ?? 0; return { - head: ['n/N', '%'], + head: ['n/N', percentLabel], rows, note: !reconciled ? 'Los conteos del informe no concilian con el total de pacientes: los grupos ausentes no se muestran como cero.' @@ -520,10 +548,13 @@ function complete( }; } -function ratios(rows: [string, number, number, string?][]): Bars | undefined { +function ratios( + rows: [string, number, number, string?][], + percentLabel = 'Porcentaje', +): Bars | undefined { if (!rows.length) return undefined; return { - head: ['n/N', '%'], + head: ['n/N', percentLabel], rows: rows.map(([label, n, total, color]) => ({ label, color, @@ -543,7 +574,7 @@ function medians( const top = Math.max(...rows.flatMap((r) => [r.score?.score ?? 0, r.score?.high ?? 0])) || 1; const at = (v: number) => (100 * v) / top; return { - head: ['Mediana', 'n', 'Q1–Q3'], + head: ['Mediana', 'Observaciones', 'Q1–Q3'], markColor: tint?.mark, rows: rows.map(({ label, n, score: s }) => { if (s?.score === undefined) return { label, width: 0, marks: [], cells: ['—', `${n}`, '—'] }; diff --git a/src/app/indicadores/figures.ts b/src/app/indicadores/figures.ts index 743c354..9984569 100644 --- a/src/app/indicadores/figures.ts +++ b/src/app/indicadores/figures.ts @@ -125,7 +125,7 @@ export function scenarioBars( : catalog.categories.reduce((t, c) => t + n(s, c.code), 0), ); const y = order - ? scenarios.map((s, i) => `${label(s)}
n = ${totals[i]}`) + ? scenarios.map((s, i) => `${label(s)}
${options.ofAll ? 'Reportes' : 'Pacientes'}: ${totals[i]}`) : scenarios.map(label); return { data: catalog.categories.map((c) => ({ @@ -304,9 +304,11 @@ export function shareDonut(r: Reading, catalog: Catalog, center: string): Figure line: { color: '#FFFFFF', width: 2 }, }, // an empty slice says nothing (its label would sit on its neighbours') - texttemplate: values.map((v) => (v ? '%{label}
%{percent}' : '')), + texttemplate: values.map((v) => + v ? `%{label}
%{percent} del total de ${center}` : '', + ), textposition: 'outside', - hovertemplate: '%{label}
%{value} (%{percent})', + hovertemplate: `%{label}
%{value} (%{percent} del total de ${center})`, } as Partial, ], layout: { diff --git a/src/app/indicadores/indicadores.ts b/src/app/indicadores/indicadores.ts index b032aec..85b2917 100644 --- a/src/app/indicadores/indicadores.ts +++ b/src/app/indicadores/indicadores.ts @@ -36,28 +36,28 @@ import { Loading } from '../loading';

Este dominio todavía no tiene indicadores publicados.

} @else { - + - + @if (domain() === 'cacu') { - + } @else if (domain() === 'tea') { - + } @else if (domain() === 'cama') { - + diff --git a/src/app/indicadores/measures.ts b/src/app/indicadores/measures.ts index 54793ee..2aa6816 100644 --- a/src/app/indicadores/measures.ts +++ b/src/app/indicadores/measures.ts @@ -106,6 +106,7 @@ export const LABELS: Record = { normal: 'Normal', carcinoma: 'Carcinoma', no_data: 'Sin dato', + '<25': '<25 años (sin límite inferior)', no_biopsy: 'Sin biopsia', pre_colposcopy: 'Pre colposcopia', post_colposcopy: 'Post colposcopia', diff --git a/src/app/indicadores/pages-cacu.ts b/src/app/indicadores/pages-cacu.ts index d965a76..3ff6d83 100644 --- a/src/app/indicadores/pages-cacu.ts +++ b/src/app/indicadores/pages-cacu.ts @@ -59,7 +59,7 @@ const HPV = [ { code: 'positive_16', label: 'VPH 16', color: HPV_COLORS['positive_16'] }, { code: 'positive_18', label: 'VPH 18', color: HPV_COLORS['positive_18'] }, { code: 'positive_16_18', label: 'VPH 16 y 18', color: HPV_COLORS['positive_16_18'] }, - { code: 'positive_other', label: 'Positivo', color: HPV_COLORS['positive_other'] }, + { code: 'positive_other', label: 'Positivo sin genotipo', color: HPV_COLORS['positive_other'] }, ]; const REQUESTS = [ { code: 'high_grade', label: 'LIEAG o más', color: REQUEST_COLORS['high_grade'] }, @@ -107,19 +107,28 @@ const groupViews = ( measure, catalog, unit, + caption: more.ofAll + ? 'Porcentaje de reportes de VPH del grupo por genotipo.' + : 'Porcentaje de pacientes del grupo por resultado citológico.', ...v, ...more, })); /** A PPV's card: the whole, and by each of its stratifiers. */ -const ppv = (measure: string, title: string, note: string, ...more: Mode[]): ReadingsCard => ({ +const ppv = ( + measure: string, + title: string, + note: string, + percentLabel: string, + ...more: Mode[] +): ReadingsCard => ({ kind: 'readings', title, headline: measure, footnote: true, note: `${note} Confirma la histología LIEBG o mayor.`, modes: [ - { kind: 'ratio', label: 'Total', measure, colors: PPV_DONUT }, + { kind: 'ratio', label: 'Total', measure, colors: PPV_DONUT, percentLabel }, { kind: 'shares', label: 'Citología previa', @@ -128,6 +137,7 @@ const ppv = (measure: string, title: string, note: string, ...more: Mode[]): Rea stratum: 'cytology', colors: PPV_CYTOLOGY_COLORS, order: ['ascus_plus', 'lsil_plus', 'hsil_plus', 'no_data'], + percentLabel: 'Porcentaje de pacientes con esta citología previa', }, { kind: 'shares', @@ -137,6 +147,7 @@ const ppv = (measure: string, title: string, note: string, ...more: Mode[]): Rea stratum: 'hpv', colors: HPV_COLORS, order: ['negative', 'positive', 'hpv_16', 'hpv_18', 'no_data'], + percentLabel: 'Porcentaje de pacientes de cada grupo de VPH previo', }, { kind: 'shares', @@ -145,6 +156,7 @@ const ppv = (measure: string, title: string, note: string, ...more: Mode[]): Rea stratum: 'level', colors: PPV_LEVEL_COLORS, order: ['cin1_plus', 'cin2_plus', 'carcinoma'], + percentLabel: 'Porcentaje de pacientes de cada nivel de histología', }, { kind: 'shares', @@ -155,6 +167,7 @@ const ppv = (measure: string, title: string, note: string, ...more: Mode[]): Rea colors: ROUND_COLORS, order: ROUNDS, complete: true, + percentLabel: 'Porcentaje de pacientes de cada ronda', }, ...more, ], @@ -197,7 +210,7 @@ export const CACU: Page = { opportunity: [ { kind: 'readings', - title: 'Días de la ruta del tamizaje', + title: 'Tiempos de tamizaje', note: 'Mediana en días; las marcas son el primer y el tercer cuartil.', modes: [ { @@ -217,7 +230,7 @@ export const CACU: Page = { { kind: 'days', tint: TINT, - label: 'Por pasos', + label: 'Por ventana de tiempo', caption: 'Cada paso mide a sus propias pacientes: las medianas no se suman.', steps: [ { @@ -262,7 +275,14 @@ export const CACU: Page = { title: 'Distribución de resultados citológicos', note: 'Pacientes, por su última muestra válida del periodo.', modes: [ - { kind: 'counts', label: GENERAL, measure: 'CACU_EU7', catalog: CYTOLOGY.categories }, + { + kind: 'counts', + label: GENERAL, + measure: 'CACU_EU7', + catalog: CYTOLOGY.categories, + unit: 'Pacientes', + percentLabel: 'Porcentaje de pacientes', + }, ...groupViews('CACU_EU7', CYTOLOGY.categories, 'pacientes'), ], }, @@ -277,6 +297,8 @@ export const CACU: Page = { label: GENERAL, measure: 'CACU_VPH_GENOTIPO', catalog: HPV, + unit: 'Reportes', + percentLabel: 'Porcentaje de reportes de VPH', hidden: HPV_HIDDEN, }, ...groupViews('CACU_VPH_GENOTIPO', HPV, 'reportes', { @@ -295,6 +317,8 @@ export const CACU: Page = { label: 'General', measure: 'CACU_BIOPSIA_RESULTADOS', catalog: BIOPSY.categories, + unit: 'Reportes', + percentLabel: 'Porcentaje de reportes de biopsia', }, ], }, @@ -310,6 +334,7 @@ export const CACU: Page = { 'CACU_VPP_COLPOSCOPIA', 'Tasa de confirmación histopatológica de referencia a colposcopía', 'Pacientes con colposcopía en el periodo; biopsia solicitada en los 60 días siguientes.', + 'Porcentaje de pacientes', ), }, { @@ -318,12 +343,15 @@ export const CACU: Page = { 'CACU_VPP_BIOPSIA', 'Tasa de confirmación histopatológica de referencia a biopsia', 'Pacientes con biopsia reportada, por fecha de solicitud.', + 'Porcentaje de biopsias reportadas', { kind: 'counts', label: 'Solicitudes', caption: 'Solicitudes de biopsia registradas, según su resultado.', measure: 'CACU_BIOPSIA_SOLICITUD_CONFIRMACION', catalog: REQUESTS, + unit: 'Solicitudes', + percentLabel: 'Porcentaje de solicitudes', }, ), }, diff --git a/src/app/indicadores/pages.ts b/src/app/indicadores/pages.ts index 4ccb88a..8834733 100644 --- a/src/app/indicadores/pages.ts +++ b/src/app/indicadores/pages.ts @@ -342,6 +342,7 @@ export const PAGES: Record = { measure: 'CAMA_HISTOPATOLOGIA_BIRADS', catalog: [...BIOPSY_GRADES, ...NO_RESULT], percent: true, + percentLabel: 'Porcentaje de pacientes', }, ], }, @@ -366,6 +367,7 @@ export const PAGES: Record = { measure: 'CAMA_BIOPSIAS', catalog: [...BIOPSY_GRADES, NO_RESULT[1]], percent: true, + percentLabel: 'Porcentaje de reportes de biopsia', }, ], }, @@ -386,6 +388,8 @@ export const PAGES: Record = { yes: 'Con reporte de biopsia', no: 'Sin reporte de biopsia', colors: [INSTITUTIONAL, NEUTRAL], + unit: 'Mastografías', + percentLabel: 'Porcentaje de mastografías', }, ], }, diff --git a/src/app/indicadores/readings.ts b/src/app/indicadores/readings.ts index 1b07184..36dcb28 100644 --- a/src/app/indicadores/readings.ts +++ b/src/app/indicadores/readings.ts @@ -54,7 +54,7 @@ import { Reading } from './measures'; @for (group of g.groups; track group.code) {

- {{ group.label }} n = {{ group.total }} + {{ group.label }} {{ countUnit() }}: {{ group.total }} @if (group.hint) { {{ group.hint }} } @@ -364,6 +364,11 @@ export class Readings { readonly draw = input.required<(mode: Mode) => Figure | undefined>(); protected readonly chosen = signal(''); + protected readonly countUnit = computed(() => { + const mode = this.mode(); + const unit = mode.kind === 'grouped' ? mode.unit : 'pacientes'; + return unit[0].toUpperCase() + unit.slice(1); + }); protected readonly mode = computed( () => this.modes().find((m) => m.label === (this.view() || this.chosen())) ?? this.modes()[0], ); diff --git a/src/app/indicadores/tab-riesgos.html b/src/app/indicadores/tab-riesgos.html index a3068c9..cb11d13 100644 --- a/src/app/indicadores/tab-riesgos.html +++ b/src/app/indicadores/tab-riesgos.html @@ -142,7 +142,7 @@ {{ row.age ?? 'No disponible' }} - Grupo: {{ row.ageGroup }} + Grupo: {{ name(row.ageGroup) }} {{ name(row.status) }}