CaMa Indicadores: five time figures under «Tiempo de tamizaje a diagnóstico», requested clinical titles, order and confirmation rate

This commit is contained in:
Angel Capetillo Zavala
2026-11-22 03:11:12 -06:00
parent 6a0c3c9e92
commit f04478e600
11 changed files with 140 additions and 27 deletions
@@ -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';