CaMa Indicadores: five time figures under «Tiempo de tamizaje a diagnóstico», requested clinical titles, order and confirmation rate
This commit is contained in:
@@ -7,8 +7,8 @@
|
||||
@case ('incompatible') { <div role="alert"><p>Respuesta incompatible: {{ message }}</p><button mat-stroked-button type="button" (click)="retry()">Reintentar</button></div> }
|
||||
}
|
||||
@if (status() === 'ready' && model; as m) {
|
||||
@let tituloMastografias = 'Porcentaje de mastografías con resultado en la clasificación de BI-RADS 4, 5 o 6, ' + m.periodo;
|
||||
@let tituloPacientes = 'Porcentaje de pacientes con resultados de BI-RADS 4, 5 o 6, ' + m.periodo;
|
||||
@let tituloMastografias = 'Porcentaje de mastografías con resultado BI-RADS 4, 5 ó 6 en ' + m.periodo;
|
||||
@let tituloPacientes = 'Porcentaje de pacientes con resultados BI-RADS 4, 5 ó 6 en ' + m.periodo;
|
||||
@if (pages.length > 1) {
|
||||
<nav class="periods" [attr.aria-label]="'Periodos, ' + indicador.titulo">
|
||||
<button type="button" aria-label="Periodo anterior" [disabled]="periodIndex === 0" (click)="changePeriod(-1)">‹</button>
|
||||
|
||||
@@ -182,7 +182,7 @@ describe('KPI integración con autoridad global', () => {
|
||||
// CaMa draws its cards in a different order than KPI_BY_DOMAIN: answer each request by its indicator.
|
||||
req.forEach(r => r.flush({ ...response(KPI_BY_DOMAIN[domain].findIndex(d => r.request.url.endsWith('/' + d.id + '/datos')), domain), notas: ['Nota del pie de la figura.'] }));
|
||||
fixture.detectChanges();
|
||||
const cards = [...fixture.nativeElement.querySelectorAll('app-indicador-kpi-card')];
|
||||
const cards = [...fixture.nativeElement.querySelectorAll('.kpi-section app-indicador-kpi-card')];
|
||||
expect(cards).toHaveLength(5);
|
||||
expect(cards.map(card => card.querySelector('.value')?.firstChild?.textContent?.trim())).toEqual(['5', undefined, '7', undefined, undefined]);
|
||||
expect(cards.map(card => card.querySelector('.value span')?.textContent.trim())).toEqual(['pacientes', undefined, 'días (mediana)', undefined, undefined]);
|
||||
|
||||
@@ -199,15 +199,15 @@ describe('CaMa Resumen con CAM-01, CAM-02 y CAM-03 publicados', () => {
|
||||
return pedidos;
|
||||
}
|
||||
const root = () => fixture.nativeElement as HTMLElement;
|
||||
const kpis = () => [...root().querySelectorAll('.kpi-grid app-indicador-kpi-card')] as HTMLElement[];
|
||||
const tarjetas = () => [...root().querySelectorAll('.catalog-grid > *')] as HTMLElement[];
|
||||
const kpis = () => [...root().querySelectorAll('.kpi-section .kpi-grid app-indicador-kpi-card')] as HTMLElement[];
|
||||
const tarjetas = () => [...root().querySelectorAll('.graphic-section .catalog-grid > *')] as HTMLElement[];
|
||||
const completo = () => [...KPI_BY_DOMAIN.cama.map(propios), ...REALES];
|
||||
|
||||
it('muestra los valores de las cuatro medidas publicadas y deja diagnóstico a tratamiento sin dato', () => {
|
||||
// Fails if the unavailable slot displays a value or displaces the published measures.
|
||||
const pedidos = cargar(completo());
|
||||
expect(kpis()).toHaveLength(5);
|
||||
expect(root().querySelector('.kpi-grid')!.textContent).not.toContain('Integración pendiente');
|
||||
expect(root().querySelector('.kpi-section .kpi-grid')!.textContent).not.toContain('Integración pendiente');
|
||||
expect(pedidos.filter(id => id === 'cama_tasa_deteccion_histopatologica')).toHaveLength(1);
|
||||
expect(kpis()[1].querySelector('h3')?.textContent).toBe('Tasa de confirmación histopatológica');
|
||||
expect(kpis()[1].textContent).toContain('0 de 1 biopsias con riesgo a carcinoma.');
|
||||
@@ -215,10 +215,11 @@ describe('CaMa Resumen con CAM-01, CAM-02 y CAM-03 publicados', () => {
|
||||
expect(kpis()[4].querySelector('.kpi-state')?.textContent).toBe('Indicador no disponible');
|
||||
expect(kpis()[4].querySelector('.value')).toBeNull();
|
||||
});
|
||||
it('CAM-03 ocupa el lugar de la tarjeta pendiente, primero y con su vista especializada; no se consulta mientras no es visible', () => {
|
||||
it('CAM-03 ocupa el lugar de la tarjeta pendiente, después de los conteos y con su vista especializada; no se consulta mientras no es visible', () => {
|
||||
const pedidos = cargar(completo());
|
||||
expect(root().querySelector('app-indicador-histopatologia-pendiente')).toBeNull();
|
||||
const primera = tarjetas()[0];
|
||||
// The exams' and patients' counts go first; the histopathology card is the last of the grid (the confirmation rate follows it).
|
||||
const primera = tarjetas().at(-1)!;
|
||||
expect(primera.tagName).toBe('APP-INDICADOR-CATALOG-CARD');
|
||||
expect(primera.querySelector('app-indicador-histopatologia-cama')).not.toBeNull();
|
||||
expect(primera.querySelector('h2')!.textContent).toBe('Histopatología por BI-RADS');
|
||||
|
||||
@@ -205,13 +205,15 @@ describe('Tarjetas de oportunidad de CaMa en la página', () => {
|
||||
}
|
||||
return requested;
|
||||
}
|
||||
const cards = () => [...fixture.nativeElement.querySelectorAll('.kpi-grid app-indicador-kpi-card')] as HTMLElement[];
|
||||
const cards = () => [...fixture.nativeElement.querySelectorAll('.kpi-section .kpi-grid app-indicador-kpi-card')] as HTMLElement[];
|
||||
const text = (card: HTMLElement, selector: string) => card.querySelector(selector)?.textContent?.trim();
|
||||
|
||||
it('con el catálogo actual: dos tarjetas con datos, dos pendientes y diagnóstico a tratamiento sin dato ni consulta', () => {
|
||||
// Fails if any card without a published measure makes a request or displays a value.
|
||||
const urls = load(KPI_BY_DOMAIN.cama, { listed: catalog([...KPI_BY_DOMAIN.cama, ...otros()]) });
|
||||
expect([...new Set(urls)].sort()).toEqual(KPI_BY_DOMAIN.cama.map(d => `/cama/indicadores/${d.id}/datos`).sort());
|
||||
// Fails if any card without a published measure makes a request or displays a value. The confirmation rate of the
|
||||
// clinical section is a published measure with its own panel, so it is requested too.
|
||||
const publicados = [...KPI_BY_DOMAIN.cama, CAMA_CONFIRMACION_KPI];
|
||||
const urls = load(publicados, { listed: catalog([...KPI_BY_DOMAIN.cama, ...otros()]) });
|
||||
expect([...new Set(urls)].sort()).toEqual(publicados.map(d => `/cama/indicadores/${d.id}/datos`).sort());
|
||||
expect(fixture.nativeElement.querySelector('#kpi-section-title').textContent).toBe('Indicadores de oportunidad');
|
||||
expect(fixture.nativeElement.querySelector('.kpi-period')?.textContent).toBe('Periodo 2025-S1');
|
||||
expect(cards().every(card => !card.textContent?.includes('Periodo'))).toBe(true);
|
||||
@@ -260,7 +262,7 @@ describe('Tarjetas de oportunidad de CaMa en la página', () => {
|
||||
});
|
||||
it('la tarjeta de distribución de biopsias no se dibuja en el resumen de CaMa y el resto de las figuras sigue', () => {
|
||||
// Fails if cama_biopsias comes back to the summary, or if the filter also hides other indicators.
|
||||
load(KPI_BY_DOMAIN.cama, { listed: catalog([...KPI_BY_DOMAIN.cama, ...otros()]) });
|
||||
load([...KPI_BY_DOMAIN.cama, CAMA_CONFIRMACION_KPI], { listed: catalog([...KPI_BY_DOMAIN.cama, ...otros()]) });
|
||||
const ids = fixture.componentInstance.searchResults().items.map(item => item.id);
|
||||
expect(ids).not.toContain('cama_biopsias');
|
||||
expect(ids).toContain('cama_birads_456_mastografia');
|
||||
|
||||
@@ -44,7 +44,7 @@ describe('Resumen clínico de CaMa y los demás dominios', () => {
|
||||
}
|
||||
const root = () => fixture.nativeElement as HTMLElement;
|
||||
const section = () => root().querySelector('.graphic-section') as HTMLElement;
|
||||
const titles = () => [...root().querySelectorAll('.catalog-grid app-indicador-catalog-card h2')].map(e => e.textContent?.trim());
|
||||
const titles = () => [...root().querySelectorAll('.graphic-section .catalog-grid app-indicador-catalog-card h2')].map(e => e.textContent?.trim());
|
||||
|
||||
it('CaMa: «Indicadores clínicos» muestra las tarjetas de la sección, sin el conteo de publicados', () => {
|
||||
// Fails if the heading goes back to the whole catalog while a card is not drawn.
|
||||
@@ -62,7 +62,7 @@ describe('Resumen clínico de CaMa y los demás dominios', () => {
|
||||
it('CaMa: las tarjetas que el mockup no tiene en el Resumen se retiran sin quitarlas del catálogo', () => {
|
||||
// Fails if confirmation, screening-to-diagnosis or exam-to-result come back to the summary, or leave Datos y definiciones.
|
||||
open('cama', CAMA);
|
||||
for (const titulo of ['Tasa de confirmación histopatológica', 'Tiempo de tamizaje a diagnóstico', 'Días de la toma de la mastografía a su resultado']) {
|
||||
for (const titulo of ['Tiempo de tamizaje a diagnóstico', 'Días de la toma de la mastografía a su resultado']) {
|
||||
expect(section().textContent).not.toContain(titulo);
|
||||
expect(root().querySelector('#panel-datos')!.textContent).toContain(titulo);
|
||||
}
|
||||
@@ -82,8 +82,23 @@ describe('Resumen clínico de CaMa y los demás dominios', () => {
|
||||
expect([...tarjeta.querySelectorAll('h3')].map(e => e.textContent)).toEqual(['Por categoría BI-RADS', 'Resultado de la biopsia']);
|
||||
expect(tarjeta.querySelector('app-plotly-chart, canvas, svg')).toBeNull();
|
||||
expect(/[0-9]/.test(tarjeta.textContent!)).toBe(false);
|
||||
// It comes first, as in the reference, and is not counted as a published indicator.
|
||||
expect(root().querySelector('.catalog-grid')!.firstElementChild).toBe(tarjeta);
|
||||
// It follows the exams' and patients' counts, as the request orders them, and is not counted as a published indicator.
|
||||
expect(root().querySelector('.graphic-section .catalog-grid')!.lastElementChild).toBe(tarjeta);
|
||||
});
|
||||
it('CaMa: el orden clínico es mastografías, pacientes, histopatología y tasa de confirmación', () => {
|
||||
// Fails if the clinical figures change order, if the confirmation rate leaves the clinical section or if the two
|
||||
// counts lose the titles of the request (BI-RADS 4, 5 ó 6, with the period).
|
||||
open('cama', CAMA);
|
||||
const orden = [...section().querySelectorAll('.catalog-grid > *, .kpi-grid > *')].map(e => e.tagName.toLowerCase());
|
||||
expect(orden).toEqual(['app-indicador-catalog-card', 'app-indicador-histopatologia-pendiente', 'app-indicador-kpi-panel']);
|
||||
expect(section().querySelector('.kpi-grid h3')?.textContent?.trim()).toBe('Tasa de confirmación histopatológica');
|
||||
});
|
||||
it('CaMa: sin la tasa de confirmación en el catálogo queda como pendiente al final', () => {
|
||||
// Fails if a missing indicator is dropped silently or drawn with numbers.
|
||||
open('cama', CAMA.filter(medida => medida.id !== 'cama_confirmacion_birads45'));
|
||||
const ultima = section().querySelector('.kpi-grid app-indicador-kpi-card') as HTMLElement;
|
||||
expect(ultima.textContent).toContain('Tasa de confirmación histopatológica');
|
||||
expect(ultima.textContent).toContain('Integración pendiente');
|
||||
});
|
||||
it('CaMa: si el catálogo publica el indicador histopatológico, la tarjeta pendiente deja de dibujarse', () => {
|
||||
open('cama', [...CAMA, item('cama_histopatologia_birads', 'Resultado histopatológico por categoría BI-RADS', 'C2', ['fig_c2_donas'])]);
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
// Covers CaMa's «Tiempo de tamizaje a diagnóstico» in Indicadores de oportunidad: the five figures in the order of the
|
||||
// request, each pending while the catalog does not publish its indicator. Fixtures: a CaMa catalog shaped like /cama/indicadores.
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { IndicadoresPage } from './indicadores-page';
|
||||
import { IndicadoresMemory } from './indicadores-memory';
|
||||
|
||||
const item = (id: string, titulo: string, contrato: string, figuras: string[]) => ({ id, titulo, contrato, figuras, tipos_periodo: ['semestre', 'mes'] });
|
||||
const CAMA = [
|
||||
item('cama_birads_456_paciente', 'Porcentaje de pacientes con resultados de BI-RADS 4, 5 y 6', 'C2', ['fig_c2_donas']),
|
||||
item('cama_eu38a', 'Días de la toma de la mastografía a su resultado', 'C3r', ['fig_c3r_caja']),
|
||||
item('cama_dias_resultado_diagnostico', 'Tiempo de resultado a diagnóstico', 'C3r', ['fig_c3r_caja']),
|
||||
item('cama_dias_toma_diagnostico', 'Tiempo de tamizaje a diagnóstico', 'C3r', ['fig_c3r_caja']),
|
||||
];
|
||||
|
||||
describe('Indicadores de CaMa: tiempos de oportunidad', () => {
|
||||
let fixture: ReturnType<typeof TestBed.createComponent<IndicadoresPage>>, http: HttpTestingController;
|
||||
function abrir(catalogo: ReturnType<typeof item>[]) {
|
||||
vi.stubGlobal('IntersectionObserver', class { observe() {} unobserve() {} disconnect() {} });
|
||||
TestBed.configureTestingModule({ imports: [IndicadoresPage], providers: [provideRouter([]), provideHttpClient(), provideHttpClientTesting()] });
|
||||
for (const domain of ['tea', 'cacu', 'cama'] as const) TestBed.inject(IndicadoresMemory).finishInitialKpiPresentation(domain);
|
||||
fixture = TestBed.createComponent(IndicadoresPage); http = TestBed.inject(HttpTestingController);
|
||||
http.expectOne('/tea/indicadores').flush([]); fixture.detectChanges();
|
||||
fixture.componentInstance.changeDominio('cama'); fixture.detectChanges();
|
||||
http.expectOne('/cama/indicadores').flush(catalogo); fixture.detectChanges();
|
||||
http.match(() => true); fixture.detectChanges();
|
||||
}
|
||||
// The KPI and period requests are not what these tests are about.
|
||||
afterEach(() => { fixture.destroy(); http.match(() => true); http.verify(); vi.unstubAllGlobals(); });
|
||||
const root = () => fixture.nativeElement as HTMLElement;
|
||||
const titulos = (selector: string) => [...root().querySelectorAll(selector + ' > *')]
|
||||
.map(e => e.tagName.toLowerCase().replace('app-indicador-', '') + ': ' + e.querySelector('h2')?.textContent?.trim());
|
||||
|
||||
it('las cinco figuras van en su orden con los nombres pedidos; las no publicadas quedan pendientes', () => {
|
||||
// Fails if a time figure changes place, keeps the catalog's own title, or a missing indicator is drawn as a figure.
|
||||
abrir(CAMA);
|
||||
expect(root().querySelector('.subsection-title')?.textContent).toBe('Tiempo de tamizaje a diagnóstico');
|
||||
expect(titulos('.kpi-section .catalog-grid')).toEqual([
|
||||
'catalog-card: Tiempo de toma de mastografía a interpretación radiológica',
|
||||
'catalog-card: Tiempo de interpretación radiológica a diagnóstico',
|
||||
'figura-pendiente: Tiempo de interpretación radiológica a resultado de biopsia',
|
||||
'figura-pendiente: Tiempo de diagnóstico a tratamiento',
|
||||
'catalog-card: Tiempo de tamizaje a diagnóstico']);
|
||||
});
|
||||
|
||||
it('un indicador de tiempo que el catálogo no publica queda pendiente sin dejar de ocupar su lugar', () => {
|
||||
// Fails if a missing measure shifts the order or disappears instead of showing as pending.
|
||||
abrir(CAMA.filter(medida => medida.id !== 'cama_dias_resultado_diagnostico'));
|
||||
expect(titulos('.kpi-section .catalog-grid').slice(0, 2)).toEqual([
|
||||
'catalog-card: Tiempo de toma de mastografía a interpretación radiológica',
|
||||
'figura-pendiente: Tiempo de interpretación radiológica a diagnóstico']);
|
||||
});
|
||||
|
||||
it('las figuras de tiempo no se repiten en Indicadores clínicos ni salen del catálogo de Datos y definiciones', () => {
|
||||
// Fails if a time figure gets a second card in the clinical section or loses its definition entry.
|
||||
abrir(CAMA);
|
||||
expect(root().querySelector('.graphic-section')!.textContent).not.toContain('Tiempo de tamizaje a diagnóstico');
|
||||
expect(root().querySelector('#panel-datos')!.textContent).toContain('Días de la toma de la mastografía a su resultado');
|
||||
});
|
||||
});
|
||||
@@ -213,8 +213,8 @@ describe('Tarjeta pareada de CaMa en la página', () => {
|
||||
const texto = (s: string) => root().querySelector(s)?.textContent?.replace(/\s+/g, ' ').trim();
|
||||
const h3 = [...root().querySelectorAll('app-indicador-conteos-pareados h3')].map(e => e.textContent?.trim());
|
||||
expect(h3).toEqual([
|
||||
'Porcentaje de mastografías con resultado en la clasificación de BI-RADS 4, 5 o 6, 2025-S2',
|
||||
'Porcentaje de pacientes con resultados de BI-RADS 4, 5 o 6, 2025-S2',
|
||||
'Porcentaje de mastografías con resultado BI-RADS 4, 5 ó 6 en 2025-S2',
|
||||
'Porcentaje de pacientes con resultados BI-RADS 4, 5 ó 6 en 2025-S2',
|
||||
]);
|
||||
expect(root().querySelector('.conteos')?.getAttribute('aria-label')).toBe(
|
||||
'Porcentaje de mastografías con resultado en la clasificación de BI-RADS 4, 5 o 6, por paciente y por mastografía');
|
||||
|
||||
@@ -64,6 +64,15 @@ export const CACU_FIGURAS_OPORTUNIDAD: readonly FiguraOportunidad[] = [
|
||||
{ id: 'cacu_dias_toma_diagnostico', titulo: 'Tiempo de toma de muestra a diagnóstico' },
|
||||
{ titulo: 'Tiempo de diagnóstico a tratamiento' },
|
||||
];
|
||||
// CaMa's five times of «Tiempo de tamizaje a diagnóstico», in the order of the request. Same rules as CaCu's: an entry
|
||||
// with no `id` has no published indicator yet and draws as pending.
|
||||
export const CAMA_FIGURAS_OPORTUNIDAD: readonly FiguraOportunidad[] = [
|
||||
{ id: 'cama_eu38a', titulo: 'Tiempo de toma de mastografía a interpretación radiológica' },
|
||||
{ id: 'cama_dias_resultado_diagnostico', titulo: 'Tiempo de interpretación radiológica a diagnóstico' },
|
||||
{ titulo: 'Tiempo de interpretación radiológica a resultado de biopsia' },
|
||||
{ titulo: 'Tiempo de diagnóstico a tratamiento' },
|
||||
{ id: 'cama_dias_toma_diagnostico', titulo: 'Tiempo de tamizaje a diagnóstico' },
|
||||
];
|
||||
// CaCu's clinical figures in display order, and the one still to be implemented.
|
||||
export const CACU_FIGURAS_CLINICAS: readonly string[] = ['cacu_eu7', 'cacu_confirmacion_citologia'];
|
||||
export const CACU_FIGURA_CLINICA_PENDIENTE = 'Progresión por grupo de riesgo';
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
}
|
||||
</div>
|
||||
@if (oportunidadSlots().length) {
|
||||
@if (dominio === 'cacu') { <h3 class="subsection-title">Tiempo de tamizaje a diagnóstico</h3> }
|
||||
@if (dominio === 'cacu' || dominio === 'cama') { <h3 class="subsection-title">Tiempo de tamizaje a diagnóstico</h3> }
|
||||
<div class="catalog-grid">
|
||||
@for (slot of oportunidadSlots(); track slot.item ? cardIdentity(slot.item) : slot.titulo) {
|
||||
@if (slot.item; as item) {
|
||||
@@ -130,13 +130,24 @@
|
||||
}
|
||||
@if (screeningRouteAvailable) { <app-indicador-screening-route [dominio]="dominio" [tema]="tema" /> }
|
||||
<div class="catalog-grid">
|
||||
@if (histopatologiaPendiente) { <app-indicador-histopatologia-pendiente /> }
|
||||
@for (item of clinicosItems(); track cardIdentity(item)) {
|
||||
<app-indicador-catalog-card [id]="cardElementId(item)" [dominio]="dominio" [indicador]="item" [tema]="tema" [applied]="figureApplied(item)" [independentPeriods]="independentPeriods(item)"
|
||||
[pinned]="isPinned(item)" (pinChanged)="togglePinned(item)" />
|
||||
}
|
||||
@if (histopatologiaPendiente) { <app-indicador-histopatologia-pendiente /> }
|
||||
@if (dominio === 'cacu') { <app-indicador-figura-pendiente [titulo]="figuraClinicaPendiente" /> }
|
||||
</div>
|
||||
@if (dominio === 'cama') {
|
||||
<div class="kpi-grid" style="--kpi-count: 1">
|
||||
@if (confirmacionCamaPendiente) {
|
||||
<app-indicador-kpi-card [title]="confirmacionCama.title" state="Integración pendiente"
|
||||
additionalInfo="Este indicador aún no está publicado por el catálogo institucional." />
|
||||
} @else {
|
||||
<app-indicador-kpi-panel [dominio]="dominio" [definition]="confirmacionCama" [indicador]="kpiIndicator(confirmacionCama.id)"
|
||||
[applied]="filters?.applied" [availability]="availability()" [initialPresentation]="false" />
|
||||
}
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</section>
|
||||
</div>
|
||||
|
||||
@@ -17,7 +17,7 @@ import { applyGlobal, domainTypes, GlobalFilterState, IndicadoresMemory, pending
|
||||
import { IndicadorPeriodFilters } from './indicador-period-filters';
|
||||
import { IndicadorCatalogCard } from './indicador-catalog-card';
|
||||
import { esSocioConteos } from './indicadores-conteos-pareados';
|
||||
import { CACU_RESULTADO_KPI, CAMA_FUERA_DEL_RESUMEN, ID_HISTOPATOLOGIA_CAMA, KPI_BY_DOMAIN, KPI_RESUMEN_TEA, CACU_FIGURAS_CLINICAS, CACU_FIGURAS_OPORTUNIDAD, CACU_FIGURA_CLINICA_PENDIENTE, KpiCardSlot, TEA_FIGURAS_CLINICAS, TEA_FIGURAS_OPORTUNIDAD, camaKpiCards } from './indicadores-kpi';
|
||||
import { CACU_RESULTADO_KPI, CAMA_FUERA_DEL_RESUMEN, ID_HISTOPATOLOGIA_CAMA, KPI_BY_DOMAIN, KPI_RESUMEN_TEA, CACU_FIGURAS_CLINICAS, CACU_FIGURAS_OPORTUNIDAD, CAMA_CONFIRMACION_KPI, CAMA_FIGURAS_OPORTUNIDAD, CACU_FIGURA_CLINICA_PENDIENTE, KpiCardSlot, TEA_FIGURAS_CLINICAS, TEA_FIGURAS_OPORTUNIDAD, camaKpiCards } from './indicadores-kpi';
|
||||
import { TeaResumenPeriodo } from './tea-resumen-periodo';
|
||||
import { IndicadorKpiPanel } from './indicador-kpi-panel';
|
||||
import { IndicadorScreeningRoute } from './indicador-screening-route';
|
||||
@@ -336,8 +336,8 @@ export class IndicadoresPage {
|
||||
private cardsDeCama(catalog: Indicador[]) {
|
||||
const ids = catalog.map(item => item.id);
|
||||
const cards = catalog.filter(item => !CAMA_FUERA_DEL_RESUMEN.includes(item.id) && !esSocioConteos(this.dominio, item.id, ids));
|
||||
// The histopathology card keeps its place, first, whether pending or published.
|
||||
return [...cards.filter(item => item.id === ID_HISTOPATOLOGIA_CAMA), ...cards.filter(item => item.id !== ID_HISTOPATOLOGIA_CAMA)];
|
||||
// The exams' and patients' counts come first, then the histopathology card (pending or published); the confirmation rate follows them.
|
||||
return [...cards.filter(item => item.id !== ID_HISTOPATOLOGIA_CAMA), ...cards.filter(item => item.id === ID_HISTOPATOLOGIA_CAMA)];
|
||||
}
|
||||
// CaMa's histopathology card keeps its place, as pending, while the catalog does not publish its indicator.
|
||||
get histopatologiaPendiente() {
|
||||
@@ -402,6 +402,16 @@ export class IndicadoresPage {
|
||||
readonly oportunidadSlots = computed((): { item?: Indicador; titulo: string }[] => {
|
||||
const items = this.searchResults().items;
|
||||
if (this.dominio === 'tea') return items.filter(item => TEA_FIGURAS_OPORTUNIDAD.includes(item.id)).map(item => ({ item, titulo: item.titulo }));
|
||||
if (this.dominio === 'cama') {
|
||||
// CaMa's time indicators have no card in the ordered list (the summary keeps them out), so look in the catalog
|
||||
// restricted to the selection. The slot names the figure as the request does, whatever title the catalog gives.
|
||||
if (!this.catalog().length) return [];
|
||||
const selected = new Set(this.selectedIndicators());
|
||||
return CAMA_FIGURAS_OPORTUNIDAD.map(figura => {
|
||||
const item = figura.id ? this.catalog().find(candidate => candidate.id === figura.id && selected.has(candidate.id)) : undefined;
|
||||
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.
|
||||
@@ -421,6 +431,9 @@ export class IndicadoresPage {
|
||||
return this.dominio === 'tea' ? items.filter(item => !TEA_FIGURAS_OPORTUNIDAD.includes(item.id)) : items;
|
||||
});
|
||||
readonly figuraClinicaPendiente = CACU_FIGURA_CLINICA_PENDIENTE;
|
||||
// CaMa's confirmation rate closes its clinical section: a number card, pending while the catalog does not publish it.
|
||||
readonly confirmacionCama = CAMA_CONFIRMACION_KPI;
|
||||
get confirmacionCamaPendiente() { return !this.catalog().some(item => item.id === CAMA_CONFIRMACION_KPI.id); }
|
||||
readonly catalogLoading = signal(true);
|
||||
readonly catalogError = signal('');
|
||||
tema: Tema = 'claro';
|
||||
|
||||
@@ -67,10 +67,10 @@ describe('Indicadores de TEA: figuras de oportunidad y clínicas', () => {
|
||||
expect(titles('.graphic-section').slice(0, 2)).toEqual(['Porcentaje de confirmación diagnóstica', 'Porcentaje de pacientes con diagnóstico de TEA con EEG']);
|
||||
});
|
||||
|
||||
it('CaMa no recibe figuras en oportunidad', () => {
|
||||
// Fails if TEA's arrangement leaks into CaMa's opportunity strip.
|
||||
it('CaMa no recibe el resumen ni el orden de TEA en oportunidad', () => {
|
||||
// Fails if TEA's summary or its figure order leaks into CaMa's opportunity strip (CaMa has its own time section).
|
||||
open('cama', [item('cama_eu38a', 'Días de la toma de la mastografía a su resultado', 'C3r', ['fig_c3r_caja'])]);
|
||||
expect(root().querySelector('.kpi-section app-indicador-catalog-card')).toBeNull();
|
||||
expect(root().querySelector('app-tea-resumen-periodo')).toBeNull();
|
||||
});
|
||||
|
||||
it('la primera pestaña se llama Indicadores en los tres dominios', () => {
|
||||
|
||||
Reference in New Issue
Block a user