Files
WebApp/src/app/indicadores/tab-indicadores.html
T

150 lines
5.3 KiB
HTML

<div class="filters card">
<h2 class="filters-title">Filtros</h2>
<div class="field">
<span class="label">Intervalo de análisis</span>
<mat-button-toggle-group
[value]="type()"
(change)="setType($event.value)"
aria-label="Intervalo de análisis"
>
<mat-button-toggle value="month">Mensual</mat-button-toggle>
<mat-button-toggle value="semester">Semestral</mat-button-toggle>
</mat-button-toggle-group>
</div>
<mat-form-field appearance="outline" subscriptSizing="dynamic">
<mat-label>Periodo seleccionado</mat-label>
<mat-select [value]="chosen()" (selectionChange)="chosen.set($event.value)">
@for (p of options(); track p) {
<mat-option [value]="p">{{ p }}</mat-option>
}
</mat-select>
</mat-form-field>
<button
mat-flat-button
(click)="applied.set(chosen())"
[disabled]="!chosen() || chosen() === applied()"
>
Aplicar
</button>
</div>
@if (reports.isLoading()) {
<app-loading what="los indicadores" text="Calculando los indicadores…" />
}
@if (page(); as pg) {
@if (applied(); as period) {
<section class="card opportunity" aria-labelledby="opportunity-title">
<div class="section-head">
<h2 id="opportunity-title">Indicadores de oportunidad</h2>
<span class="period">Periodo {{ period }}</span>
</div>
<div class="kpis">
@for (k of pg.kpis; track k.measure) {
<mat-card appearance="outlined" class="kpi" [attr.data-measure]="k.measure">
<mat-card-content>
<h3 class="kpi-title">{{ k.title }}</h3>
@if (reports.isLoading()) {
<app-loading [what]="k.title.toLowerCase()" />
} @else {
<div class="kpi-value">{{ kpiValue(k.measure) }}</div>
<div class="kpi-detail">{{ kpiNote(k.measure, k.note) }}</div>
}
</mat-card-content>
</mat-card>
}
</div>
</section>
<section class="card clinical-page" aria-labelledby="clinical-title">
<h2 id="clinical-title">Indicadores clínicos</h2>
@for (section of pg.clinical; track section.title) {
@if (section.kind === 'route') {
<h3 class="route-title">{{ section.title }}</h3>
@if (reports.isLoading()) {
<app-loading what="los tiempos de la ruta" [figure]="true" />
} @else if (routeOf(section); as fig) {
<app-plot [figure]="fig" [height]="300" />
} @else {
<p class="state">Sin tiempos publicados en el periodo.</p>
}
} @else {
<mat-card appearance="outlined" class="figure-card">
<mat-card-content>
<h2 class="figure-card-title">{{ section.title }}</h2>
<div class="figure-row">
@for (f of section.figures; track f.title) {
<div class="figure" [attr.data-figure]="f.kind">
<h3>{{ f.title }}, {{ period }}</h3>
@if (reports.isLoading()) {
<app-loading what="la figura" [figure]="true" />
} @else if (figureOf(f); as fig) {
<app-plot [figure]="fig" [height]="f.kind === 'donut' ? 360 : 380" />
} @else {
<p class="state">Sin datos en el periodo.</p>
}
</div>
}
</div>
</mat-card-content>
</mat-card>
}
}
</section>
}
} @else {
@if (kpis().length) {
<h2>Indicadores de oportunidad</h2>
<div class="kpis">
@for (m of kpis(); track m.id) {
<mat-card appearance="outlined" class="kpi" [attr.data-measure]="m.name">
<mat-card-content>
<div class="kpi-title">{{ m.title }}</div>
<div class="kpi-value">{{ score(m) }}</div>
<div class="kpi-detail muted">{{ detail(m) }}</div>
</mat-card-content>
</mat-card>
}
</div>
}
@if (layout().route.length) {
<mat-card appearance="outlined" class="route">
<mat-card-header>
<mat-card-title>Ruta del tamizaje</mat-card-title>
<mat-button-toggle-group
[value]="routeView()"
(change)="routeView.set($event.value)"
class="route-toggle"
>
<mat-button-toggle value="sample">Acumulado desde la toma</mat-button-toggle>
<mat-button-toggle value="step">Por pasos</mat-button-toggle>
</mat-button-toggle-group>
</mat-card-header>
<mat-card-content>
<app-plot [figure]="route()" [height]="260" />
</mat-card-content>
</mat-card>
}
<h2>Indicadores clínicos</h2>
<div class="clinical">
@for (m of clinical(); track m.id) {
<mat-card appearance="outlined" class="clinical-card" [attr.data-measure]="m.name">
<mat-card-header>
<mat-card-title>{{ m.title }}</mat-card-title>
<mat-card-subtitle>{{ score(m) }} · {{ detail(m) }}</mat-card-subtitle>
</mat-card-header>
<mat-card-content>
@for (f of figureSets().get(m.name!) ?? []; track f.title) {
<h3 class="figure-title">{{ f.title }}</h3>
<app-plot [figure]="f.figure" [height]="260" />
} @empty {
<p class="muted">Sin datos en el periodo.</p>
}
</mat-card-content>
</mat-card>
}
</div>
}