feat(indicadores): CaMa labels, single-period filters and the four-card strip

CaMa reads «cáncer de mama» everywhere on the indicators page and uses the compact filter: interval, one period and Aplicar on one row, without the mode selector, the multiple selection or the editing summaries. The opportunity strip is the four cards only, and the biopsy distribution card is no longer drawn in the summary (it stays in Datos y definiciones). Other domains keep their filter and strip.

(cherry picked from commit 7c9dcf634e5870fec35ab96347b0863b2e3bb86e)
This commit is contained in:
Angel Capetillo Zavala
2026-11-11 23:48:03 -06:00
parent 8a3f68df6b
commit 7b8fd9e01d
13 changed files with 188 additions and 46 deletions
@@ -39,8 +39,6 @@ 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: '%' },
{ id: 'cama_dias_toma_diagnostico', title: 'Tiempo de tamizaje a diagnóstico', contrato: 'C3r', unit: 'días (mediana)' },
CAMA_TAMIZAJE_RESULTADO_KPI,
],
};
@@ -55,16 +53,14 @@ export const CAMA_OPORTUNIDAD_KPIS: KpiDefinition[] = [
CAMA_RESULTADO_DIAGNOSTICO_KPI,
];
export interface KpiCardSlot { definition: KpiDefinition; pending: boolean; }
// The four opportunity cards first, each pending while its indicator is not in the catalog, then the
// other published CaMa cards. Nothing at all (not even pending cards) until the catalog publishes one of them.
// The four opportunity cards, each pending while its indicator is not in the catalog. Nothing at all
// (not even pending cards) until the catalog publishes one of them.
export function camaKpiCards(published: (id: string) => boolean): KpiCardSlot[] {
const cards = [
...CAMA_OPORTUNIDAD_KPIS.map(definition => ({ definition, pending: !published(definition.id) })),
...KPI_BY_DOMAIN.cama.filter(definition => !CAMA_OPORTUNIDAD_KPIS.includes(definition) && published(definition.id))
.map(definition => ({ definition, pending: false })),
];
const cards = CAMA_OPORTUNIDAD_KPIS.map(definition => ({ definition, pending: !published(definition.id) }));
return cards.some(card => !card.pending) ? cards : [];
}
// Published CaMa indicators whose card the summary does not draw.
export const CAMA_FUERA_DEL_RESUMEN: readonly string[] = ['cama_biopsias'];
// 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> = {