From cbae29bc2427f2b6a27ceac4e67684e0a265b18a Mon Sep 17 00:00:00 2001 From: rockdrigo Date: Mon, 9 Nov 2026 18:24:55 -0600 Subject: [PATCH] =?UTF-8?q?feat(cama):=20"c=C3=A1ncer=20de=20mama"=20inste?= =?UTF-8?q?ad=20of=20CaMa,=20and=20CaCu's=20brief=20wording?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit How: the parametrized domain names (domainLabels and domainTitles of the page, domainNames of Datos y definiciones, and the header menu) say "cáncer de mama" / "Cáncer de mama". Every non-TEA domain now uses CaCu's wording: "Indicadores de oportunidad" and "Indicadores clínicos" as section titles, and cards that show only their own line (the kit notes stay in the figure footers). The C2 card line comes from a per-domain C2_INFO; CaMa's says what it counts in one sentence. Implications: any text built from domainLabels changes with it (titles, aria labels, "Seguimiento de cáncer de mama"); the route and API keep the `cama` id. The header names CaMa in full while TEA and CaCu keep their short labels. The Conectar workspace still lists "CaMa"; it has its own label table. --- src/app/app.spec.ts | 2 +- src/app/app.ts | 2 +- src/app/features/indicadores/indicador-kpi-panel.spec.ts | 4 ++-- src/app/features/indicadores/indicador-kpi-panel.ts | 2 +- src/app/features/indicadores/indicadores-definitions.ts | 2 +- src/app/features/indicadores/indicadores-kpi.ts | 7 ++++++- src/app/features/indicadores/indicadores-page.html | 4 ++-- src/app/features/indicadores/indicadores-page.ts | 4 ++-- src/app/features/indicadores/seguimiento-tabla.spec.ts | 2 +- 9 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/app/app.spec.ts b/src/app/app.spec.ts index e488b2a..4aa9530 100644 --- a/src/app/app.spec.ts +++ b/src/app/app.spec.ts @@ -34,7 +34,7 @@ describe('App', () => { // Fails if the header stops naming the domain or offers the current one among the others. const page = await render('/indicadores/cama'); expect(page.querySelector('.platform-title')?.textContent).toContain('Plataforma de Indicadores'); - expect(page.querySelector('.domain-selector')?.textContent).toContain('CaMa'); + expect(page.querySelector('.domain-selector')?.textContent).toContain('Cáncer de mama'); (page.querySelector('.domain-selector') as HTMLButtonElement).click(); const options = Array.from(document.querySelectorAll('.mat-mdc-menu-panel a')).map(a => a.textContent?.trim()); expect(options).toEqual(['TEA', 'CaCu']); diff --git a/src/app/app.ts b/src/app/app.ts index aed86e0..b70a610 100644 --- a/src/app/app.ts +++ b/src/app/app.ts @@ -17,7 +17,7 @@ export class App { private readonly route = inject(ActivatedRoute); protected readonly title = 'Plataforma de Indicadores'; - protected readonly domainLabels: Record = { tea: 'TEA', cacu: 'CaCu', cama: 'CaMa' }; + protected readonly domainLabels: Record = { tea: 'TEA', cacu: 'CaCu', cama: 'Cáncer de mama' }; private readonly url = toSignal(this.router.events.pipe( filter((event) => event instanceof NavigationEnd), map(event => event.urlAfterRedirects)), { initialValue: this.router.url }); // On an indicators page the header names its domain and switches to the others. diff --git a/src/app/features/indicadores/indicador-kpi-panel.spec.ts b/src/app/features/indicadores/indicador-kpi-panel.spec.ts index e7818fa..2548c74 100644 --- a/src/app/features/indicadores/indicador-kpi-panel.spec.ts +++ b/src/app/features/indicadores/indicador-kpi-panel.spec.ts @@ -203,8 +203,8 @@ describe('KPI integración con autoridad global', () => { expect.stringContaining(domain === 'cacu' ? '5 citologías; primer cuartil: 3 días; tercer cuartil: 9 días.' : '5 mastografías; Q1 a Q3: 3 a 9 días.'), ])); expect(fixture.nativeElement.textContent).not.toContain('Definición provisional'); - // CaCu cards say only their own line; the kit notes are the figure footer. - expect(fixture.nativeElement.textContent.includes('Nota del pie de la figura.')).toBe(domain !== 'cacu'); + // CaCu and CaMa cards say only their own line; the kit notes are the figure footer. + expect(fixture.nativeElement.textContent).not.toContain('Nota del pie de la figura.'); } }); it('Aplicar Todos después del periodo compartido conserva supresión del último sin retroceder', () => { diff --git a/src/app/features/indicadores/indicador-kpi-panel.ts b/src/app/features/indicadores/indicador-kpi-panel.ts index 6fc9f2d..aab63f7 100644 --- a/src/app/features/indicadores/indicador-kpi-panel.ts +++ b/src/app/features/indicadores/indicador-kpi-panel.ts @@ -19,7 +19,7 @@ interface KpiDisplay extends KpiResult { period?: string; earlier?: boolean; ver imports: [IndicadorKpiCard, MatButtonModule], template: ` + [loading]="result().loading ?? false" [notes]="dominio !== 'tea' ? [] : result().notes ?? []" [intervalo]="result().intervalo" /> @if (result().state === 'Error de consulta') { }`, diff --git a/src/app/features/indicadores/indicadores-definitions.ts b/src/app/features/indicadores/indicadores-definitions.ts index 78f09de..4561cb6 100644 --- a/src/app/features/indicadores/indicadores-definitions.ts +++ b/src/app/features/indicadores/indicadores-definitions.ts @@ -19,7 +19,7 @@ export class IndicadoresDefinitions { @Input() loading = false; @Input() error = ''; readonly retry = output(); - readonly domainNames: Record = { tea: 'TEA', cacu: 'cáncer cervicouterino', cama: 'CaMa' }; + readonly domainNames: Record = { tea: 'TEA', cacu: 'cáncer cervicouterino', cama: 'cáncer de mama' }; readonly periodNames: Record = { semestre: 'Semestral', mes: 'Mensual' }; readonly figureDisplayName = figureDisplayName; readonly periodInterpretation = PERIOD_INTERPRETATION; diff --git a/src/app/features/indicadores/indicadores-kpi.ts b/src/app/features/indicadores/indicadores-kpi.ts index 9892d5a..e51bdba 100644 --- a/src/app/features/indicadores/indicadores-kpi.ts +++ b/src/app/features/indicadores/indicadores-kpi.ts @@ -54,6 +54,11 @@ const C1_INFO: Record strin cacu: (n, d) => `${n} de ${d} pacientes con lesión de alto grado o mayor en biopsia.`, cama: (n, d) => `${n} de ${d} mastografías BI-RADS 4 y 5 con reporte de biopsia.`, }; +const C2_INFO: Record = { + tea: 'Conteo de pacientes únicos en el periodo.', + cacu: 'Pacientes con citología tomada en el periodo.', + cama: 'Pacientes con mastografía BI-RADS 4, 5 o 6 en el periodo.', +}; const C3R_INFO: Record string> = { tea: (n, q1, q3) => `${n} pacientes; Q1 a Q3: ${q1} a ${q3} días.`, cacu: (n, q1, q3) => `${n} citologías; primer cuartil: ${q1} días; tercer cuartil: ${q3} días.`, @@ -95,7 +100,7 @@ export function kpiResult(data: IndicadorDatos, definition: KpiDefinition, domai if (!rows.every(row => count(row['n']))) return empty; const value = rows.reduce((sum, row) => sum + (row['n'] as number), 0); if (!count(value)) return empty; - return { state: 'Disponible', value, categorias: Object.fromEntries(rows.map(row => [row['categoria'] as string, row['n'] as number])), info: domain === 'cacu' ? 'Pacientes con citología tomada en el periodo.' : 'Conteo de pacientes únicos en el periodo.' }; + return { state: 'Disponible', value, categorias: Object.fromEntries(rows.map(row => [row['categoria'] as string, row['n'] as number])), info: C2_INFO[domain] }; } if (definition.contrato === 'C1') { if (!finite(row['valor']) || row['valor'] < 0 || row['valor'] > 100 || !count(row['numerador']) || !count(row['denominador']) || row['numerador'] > row['denominador']) return empty; diff --git a/src/app/features/indicadores/indicadores-page.html b/src/app/features/indicadores/indicadores-page.html index 8f57ef6..4051f2e 100644 --- a/src/app/features/indicadores/indicadores-page.html +++ b/src/app/features/indicadores/indicadores-page.html @@ -48,7 +48,7 @@ @if (kpis.length && !initialPeriodBlocked) {
@let resumen = teaResumenPeriodo; -

