From 7f1e43bdc5eff01d162cc41debe6a83522902ffe Mon Sep 17 00:00:00 2001 From: edgar Date: Sun, 22 Nov 2026 16:26:55 -0600 Subject: [PATCH] =?UTF-8?q?CaCu=20indicators:=20no=20=C2=ABTiempo=20de=20t?= =?UTF-8?q?amizaje=20a=20diagn=C3=B3stico=C2=BB=20figures=20next=20to=20th?= =?UTF-8?q?e=20screening=20route=20chart?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The route chart draws every time from the sample to each event, the cytology's result and the diagnosis included, so the separate time figures repeated it. They come back only when the chart isn't shown (the catalog lacks one of its measures). --- .../indicadores/indicadores-cacu-secciones.spec.ts | 11 ++++------- src/app/features/indicadores/indicadores-page.ts | 14 +++++++------- .../indicadores-screening-route-page.spec.ts | 10 +++++----- 3 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/app/features/indicadores/indicadores-cacu-secciones.spec.ts b/src/app/features/indicadores/indicadores-cacu-secciones.spec.ts index 11845e3..56638f3 100644 --- a/src/app/features/indicadores/indicadores-cacu-secciones.spec.ts +++ b/src/app/features/indicadores/indicadores-cacu-secciones.spec.ts @@ -53,14 +53,11 @@ describe('Indicadores de CaCu: tiempos de oportunidad y figuras clínicas', () = 'catalog-card: Tiempo de toma de muestra a diagnóstico']); }); - it('con la ruta del tamizaje la gráfica dibuja colposcopía y biopsia y no hay una segunda tarjeta ni una pendiente', () => { - // Fails if the measures only the route chart draws get a card (or a «pendiente» slot) next to it, which the route - // chart's own page spec forbids. + it('con la ruta del tamizaje no hay subsección «Tiempo de tamizaje a diagnóstico»: la gráfica dibuja los tiempos', () => { + // Fails if the times the route chart draws also get a figure or a «pendiente» slot of their own next to it. abrir([...CACU, ...RUTA]); - expect(titulos('.kpi-section .catalog-grid')).toEqual([ - 'catalog-card: Tiempo de toma de muestra a resultado de citología', - 'figura-pendiente: Tiempo de toma de muestra a resultado de VPH', - 'catalog-card: Tiempo de toma de muestra a diagnóstico']); + expect(root().querySelector('.subsection-title')).toBeNull(); + expect(titulos('.kpi-section .catalog-grid')).toEqual([]); expect(root().querySelector('app-indicador-screening-route')).not.toBeNull(); expect(titulos('.graphic-section .catalog-grid')).toEqual([ 'catalog-card: Distribución de resultados citológicos', 'catalog-card: Tasa de confirmación histopatológica', diff --git a/src/app/features/indicadores/indicadores-page.ts b/src/app/features/indicadores/indicadores-page.ts index ff07dc5..4c19360 100644 --- a/src/app/features/indicadores/indicadores-page.ts +++ b/src/app/features/indicadores/indicadores-page.ts @@ -400,8 +400,9 @@ export class IndicadoresPage { const selected = new Set(this.selectedIndicators()); return { items: this.catalogOrder().filter(item => selected.has(item.id)) }; }); - // The figures of «Indicadores de oportunidad»: TEA's time figures under its summary, and CaCu's five times, each a - // pending slot while the catalog does not publish its indicator. The rest are the clinical ones. + // The figures of «Indicadores de oportunidad»: TEA's time figures under its summary and CaMa's times, each a pending + // slot while the catalog does not publish its indicator; CaCu's, only when its screening route chart isn't shown. The + // rest are the clinical ones. // The domain is not a signal: each result reads the items first, so a new catalog recomputes it whichever domain it was last for. readonly oportunidadSlots = computed((): { item?: Indicador; titulo: string }[] => { const items = this.searchResults().items; @@ -416,11 +417,10 @@ export class IndicadoresPage { return item ? { item: { ...item, titulo: figura.titulo }, titulo: figura.titulo } : { titulo: figura.titulo }; }); } - if (this.dominio !== 'cacu' || !this.catalog().length) return []; - // The screening route chart draws the measures only it uses (ROUTE_ONLY_IDS) and they get no card of their own while - // it is shown, so those slots are left to the chart instead of drawn twice or as pending. - const delaRuta = this.screeningRouteAvailable ? ROUTE_ONLY_IDS : []; - return CACU_FIGURAS_OPORTUNIDAD.filter(figura => !figura.id || !delaRuta.includes(figura.id)).map(figura => { + // With the screening route chart, CaCu has no separate time figures: the chart shows every time from the sample to + // each event. Without it (the catalog lacks one of its measures) the times keep their figures. + if (this.dominio !== 'cacu' || !this.catalog().length || this.screeningRouteAvailable) return []; + return CACU_FIGURAS_OPORTUNIDAD.map(figura => { const item = figura.id ? items.find(candidate => candidate.id === figura.id) : undefined; return item ? { item, titulo: item.titulo } : { titulo: figura.titulo }; }); 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 c226da3..2ae7b88 100644 --- a/src/app/features/indicadores/indicadores-screening-route-page.spec.ts +++ b/src/app/features/indicadores/indicadores-screening-route-page.spec.ts @@ -33,14 +33,14 @@ describe('Ruta del tamizaje: página de CaCu', () => { const ruta = () => fixture.nativeElement.querySelector('app-indicador-screening-route'); const tarjetas = () => fixture.debugElement.queryAll(By.directive(IndicadorCatalogCard)).map(d => (d.componentInstance as IndicadorCatalogCard).indicador.id); - it('con las siete medidas publicadas aparece la gráfica y sus medidas exclusivas no tienen tarjeta', () => { - // Pins down: the chart replaces the cards of the five measures only it draws, while the cytology's and the diagnosis' - // keep theirs. Fails if the chart stops appearing, or a measure it draws also shows as a card. + it('con las siete medidas publicadas aparece la gráfica y ninguna de sus medidas tiene tarjeta', () => { + // Pins down: the chart replaces the cards of every time it draws, the cytology's and the diagnosis' included (the + // «Tiempo de tamizaje a diagnóstico» figures). Fails if the chart stops appearing, or a time it draws also shows as + // a card. abrir('cacu', [item('cacu_eu7', 'C2'), ...ROUTE_IDS.map(id => item(id))]); expect(ruta()).not.toBeNull(); const ids = tarjetas(); - for (const id of ROUTE_ONLY_IDS) expect(ids).not.toContain(id); - expect(ids).toContain('cacu_eu_tiempo_reporte'); + for (const id of ROUTE_IDS) expect(ids).not.toContain(id); expect(ids).toContain('cacu_eu7'); }); it('si el catálogo no publica alguna de las siete, no hay gráfica y las medidas conservan sus tarjetas', () => {