feat(cama): "cáncer de mama" instead of CaMa, and CaCu's brief wording
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.
This commit is contained in:
+1
-1
@@ -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']);
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ export class App {
|
||||
private readonly route = inject(ActivatedRoute);
|
||||
|
||||
protected readonly title = 'Plataforma de Indicadores';
|
||||
protected readonly domainLabels: Record<Dominio, string> = { tea: 'TEA', cacu: 'CaCu', cama: 'CaMa' };
|
||||
protected readonly domainLabels: Record<Dominio, string> = { 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.
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
@@ -19,7 +19,7 @@ interface KpiDisplay extends KpiResult { period?: string; earlier?: boolean; ver
|
||||
imports: [IndicadorKpiCard, MatButtonModule],
|
||||
template: `<app-indicador-kpi-card [title]="definition.title" [value]="result().value" [unit]="definition.unit"
|
||||
[state]="result().state" [additionalInfo]="result().info" [temporalReference]="temporalReference"
|
||||
[loading]="result().loading ?? false" [notes]="dominio === 'cacu' ? [] : result().notes ?? []" [intervalo]="result().intervalo" />
|
||||
[loading]="result().loading ?? false" [notes]="dominio !== 'tea' ? [] : result().notes ?? []" [intervalo]="result().intervalo" />
|
||||
@if (result().state === 'Error de consulta') {
|
||||
<button type="button" mat-stroked-button (click)="retry()" [attr.aria-label]="'Reintentar ' + definition.title">Reintentar consulta</button>
|
||||
}`,
|
||||
|
||||
@@ -19,7 +19,7 @@ export class IndicadoresDefinitions {
|
||||
@Input() loading = false;
|
||||
@Input() error = '';
|
||||
readonly retry = output<void>();
|
||||
readonly domainNames: Record<Dominio, string> = { tea: 'TEA', cacu: 'cáncer cervicouterino', cama: 'CaMa' };
|
||||
readonly domainNames: Record<Dominio, string> = { tea: 'TEA', cacu: 'cáncer cervicouterino', cama: 'cáncer de mama' };
|
||||
readonly periodNames: Record<TipoPeriodo, string> = { semestre: 'Semestral', mes: 'Mensual' };
|
||||
readonly figureDisplayName = figureDisplayName;
|
||||
readonly periodInterpretation = PERIOD_INTERPRETATION;
|
||||
|
||||
@@ -54,6 +54,11 @@ const C1_INFO: Record<Dominio, (numerador: number, denominador: number) => 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<Dominio, string> = {
|
||||
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<Dominio, (n: number, q1: number, q3: number) => 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;
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
@if (kpis.length && !initialPeriodBlocked) {
|
||||
<section class="kpi-section" aria-labelledby="kpi-section-title" [attr.data-domain]="dominio">
|
||||
@let resumen = teaResumenPeriodo;
|
||||
<h2 id="kpi-section-title" class="section-title">{{ dominio === 'cacu' ? 'Indicadores de oportunidad' : resumen ? 'Resumen' : 'Indicadores destacados' }}</h2>
|
||||
<h2 id="kpi-section-title" class="section-title">{{ dominio !== 'tea' ? 'Indicadores de oportunidad' : resumen ? 'Resumen' : 'Indicadores destacados' }}</h2>
|
||||
@if (resumen) { <app-tea-resumen-periodo [periodo]="resumen" [paneles]="kpiPanels()" /> }
|
||||
<!-- With the summary the panels keep loading the data, but their cards are not shown. -->
|
||||
<div class="kpi-grid" [class.kpi-grid-oculto]="resumen" [style.--kpi-count]="kpis.length + (dominio === 'cacu' ? 2 : 0)">
|
||||
@@ -66,7 +66,7 @@
|
||||
|
||||
<section class="graphic-section" aria-labelledby="graphic-section-title">
|
||||
<div class="catalog-heading">
|
||||
<h2 id="graphic-section-title" class="section-title">{{ dominio === 'cacu' ? 'Indicadores clínicos' : 'Indicadores gráficos' }}</h2>
|
||||
<h2 id="graphic-section-title" class="section-title">{{ dominio !== 'tea' ? 'Indicadores clínicos' : 'Indicadores gráficos' }}</h2>
|
||||
@if (!catalogLoading() && !catalogError() && catalog().length) {
|
||||
<p class="catalog-count" role="status">{{ catalogOrder().length }} indicadores publicados</p>
|
||||
}
|
||||
|
||||
@@ -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<Dominio, string> = { tea: 'TEA', cacu: 'cáncer cervicouterino', cama: 'CaMa' };
|
||||
readonly domainLabels: Record<Dominio, string> = { tea: 'TEA', cacu: 'cáncer cervicouterino', cama: 'cáncer de mama' };
|
||||
// At the start of the header line.
|
||||
readonly domainTitles: Record<Dominio, string> = { ...this.domainLabels, cacu: 'Cáncer cervicouterino' };
|
||||
readonly domainTitles: Record<Dominio, string> = { ...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] };
|
||||
|
||||
@@ -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(); });
|
||||
|
||||
Reference in New Issue
Block a user