{{ dominio === 'cacu' ? 'Indicadores de oportunidad' : resumen ? 'Resumen' : 'Indicadores destacados' }}

+

{{ dominio !== 'tea' ? 'Indicadores de oportunidad' : resumen ? 'Resumen' : 'Indicadores destacados' }}

@if (resumen) { }
@@ -66,7 +66,7 @@
-

{{ dominio === 'cacu' ? 'Indicadores clínicos' : 'Indicadores gráficos' }}

+

{{ dominio !== 'tea' ? 'Indicadores clínicos' : 'Indicadores gráficos' }}

@if (!catalogLoading() && !catalogError() && catalog().length) {

{{ catalogOrder().length }} indicadores publicados

} diff --git a/src/app/features/indicadores/indicadores-page.ts b/src/app/features/indicadores/indicadores-page.ts index 07e70cd..6f85da6 100644 --- a/src/app/features/indicadores/indicadores-page.ts +++ b/src/app/features/indicadores/indicadores-page.ts @@ -269,9 +269,9 @@ export class IndicadoresPage { private readonly destroyRef = inject(DestroyRef); private readonly route = inject(ActivatedRoute, { optional: true }); dominio: Dominio = 'tea'; - readonly domainLabels: Record = { tea: 'TEA', cacu: 'cáncer cervicouterino', cama: 'CaMa' }; + readonly domainLabels: Record = { tea: 'TEA', cacu: 'cáncer cervicouterino', cama: 'cáncer de mama' }; // At the start of the header line. - readonly domainTitles: Record = { ...this.domainLabels, cacu: 'Cáncer cervicouterino' }; + readonly domainTitles: Record = { ...this.domainLabels, cacu: 'Cáncer cervicouterino', cama: 'Cáncer de mama' }; // Short form for the domain-switcher buttons (our shell's own nav, see the // template comment above it) -- `domainLabels`/`domainTitles` are prose-length. readonly kpisByDomain = { ...KPI_BY_DOMAIN, tea: [...KPI_BY_DOMAIN.tea, ...KPI_RESUMEN_TEA] }; diff --git a/src/app/features/indicadores/seguimiento-tabla.spec.ts b/src/app/features/indicadores/seguimiento-tabla.spec.ts index 0cb2f25..ad16424 100644 --- a/src/app/features/indicadores/seguimiento-tabla.spec.ts +++ b/src/app/features/indicadores/seguimiento-tabla.spec.ts @@ -46,7 +46,7 @@ describe('Seguimiento con filtros y columnas anunciados', () => { beforeEach(() => { TestBed.configureTestingModule({ providers: [provideHttpClient(), provideHttpClientTesting()] }); fixture = TestBed.createComponent(IndicadoresTracking); http = TestBed.inject(HttpTestingController); - fixture.componentRef.setInput('dominio', 'cama'); fixture.componentRef.setInput('domainLabel', 'CaMa'); + fixture.componentRef.setInput('dominio', 'cama'); fixture.componentRef.setInput('domainLabel', 'cáncer de mama'); fixture.componentRef.setInput('active', true); fixture.detectChanges(); }); afterEach(() => { fixture.destroy(); http.verify(); });