@for (slot of oportunidadSlots(); track slot.item ? cardIdentity(slot.item) : slot.titulo) {
@if (slot.item; as item) {
@@ -130,13 +130,24 @@
}
@if (screeningRouteAvailable) {
}
- @if (histopatologiaPendiente) {
}
@for (item of clinicosItems(); track cardIdentity(item)) {
}
+ @if (histopatologiaPendiente) {
}
@if (dominio === 'cacu') {
}
+ @if (dominio === 'cama') {
+
+ @if (confirmacionCamaPendiente) {
+
+ } @else {
+
+ }
+
+ }
}
diff --git a/src/app/features/indicadores/indicadores-page.ts b/src/app/features/indicadores/indicadores-page.ts
index 883d9b3..8679af3 100644
--- a/src/app/features/indicadores/indicadores-page.ts
+++ b/src/app/features/indicadores/indicadores-page.ts
@@ -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';
diff --git a/src/app/features/indicadores/indicadores-tea-secciones.spec.ts b/src/app/features/indicadores/indicadores-tea-secciones.spec.ts
index e5e282f..dedebdf 100644
--- a/src/app/features/indicadores/indicadores-tea-secciones.spec.ts
+++ b/src/app/features/indicadores/indicadores-tea-secciones.spec.ts
@@ -67,10 +67,10 @@ describe('Indicadores de TEA: figuras de oportunidad y clínicas', () => {
expect(titles('.graphic-section').slice(0, 2)).toEqual(['Porcentaje de confirmación diagnóstica', 'Porcentaje de pacientes con diagnóstico de TEA con EEG']);
});
- it('CaMa no recibe figuras en oportunidad', () => {
- // Fails if TEA's arrangement leaks into CaMa's opportunity strip.
+ it('CaMa no recibe el resumen ni el orden de TEA en oportunidad', () => {
+ // Fails if TEA's summary or its figure order leaks into CaMa's opportunity strip (CaMa has its own time section).
open('cama', [item('cama_eu38a', 'Días de la toma de la mastografía a su resultado', 'C3r', ['fig_c3r_caja'])]);
- expect(root().querySelector('.kpi-section app-indicador-catalog-card')).toBeNull();
+ expect(root().querySelector('app-tea-resumen-periodo')).toBeNull();
});
it('la primera pestaña se llama Indicadores en los tres dominios', () => {