feat(indicadores): CaMa paired card of mammograms and patients by BI-RADS

One card draws the exams by category as a donut and, per BI-RADS family, the patients next to the exams. Patients come from cama_birads_456_paciente (each patient once per period, in the category of the most severe exam), so its exclusive categories are added within that indicator only, for the verified version 0.2.0; other versions, suppressed or missing cells leave the figure unknown. No exams-per-patient ratio is computed and patients are never derived from exams. The patients' indicator has no card of its own while the exams' one is published.

(cherry picked from commit b7bafd178896cb2715049d5c8293185f31391c92)
This commit is contained in:
Angel Capetillo Zavala
2026-11-12 00:14:36 -06:00
parent d159067efd
commit ce3ed34fbf
8 changed files with 570 additions and 3 deletions
@@ -17,6 +17,7 @@ import { IndicadoresService } from './indicadores.service';
import { applyGlobal, domainTypes, GlobalFilterState, IndicadoresMemory, pending, validDraft } from './indicadores-memory';
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, KPI_BY_DOMAIN, KpiCardSlot, camaKpiCards } from './indicadores-kpi';
import { IndicadorKpiPanel } from './indicador-kpi-panel';
import { IndicadorKpiCard } from './indicador-kpi-card';
@@ -289,6 +290,11 @@ export class IndicadoresPage {
}
return undefined;
}
// CaMa's summary: without the indicators it does not draw, and with the patients' counts on the exams' card.
private cardsDeCama(catalog: Indicador[]) {
const ids = catalog.map(item => item.id);
return catalog.filter(item => !CAMA_FUERA_DEL_RESUMEN.includes(item.id) && !esSocioConteos(this.dominio, item.id, ids));
}
// How many indicators the graphic section shows: all the catalog, except in CaMa, which draws only some of them.
get shownIndicators() { return this.dominio === 'cama' ? this.searchResults().items.length : this.catalog().length; }
get availableKpis() { return this.kpisByDomain[this.dominio].filter(definition => this.catalog().some(item => item.id === definition.id)); }
@@ -315,7 +321,7 @@ export class IndicadoresPage {
// Stable presentation priority; search matches and pins still take precedence.
const items = this.dominio === 'cacu'
? [...catalog.filter(item => item.id === 'cacu_eu7'), ...catalog.filter(item => item.id !== 'cacu_eu7')]
: this.dominio === 'cama' ? catalog.filter(item => !CAMA_FUERA_DEL_RESUMEN.includes(item.id)) : catalog;
: this.dominio === 'cama' ? this.cardsDeCama(catalog) : catalog;
if (this.dominio === 'cama') return { items, active: false, count: 0 };
const query = this.normalizeSearch(this.searchQuery());
const prioritize = (group: Indicador[]) => [