TEA Análisis de Riesgo as the old page: its filters, the EEG summary of the filtered children and their list; the domain's full name; reports that fail to load can be retried

This commit is contained in:
Roberto Treviño
2026-11-28 10:47:22 -06:00
parent aeb2d4ec84
commit cb0403affb
8 changed files with 464 additions and 7 deletions
+10 -6
View File
@@ -126,6 +126,12 @@ export class TabIndicadores {
},
});
/** The period's readings; none while they load or when reading them failed (an errored
* resource throws on `value()`). */
protected loaded(): Map<string, Reading | undefined> | undefined {
return this.reports.hasValue() ? this.reports.value() : undefined;
}
constructor() {
effect(() => {
const latest = this.latest.value();
@@ -139,7 +145,7 @@ export class TabIndicadores {
protected readonly label = periodLabel;
protected readonly strataNames = STRATA;
protected r(m: Measure): Reading | undefined {
return this.reports.value()?.get(m.name!);
return this.loaded()?.get(m.name!);
}
protected score(m: Measure): string {
return formatScore(m, this.r(m));
@@ -166,9 +172,7 @@ export class TabIndicadores {
/** Each clinical card's figures, built once per loaded period. */
protected readonly figureSets = computed(
() =>
new Map(
this.clinical().map((m) => [m.name!, this.build(m, this.reports.value()?.get(m.name!))]),
),
new Map(this.clinical().map((m) => [m.name!, this.build(m, this.loaded()?.get(m.name!))])),
);
/** A clinical card's figures: the overall split, then one per stratum. */
@@ -192,7 +196,7 @@ export class TabIndicadores {
/** A measure's reading in the applied period, by code. */
protected rd(code: string): Reading | undefined {
return this.reports.value()?.get(code);
return this.loaded()?.get(code);
}
protected kpi(code: string): Measure | undefined {
return this.byName().get(code);
@@ -220,7 +224,7 @@ export class TabIndicadores {
}
/** TEA's summary of the period: its numbers from the measures (none: no summary). */
protected readonly teaSummary = computed(() => {
const rd = (c: string) => this.reports.value()?.get(c);
const rd = (c: string) => this.loaded()?.get(c);
const status = rd('M28_CASOS_POR_ESTADO');
if (!status) return undefined;
const n = (r: Reading | undefined, pop: string) => r?.populations[pop] ?? 0;