Files
WebApp/src/app/features/indicadores/indicadores-page.html
T
edgar e1a8127c22 feat(indicadores): add the screening route chart to CaCu
Horizontal bars of the days from the sample to each event of the route (cytology result, colposcopy, biopsy result and
diagnosis), cumulative with the Q1 to Q3 interval or step by step with each step starting where the previous one ends.
It reads the seven duration measures of the route and shows up in CaCu's page once the catalog publishes all of them;
the measures only it draws get no card of their own.
2026-11-22 00:23:36 -06:00

152 lines
9.9 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 {
<h1 id="dashboard-title">{{ domainTitles[dominio] }}</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</h2>
<app-indicador-period-filters [state]="state" [compact]="true" [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 = kpiCards;
@if (kpis.length && !initialPeriodBlocked) {
<section class="kpi-section" aria-labelledby="kpi-section-title" [attr.data-domain]="dominio">
@let resumen = teaResumenPeriodo;
<div class="kpi-heading">
<h2 id="kpi-section-title" class="section-title">Indicadores de oportunidad</h2>
@if (periodoCompartido) { <p class="kpi-period">Periodo {{ periodoCompartido }}</p> }
</div>
@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 : dominio === 'cama' ? 1 : 0)">
@for (card of kpis; track dominio + ':' + card.definition.id) {
@if (card.pending) {
<app-indicador-kpi-card [title]="card.definition.title" state="Integración pendiente"
additionalInfo="Este indicador aún no está publicado por el catálogo institucional." />
} @else {
<app-indicador-kpi-panel [dominio]="dominio" [definition]="card.definition" [indicador]="kpiIndicator(card.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" />
} @else if (dominio === 'cama') {
<app-indicador-kpi-card title="Tiempo de diagnóstico a tratamiento" state="Indicador no disponible"
additionalInfo="Este indicador aún no está publicado por el catálogo institucional." />
}
</div>
</section>
}
<section class="graphic-section" aria-labelledby="graphic-section-title">
<div class="catalog-heading">
<h2 id="graphic-section-title" class="section-title">Indicadores clínicos</h2>
</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>
}
@if (screeningRouteAvailable) { <app-indicador-screening-route [dominio]="dominio" [tema]="tema" /> }
<div class="catalog-grid">
@if (histopatologiaPendiente) { <app-indicador-histopatologia-pendiente /> }
@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>
}
@if (conAnalisis) {
<section id="panel-analisis" class="section-panel" [class.dark-theme]="tema === 'oscuro'" role="tabpanel" aria-labelledby="tab-analisis" tabindex="0" [hidden]="activeSection() !== 'analisis'">
<p>En desarrollo</p>
</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'"
[seleccion]="seleccionSeguimiento()" (volverAlAnalisis)="volverAlAnalisis()"
(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>