Ajustar resumen y ocultar series no disponibles

This commit is contained in:
2026-12-02 22:50:30 -06:00
parent c08a0b8874
commit a19874438b
3 changed files with 4 additions and 14 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ test("indicators: the KPIs are the API's MeasureReports, every tab and the patie
).not.toContainText('Sin estudios'); ).not.toContainText('Sin estudios');
await page.goto('/indicadores/cama'); await page.goto('/indicadores/cama');
await expect(page.getByRole('tab', { name: 'Indicadores' })).toBeVisible(); await expect(page.getByRole('tab', { name: 'Resumen' })).toBeVisible();
await page.getByRole('tab', { name: 'Seguimiento' }).click(); await page.getByRole('tab', { name: 'Seguimiento' }).click();
await page.locator('mat-form-field', { hasText: 'Ventana' }).click(); await page.locator('mat-form-field', { hasText: 'Ventana' }).click();
await page.getByRole('option', { name: '12 meses' }).click(); await page.getByRole('option', { name: '12 meses' }).click();
+1 -1
View File
@@ -36,7 +36,7 @@ import { Loading } from '../loading';
<p class="muted empty">Este dominio todavía no tiene indicadores publicados.</p> <p class="muted empty">Este dominio todavía no tiene indicadores publicados.</p>
} @else { } @else {
<mat-tab-group mat-stretch-tabs="false" mat-align-tabs="center" animationDuration="0ms"> <mat-tab-group mat-stretch-tabs="false" mat-align-tabs="center" animationDuration="0ms">
<mat-tab [label]="domain() === 'tea' ? 'Resumen' : 'Indicadores'"> <mat-tab label="Resumen">
<app-tab-indicadores [domain]="domain()" [measures]="measures.value()!" /> <app-tab-indicadores [domain]="domain()" [measures]="measures.value()!" />
</mat-tab> </mat-tab>
<mat-tab label="Histórico"> <mat-tab label="Histórico">
+2 -12
View File
@@ -6,7 +6,6 @@ import { MatSelectModule } from '@angular/material/select';
import type { Parameters, ParametersParameter } from 'fhir/r4'; import type { Parameters, ParametersParameter } from 'fhir/r4';
import { Plot } from '../plot'; import { Plot } from '../plot';
import { curveFigure } from './risk-curve'; import { curveFigure } from './risk-curve';
import { REASON_TEXT } from './reference-risk';
export interface SeriesPoint { export interface SeriesPoint {
years: number; years: number;
@@ -32,10 +31,6 @@ const OUTCOME_TEXT: Record<string, string> = {
'CIN3+': 'CIN3+', 'CIN3+': 'CIN3+',
cancer: 'Cáncer', cancer: 'Cáncer',
}; };
const REASONS: Record<string, string> = {
...REASON_TEXT,
history_is_registered: 'Tiene antecedentes registrados: no corresponde la tabla de ingreso.',
};
export const seriesName = (s: Series) => `${s.source} · ${OUTCOME_TEXT[s.outcome] ?? s.outcome}`; export const seriesName = (s: Series) => `${s.source} · ${OUTCOME_TEXT[s.outcome] ?? s.outcome}`;
@@ -112,8 +107,8 @@ export function parseSeries(answer: Parameters): Series[] {
</ul> </ul>
<app-plot [figure]="figure()" [height]="340" /> <app-plot [figure]="figure()" [height]="340" />
} }
@for (s of unavailable(); track s.id) { @if (!available().length) {
<p class="muted">{{ name(s) }}: no disponible. {{ why(s) }}</p> <p class="muted">No disponible: datos insuficientes.</p>
} }
`, `,
styles: ` styles: `
@@ -150,7 +145,6 @@ export class RiskSeries {
readonly series = input.required<Series[]>(); readonly series = input.required<Series[]>();
protected readonly name = seriesName; protected readonly name = seriesName;
protected readonly available = computed(() => this.series().filter((s) => s.points.length)); protected readonly available = computed(() => this.series().filter((s) => s.points.length));
protected readonly unavailable = computed(() => this.series().filter((s) => !s.points.length));
/** what the user toggled away from the default (the institutional series) */ /** what the user toggled away from the default (the institutional series) */
private readonly toggled = signal(new Set<string>()); private readonly toggled = signal(new Set<string>());
protected readonly chosen = computed( protected readonly chosen = computed(
@@ -198,8 +192,4 @@ export class RiskSeries {
if (!next.delete(id)) next.add(id); if (!next.delete(id)) next.add(id);
this.toggled.set(next); this.toggled.set(next);
} }
protected why(s: Series) {
return s.reasons.map((r) => REASONS[r] ?? r).join(' ');
}
} }