CaMa: la tasa de confirmación histopatológica vuelve al catálogo

cama_confirmacion_birads45 deja de estar oculto (usuario, 2026-10-16): se ve
su tarjeta destacada con el filtro por omisión y su gráfica de tendencia
(fig_c1_puntos). Así WebApp no necesita un caso especial para un destacado
oculto del catálogo: se revierte ese mecanismo y las pruebas del colaborador
quedan como estaban.

CSO5.5

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-16 07:48:21 +00:00
parent 2cf3a5a40d
commit 1eda9eea29
6 changed files with 11 additions and 80 deletions
@@ -1,7 +1,7 @@
import { Dominio, Indicador, IndicadorDatos } from './indicadores.models';
import { Dominio, IndicadorDatos } from './indicadores.models';
import { GlobalApplied } from './indicadores-memory';
export interface KpiDefinition { id: string; title: string; contrato: 'C1' | 'C2' | 'C3r'; unit: string; hiddenInCatalog?: boolean; }
export interface KpiDefinition { id: string; title: string; contrato: 'C1' | 'C2' | 'C3r'; unit: string; }
// Provisional (oct 2026): titles are copied by hand from the `title` of each indicator's TOML
// in indicadores_kit, except the C2 patient counts, whose card shows the sum of the categories
// (patients), not the distribution. If a TOML title changes, change it here too, until the
@@ -19,20 +19,10 @@ export const KPI_BY_DOMAIN: Record<Dominio, KpiDefinition[]> = {
],
cama: [
{ id: 'cama_birads_456_paciente', title: 'Pacientes evaluadas con BI-RADS 4, 5 y 6', contrato: 'C2', unit: 'pacientes' },
{ id: 'cama_confirmacion_birads45', title: 'Tasa de confirmación histopatológica', contrato: 'C1', unit: '%', hiddenInCatalog: true },
{ id: 'cama_confirmacion_birads45', title: 'Tasa de confirmación histopatológica', contrato: 'C1', unit: '%' },
{ id: 'cama_dias_toma_diagnostico', title: 'Tiempo de tamizaje a diagnóstico', contrato: 'C3r', unit: 'días (mediana)' },
],
};
// A KPI marked `hiddenInCatalog` has its indicator `oculto` in its TOML on purpose: it is
// not in the catalog (no graphic card), but WebApi still answers its /periodos and /datos.
// These are its catalog entries, built from the definition and without figures: only the
// KPI cards and the period availability use them. Nothing until the catalog has loaded.
// Any other KPI missing from the catalog keeps the usual behavior (no query).
export function hiddenKpiIndicators(catalog: readonly Indicador[], kpis: readonly KpiDefinition[]): Indicador[] {
if (!catalog.length) return [];
return kpis.filter(d => d.hiddenInCatalog && !catalog.some(item => item.id === d.id))
.map(d => ({ id: d.id, titulo: d.title, contrato: d.contrato, figuras: [], tipos_periodo: ['semestre', 'mes'] }));
}
// C1 rows of CaCu/CaMa carry the linkId `total`; TEA's ficha names its single group `TOTAL`.
const C1_GROUP: Record<Dominio, string> = { tea: 'TOTAL', cacu: 'total', cama: 'total' };
const C1_INFO: Record<Dominio, (numerador: number, denominador: number) => string> = {