From 7fcc0091d7dc545938e6d48195b7493f131e2965 Mon Sep 17 00:00:00 2001 From: edgar Date: Sun, 22 Nov 2026 04:05:07 -0600 Subject: [PATCH] CaCu page: the opportunity strip is as it was; only the clinical section drops the empty cards With the route chart the strip had lost its time cards. Those were not the ones to remove: they are the cards of the clinical indicators section (the times, IND1, EU13, risk by band), which stay out. Co-Authored-By: Claude Sonnet 5.5 --- src/app/features/indicadores/indicadores-page.html | 4 ++-- src/app/features/indicadores/indicadores-page.ts | 5 +---- .../indicadores/indicadores-screening-route-page.spec.ts | 6 ++++++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/app/features/indicadores/indicadores-page.html b/src/app/features/indicadores/indicadores-page.html index 830144b..b03db42 100644 --- a/src/app/features/indicadores/indicadores-page.html +++ b/src/app/features/indicadores/indicadores-page.html @@ -52,7 +52,7 @@ @if (resumen) { } -
+
@for (card of kpis; track dominio + ':' + card.definition.id) { @if (card.pending) { } } - @if (dominio === 'cacu' && !screeningRouteAvailable) { + @if (dominio === 'cacu') { } @else if (dominio === 'cama') { diff --git a/src/app/features/indicadores/indicadores-page.ts b/src/app/features/indicadores/indicadores-page.ts index 233cd44..93a8b6b 100644 --- a/src/app/features/indicadores/indicadores-page.ts +++ b/src/app/features/indicadores/indicadores-page.ts @@ -348,12 +348,9 @@ export class IndicadoresPage { const selection = this.filters?.applied.selection; return this.dominio === 'tea' && selection?.mode === 'explicit' && selection.periodos.length === 1 ? selection.periodos[0] : undefined; } - // With the route chart, CaCu's strip keeps the cytology count: its times are drawn by the chart, so they get no card. get opportunityKpis() { const definitions = this.availableKpis; - if (this.dominio !== 'cacu') return definitions; - if (this.screeningRouteAvailable) return definitions.filter(definition => definition.contrato !== 'C3r'); - if (!definitions.length && !this.catalog().some(item => item.id === CACU_RESULTADO_KPI.id)) return definitions; + if (this.dominio !== 'cacu' || (!definitions.length && !this.catalog().some(item => item.id === CACU_RESULTADO_KPI.id))) return definitions; // Keep the established KPI definitions and initial-period anchor intact. const diagnosis = definitions.findIndex(item => item.id === 'cacu_dias_toma_diagnostico'); return [...definitions.slice(0, diagnosis < 0 ? definitions.length : diagnosis), CACU_RESULTADO_KPI, diff --git a/src/app/features/indicadores/indicadores-screening-route-page.spec.ts b/src/app/features/indicadores/indicadores-screening-route-page.spec.ts index 2eff58c..959845a 100644 --- a/src/app/features/indicadores/indicadores-screening-route-page.spec.ts +++ b/src/app/features/indicadores/indicadores-screening-route-page.spec.ts @@ -43,6 +43,12 @@ describe('Ruta del tamizaje: página de CaCu', () => { for (const id of [...ROUTE_IDS, ...CACU_SIN_TARJETA]) expect(ids).not.toContain(id); expect(ids).toEqual(['cacu_eu7', 'cacu_confirmacion_citologia']); }); + it('con la ruta, la franja de oportunidad conserva sus tarjetas: solo se retiran las de la sección clínica', () => { + // Fails if the opportunity strip loses a card when the route chart appears. + abrir('cacu', [item('cacu_eu7', 'C2'), ...ROUTE_IDS.map(id => item(id))]); + const titulos = [...fixture.nativeElement.querySelectorAll('.kpi-grid app-indicador-kpi-card h3')].map((h: HTMLElement) => h.textContent); + expect(titulos).toEqual(['Pacientes evaluadas', 'Días de toma a resultado', 'Tiempo de tamizaje a diagnóstico', 'Tiempo de tamizaje a tratamiento', 'Tiempo de diagnóstico a tratamiento']); + }); it('si el catálogo no publica alguna de las siete, no hay gráfica y las medidas conservan sus tarjetas', () => { // Fails if the chart appears with a measure missing, or the cards of the others disappear anyway. abrir('cacu', [item('cacu_eu7', 'C2'), ...ROUTE_IDS.filter(id => id !== 'cacu_dias_toma_biopsia').map(id => item(id))]);