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
@@ -36,7 +36,7 @@ import { Loading } from '../loading';
<p class="muted empty">Este dominio todavía no tiene indicadores publicados.</p>
} @else {
<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()!" />
</mat-tab>
<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 { Plot } from '../plot';
import { curveFigure } from './risk-curve';
import { REASON_TEXT } from './reference-risk';
export interface SeriesPoint {
years: number;
@@ -32,10 +31,6 @@ const OUTCOME_TEXT: Record<string, string> = {
'CIN3+': 'CIN3+',
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}`;
@@ -112,8 +107,8 @@ export function parseSeries(answer: Parameters): Series[] {
</ul>
<app-plot [figure]="figure()" [height]="340" />
}
@for (s of unavailable(); track s.id) {
<p class="muted">{{ name(s) }}: no disponible. {{ why(s) }}</p>
@if (!available().length) {
<p class="muted">No disponible: datos insuficientes.</p>
}
`,
styles: `
@@ -150,7 +145,6 @@ export class RiskSeries {
readonly series = input.required<Series[]>();
protected readonly name = seriesName;
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) */
private readonly toggled = signal(new Set<string>());
protected readonly chosen = computed(
@@ -198,8 +192,4 @@ export class RiskSeries {
if (!next.delete(id)) next.add(id);
this.toggled.set(next);
}
protected why(s: Series) {
return s.reasons.map((r) => REASONS[r] ?? r).join(' ');
}
}