WebApp shared: Plotly partial bundle, card actions, print report, export module

Plotly partial bundle (bar, scatter, box, pie, sankey, contour) replacing the cartesian dist; card-actions (published Measure definitions, settings, Volver); Descargar reporte with a print stylesheet; export module: xlsx with frozen header, autofilter, Parámetros sheet and 5,000-row cap, pdfmake documents with header/footer, allRows following next links, file names without patient identifiers; lazy-loaded export libraries.

Checks on milkpc (node:22): npm ci, ng build (initial 567 kB / 134 kB transfer), ng test 7 files passed.
This commit is contained in:
2026-11-30 13:36:35 -06:00
parent 5d03f333f7
commit 56d1ef2e8a
20 changed files with 2827 additions and 142 deletions
+12 -1
View File
@@ -3,6 +3,7 @@ import { MatTabsModule } from '@angular/material/tabs';
import type { Measure } from 'fhir/r4';
import { DOMAINS } from '../app';
import { Fhir, resources } from '../fhir';
import { ReportButton } from '../report-button';
import { TabDefiniciones } from './tab-definiciones';
import { TabIndicadores } from './tab-indicadores';
import { TabRiesgos } from './tab-riesgos';
@@ -14,6 +15,7 @@ import { TabTrazabilidad } from './tab-trazabilidad';
selector: 'app-indicadores',
imports: [
MatTabsModule,
ReportButton,
TabIndicadores,
TabTrazabilidad,
TabRiesgos,
@@ -22,7 +24,10 @@ import { TabTrazabilidad } from './tab-trazabilidad';
],
template: `
<section class="page">
<h1>{{ title() }}</h1>
<header class="page-header">
<h1>{{ title() }}</h1>
<app-report-button />
</header>
<p class="subtitle">
Indicadores de calidad y oportunidad del tamizaje, a partir de los datos cargados.
</p>
@@ -68,6 +73,12 @@ import { TabTrazabilidad } from './tab-trazabilidad';
:host {
display: block;
}
.page-header {
position: relative;
display: grid;
justify-items: center;
gap: var(--space-2);
}
h1 {
text-align: center;
}
+14 -1
View File
@@ -25,6 +25,12 @@
>
Aplicar
</button>
<span class="print-only"
>Intervalo de análisis: {{ type() === 'month' ? 'Mensual' : 'Semestral' }}</span
>
@if (chosen(); as selected) {
<span class="print-only">Periodo seleccionado: {{ label(selected) }}</span>
}
@if (applied(); as p) {
<span class="muted applied">Mostrando {{ label(p) }}</span>
}
@@ -39,8 +45,11 @@
<div class="kpis">
@for (m of kpis(); track m.id) {
<mat-card appearance="outlined" class="kpi" [attr.data-measure]="m.name">
<mat-card-content>
<mat-card-header>
<div class="kpi-title">{{ m.title }}</div>
<app-card-actions [measures]="[m]" />
</mat-card-header>
<mat-card-content>
<div class="kpi-value">{{ score(m) }}</div>
<div class="kpi-detail muted">{{ detail(m) }}</div>
</mat-card-content>
@@ -53,6 +62,10 @@
<mat-card appearance="outlined" class="route">
<mat-card-header>
<mat-card-title>Ruta del tamizaje</mat-card-title>
<app-card-actions [measures]="routeMeasures()" />
<span class="print-only">
{{ routeView() === 'sample' ? 'Acumulado desde la toma' : 'Por pasos' }}
</span>
<mat-button-toggle-group
[value]="routeView()"
(change)="routeView.set($event.value)"
+10
View File
@@ -5,6 +5,7 @@ import { MatButtonToggleModule } from '@angular/material/button-toggle';
import { MatCardModule } from '@angular/material/card';
import { MatSelectModule } from '@angular/material/select';
import type { Measure, MeasureReport } from 'fhir/r4';
import { CardActions } from '../card-actions';
import { Fhir, resources } from '../fhir';
import { Figure, Plot } from '../plot';
import { LAYOUTS } from './layout';
@@ -29,6 +30,7 @@ import {
@Component({
selector: 'app-tab-indicadores',
imports: [
CardActions,
FormsModule,
MatButtonModule,
MatButtonToggleModule,
@@ -132,6 +134,14 @@ export class TabIndicadores {
this.chosen.set(this.options()[0]);
}
protected readonly routeMeasures = computed(() => {
const view = this.routeView();
const measures = this.layout()
.route.map((step) => this.byName().get(view === 'sample' ? step.fromSample : step.fromStep))
.filter((measure) => !!measure);
return [...new Set(measures)];
});
protected readonly route = computed<Figure>(() => {
const view = this.routeView();
return medians(