35b329e235
How: the period editor puts Intervalo de análisis, Periodo seleccionado, Aplicar and the "Hay cambios sin aplicar" notice on one row, with Material density -4 (mat.theme((density: -4)) scoped to the component), and folds the applied filter and the availability hint into one small line under it. The "Selección en edición" and "Sin cambios pendientes" lines are gone: the selectors already show the draft, and the notice only appears when there is something pending. The section has less padding, a smaller title and a one-line description per domain. Implications: purely presentational; the filter state, the apply rules and the requests don't change, and every spec passes unchanged. The density applies only inside the period editor, so other form fields keep the global density.
137 lines
9.3 KiB
HTML
137 lines
9.3 KiB
HTML
<section class="dashboard" [class.reporte-impresion]="preparandoReporte()" aria-labelledby="dashboard-title">
|
|
<header>
|
|
@if (fichaPacienteAbierta()) {
|
|
<h1 id="dashboard-title">Ficha del paciente</h1>
|
|
<p>Consulta individual de seguimiento de {{ domainLabels[dominio] }}</p>
|
|
} @else {
|
|
<span class="domain">{{ domainTitles[dominio] }}, investigación</span>
|
|
<h1 id="dashboard-title">Indicadores</h1>
|
|
<p>Explora los indicadores de {{ domainLabels[dominio] }}.</p>
|
|
}
|
|
</header>
|
|
@if (!fichaPacienteAbierta()) {
|
|
<div class="section-tabs" [class.dark-theme]="tema === 'oscuro'" role="tablist" [attr.aria-label]="'Secciones de ' + domainLabels[dominio]" (keydown)="sectionKeydown($event)">
|
|
@for (section of sections; track section.id) {
|
|
<button type="button" role="tab" [id]="'tab-' + section.id" [attr.aria-controls]="'panel-' + section.id"
|
|
[attr.aria-selected]="activeSection() === section.id" [tabIndex]="activeSection() === section.id ? 0 : -1"
|
|
(click)="changeSection(section.id)">{{ section.label }}</button>
|
|
}
|
|
</div>
|
|
}
|
|
|
|
<div id="panel-resumen" class="section-panel" role="tabpanel" aria-labelledby="tab-resumen" tabindex="0" [hidden]="activeSection() !== 'resumen'">
|
|
@if (!catalogLoading() && filters; as state) {
|
|
<section class="global-filters" aria-labelledby="global-filters-title" [attr.data-domain]="dominio">
|
|
<h2 id="global-filters-title" class="section-title">Filtros generales de {{ domainLabels[dominio] }}</h2>
|
|
<p class="section-description">{{ dominio === 'tea' ? 'Se aplica a las figuras y los indicadores destacados.' : 'Se aplica a los indicadores de oportunidad y las gráficas, salvo las de selección independiente.' }}</p>
|
|
<app-indicador-period-filters [state]="state" [types]="filterTypes()" [availability]="availability()" [initialPresentation]="initialPeriodBlocked"
|
|
(retryAvailability)="retryAvailability()"
|
|
(edited)="editFilters()" (apply)="applyFilters()" />
|
|
</section>
|
|
}
|
|
@if (initialPeriodState() === 'loading') {
|
|
<mat-progress-bar mode="indeterminate" [attr.aria-label]="'Buscando periodo inicial de ' + domainLabels[dominio]" />
|
|
<p role="status">Buscando el periodo más reciente con un conteo válido y positivo en «{{ initialPeriodAnchorTitle }}»…</p>
|
|
} @else if (initialPeriodState() === 'error') {
|
|
<mat-card role="alert"><p>No se pudo determinar el periodo inicial de {{ domainLabels[dominio] }}. {{ initialPeriodError() }}</p>
|
|
<button mat-stroked-button (click)="retryInitialPeriod()">Reintentar periodo inicial</button>
|
|
<p>También puedes seleccionar un periodo y pulsar Aplicar.</p></mat-card>
|
|
} @else if (initialPeriodState() === 'empty') {
|
|
<p role="status">No se encontró un periodo con un conteo válido mayor que cero en «{{ initialPeriodAnchorTitle }}». Los ceros, valores ausentes y datos ocultos no establecen un periodo inicial. Selecciona un periodo y pulsa Aplicar para consultar.</p>
|
|
<button mat-stroked-button (click)="retryInitialPeriod()">Reintentar periodo inicial</button>
|
|
} @else if (initialPeriodState() === 'unavailable') {
|
|
<p role="status">El indicador de referencia para el periodo inicial ya no está publicado. Selecciona un periodo y pulsa Aplicar para consultar los indicadores vigentes.</p>
|
|
} @else if (initialPeriodState() === 'manual') {
|
|
<p role="status">La búsqueda inicial se detuvo para conservar tu selección. Pulsa Aplicar para consultar.</p>
|
|
}
|
|
@let kpis = opportunityKpis;
|
|
@if (kpis.length && !initialPeriodBlocked) {
|
|
<section class="kpi-section" aria-labelledby="kpi-section-title" [attr.data-domain]="dominio">
|
|
@let resumen = teaResumenPeriodo;
|
|
<h2 id="kpi-section-title" class="section-title">{{ dominio === 'cacu' ? 'Indicadores de oportunidad' : resumen ? 'Resumen' : 'Indicadores destacados' }}</h2>
|
|
@if (resumen) { <app-tea-resumen-periodo [periodo]="resumen" [paneles]="kpiPanels()" /> }
|
|
<!-- With the summary the panels keep loading the data, but their cards are not shown. -->
|
|
<div class="kpi-grid" [class.kpi-grid-oculto]="resumen" [style.--kpi-count]="kpis.length + (dominio === 'cacu' ? 2 : 0)">
|
|
@for (definition of kpis; track dominio + ':' + definition.id) {
|
|
<app-indicador-kpi-panel [dominio]="dominio" [definition]="definition" [indicador]="kpiIndicator(definition.id)"
|
|
[applied]="filters?.applied" [availability]="availability()" [initialPresentation]="false" />
|
|
}
|
|
@if (dominio === 'cacu') {
|
|
<app-indicador-kpi-card title="Tiempo de tamizaje a tratamiento" state="Indicador no disponible" />
|
|
<app-indicador-kpi-card title="Tiempo de diagnóstico a tratamiento" state="Indicador no disponible" />
|
|
}
|
|
</div>
|
|
</section>
|
|
}
|
|
|
|
<section class="graphic-section" aria-labelledby="graphic-section-title">
|
|
<div class="catalog-heading">
|
|
<h2 id="graphic-section-title" class="section-title">{{ dominio === 'cacu' ? 'Indicadores clínicos' : 'Indicadores gráficos' }}</h2>
|
|
@if (!catalogLoading() && !catalogError() && catalog().length) {
|
|
<p class="catalog-count" role="status">{{ catalogOrder().length }} indicadores publicados</p>
|
|
}
|
|
</div>
|
|
@if (catalogLoading()) {
|
|
<mat-progress-bar mode="indeterminate" aria-label="Cargando catálogo" />
|
|
<p role="status">Cargando catálogo de indicadores…</p>
|
|
} @else if (catalogError()) {
|
|
<mat-card class="state" role="alert"><p>{{ catalogError() }}</p>
|
|
<button mat-stroked-button (click)="retryCatalog()">Reintentar catálogo</button></mat-card>
|
|
} @else if (!catalog().length) {
|
|
<mat-card class="state"><p role="status">No hay indicadores disponibles en el catálogo.</p>
|
|
<button mat-stroked-button (click)="retryCatalog()">Actualizar catálogo</button></mat-card>
|
|
} @else if (!initialPeriodBlocked) {
|
|
@if (searchVisible()) {
|
|
<div class="catalog-search">
|
|
<mat-form-field appearance="outline" subscriptSizing="dynamic">
|
|
<mat-label>Buscar indicadores</mat-label>
|
|
<mat-select #indicatorSelect multiple panelClass="indicator-select-panel" [ngModel]="selectedIndicators()" (ngModelChange)="changeIndicatorSelection($event)" aria-describedby="catalog-search-result">
|
|
<mat-select-trigger><span class="select-value">{{ selectionSummary() }}</span></mat-select-trigger>
|
|
@for (item of catalogOrder(); track item.id) {
|
|
<mat-option [value]="item.id"><span class="option-row"><span class="option-title">{{ item.titulo }}</span>
|
|
<a class="option-go" [href]="'#' + cardElementId(item)" (click)="goToIndicator(item.id, $event)"
|
|
[attr.aria-label]="'Ir a ' + item.titulo">Ir</a></span></mat-option>
|
|
}
|
|
</mat-select>
|
|
</mat-form-field>
|
|
<button mat-stroked-button type="button" (click)="showAllIndicators()" [disabled]="indicatorSelection() === null">Mostrar todos</button>
|
|
</div>
|
|
<p id="catalog-search-result" class="search-result" role="status">
|
|
Mostrando {{ searchResults().items.length }} de {{ catalogOrder().length }} indicadores.
|
|
</p>
|
|
}
|
|
@if (!searchResults().items.length) {
|
|
<p class="state" role="status">No hay indicadores seleccionados. Elige al menos uno en «Buscar indicadores».</p>
|
|
}
|
|
@if (dominio === 'tea') {
|
|
<div class="reporte-acciones">
|
|
<button mat-stroked-button type="button" [disabled]="preparandoReporte()" (click)="descargarReporte()">{{ preparandoReporte() ? 'Preparando reporte…' : 'Descargar reporte' }}</button>
|
|
<span>Incluye el periodo y los indicadores seleccionados. Elige «Guardar como PDF» en el cuadro de impresión.</span>
|
|
</div>
|
|
}
|
|
<div class="catalog-grid">
|
|
@for (item of searchResults().items; track cardIdentity(item)) {
|
|
<app-indicador-catalog-card [id]="cardElementId(item)" [dominio]="dominio" [indicador]="item" [tema]="tema" [applied]="figureApplied(item)" [independentPeriods]="independentPeriods(item)"
|
|
[pinned]="isPinned(item)" (pinChanged)="togglePinned(item)" />
|
|
}
|
|
</div>
|
|
}
|
|
</section>
|
|
</div>
|
|
|
|
@if (conHistorico) {
|
|
<section id="panel-historico" class="section-panel" [class.dark-theme]="tema === 'oscuro'" role="tabpanel" aria-labelledby="tab-historico" tabindex="0" [hidden]="activeSection() !== 'historico'">
|
|
<app-indicadores-historico [dominio]="dominio" [catalog]="catalog()" [tema]="tema" [active]="activeSection() === 'historico'" />
|
|
</section>
|
|
}
|
|
|
|
<section id="panel-seguimiento" class="section-panel" [class.dark-theme]="tema === 'oscuro'" role="tabpanel" [attr.aria-labelledby]="fichaPacienteAbierta() ? 'dashboard-title' : 'tab-seguimiento'" tabindex="0" [hidden]="activeSection() !== 'seguimiento'">
|
|
<app-indicadores-tracking [domainLabel]="domainLabels[dominio]" [dominio]="dominio" [active]="activeSection() === 'seguimiento'"
|
|
(fichaPacienteAbierta)="setFichaPacienteAbierta($event)" />
|
|
</section>
|
|
|
|
<section id="panel-datos" class="section-panel" [class.dark-theme]="tema === 'oscuro'" role="tabpanel" aria-labelledby="tab-datos" tabindex="0" [hidden]="activeSection() !== 'datos'">
|
|
<app-indicadores-definitions [dominio]="dominio" [catalog]="catalog()" [loading]="catalogLoading()" [error]="catalogError()" (retry)="retryCatalog()" />
|
|
</section>
|
|
</section>
|