1342b1712d
An input's max only flags the field and still lets a larger number be typed. The follow-up table and the tracking list now clamp the value when it changes and when the query is sent, and both read the single PAGE_SIZE_MAX instead of a literal 200. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
133 lines
9.7 KiB
HTML
133 lines
9.7 KiB
HTML
@if (pacienteDetalle.estado().tipo !== 'cerrado') {
|
|
<app-paciente-detalle [estado]="pacienteDetalle.estado()" [categorias]="categories"
|
|
[registrosTemporales]="pacienteDetalle.registrosTemporales()"
|
|
(registroAgregado)="pacienteDetalle.agregarRegistro($event)" (volver)="volverASeguimiento()" />
|
|
}
|
|
<div [hidden]="pacienteDetalle.estado().tipo !== 'cerrado'">
|
|
@if (dominio !== 'cama') { <h2>Seguimiento de {{ domainLabel }}</h2> }
|
|
@if (dominio === 'cama') {
|
|
<app-seguimiento-tabla [dominio]="dominio" [domainLabel]="domainLabel" [active]="active" [seleccion]="seleccion" (fichaAbierta)="cambiaFichaCama($event)"
|
|
(volverAlAnalisis)="volverAlAnalisis.emit()" />
|
|
} @else if (dominio !== 'cacu' && dominio !== 'tea') {
|
|
<p>El seguimiento aún no está disponible.</p>
|
|
<div class="tracking-table" role="region" aria-label="Estructura prevista de seguimiento" tabindex="0">
|
|
<table>
|
|
<thead><tr><th scope="col">Paciente / identificación</th><th scope="col">Proceso o etapa</th><th scope="col">Estado</th><th scope="col">Fecha de referencia</th><th scope="col">Responsable</th><th scope="col">Acciones</th></tr></thead>
|
|
<tbody><tr><td colspan="6">No hay registros de seguimiento disponibles.</td></tr></tbody>
|
|
</table>
|
|
</div>
|
|
} @else {
|
|
<form (ngSubmit)="apply()">
|
|
<label>Fecha de corte <input name="corte" type="date" [(ngModel)]="draft.corte" /></label>
|
|
<label>Ventana de meses <select name="meses" [(ngModel)]="draft.meses">
|
|
@for (m of [1,3,6,12]; track m) { <option [ngValue]="m">{{ m }} {{ m === 1 ? 'mes' : 'meses' }}</option> }
|
|
</select></label>
|
|
<label>{{ dominio === 'tea' ? 'Alteraciones EEG' : 'Estatus de seguimiento' }} <select name="estatus" [(ngModel)]="draft.estatus">
|
|
<option [ngValue]="undefined">{{ dominio === 'tea' ? 'Todas' : 'Todos' }}</option>
|
|
@for (s of statuses; track s.codigo) { <option [value]="s.codigo">{{ s.etiqueta }}</option> }
|
|
</select></label>
|
|
@if (dominio === 'tea') {
|
|
<label>Grupo de edad <select name="grupo_edad" [(ngModel)]="draft.grupo_edad">
|
|
<option [ngValue]="undefined">Todos</option>
|
|
@for (g of gruposEdad; track g) { <option [value]="g">{{ g }}</option> }
|
|
</select></label>
|
|
<label>Puntaje M-CHAT <select name="mchat" [(ngModel)]="draft.mchat">
|
|
<option [ngValue]="undefined">Todos</option>
|
|
@for (r of rangosMchat; track r.codigo) { <option [value]="r.codigo">{{ r.etiqueta }}</option> }
|
|
</select></label>
|
|
<label>CSS ADOS-2 <select name="css" [(ngModel)]="draft.css">
|
|
<option [ngValue]="undefined">Todos</option>
|
|
@for (r of rangosCss; track r.codigo) { <option [value]="r.codigo">{{ r.etiqueta }}</option> }
|
|
</select></label>
|
|
<label>Estado del caso <select name="estado_caso" [(ngModel)]="draft.estado_caso">
|
|
<option [ngValue]="undefined">Todos</option>
|
|
@for (e of estadosCaso; track e.codigo) { <option [value]="e.codigo">{{ e.etiqueta }}</option> }
|
|
</select></label>
|
|
<label>Tipo de alteración <select name="alteracion" [(ngModel)]="draft.alteracion">
|
|
<option [ngValue]="undefined">Todas</option>
|
|
@for (t of tiposAlteracion; track t.codigo) { <option [value]="t.codigo">{{ t.etiqueta }}</option> }
|
|
</select></label>
|
|
}
|
|
<label>Registros por página <input name="size" type="number" min="1" [max]="tamanoMaximo" required [(ngModel)]="draft.page_size" (change)="draft.page_size = acotar(draft.page_size)" /></label>
|
|
<button type="submit" [disabled]="status === 'loading'">Consultar</button>
|
|
</form>
|
|
@if (status === 'loading') { <p role="status">Cargando seguimiento…</p> }
|
|
@if (status === 'pending') { <p role="status">El seguimiento aún no está disponible para esta consulta. Funcionalidad pendiente de publicación.</p> }
|
|
@if (message && status !== 'pending') { <p role="alert">{{ message }}</p> }
|
|
@if (status === 'error' || status === 'pending') { <button type="button" (click)="retry()">Reintentar seguimiento</button> }
|
|
@if (response; as response) {
|
|
<p>Ventana consultada: {{ response.ventana.desde }} al {{ response.ventana.hasta }}.</p>
|
|
}
|
|
@if (teaData; as response) {
|
|
<section class="resumen-eeg" aria-labelledby="resumen-eeg-titulo">
|
|
<h3 id="resumen-eeg-titulo">EEG de los pacientes filtrados</h3>
|
|
@if (response.resumen_eeg.validadas) {
|
|
<dl>
|
|
<div><dt>Normales</dt><dd>{{ response.resumen_eeg.normales }}</dd></div>
|
|
<div><dt>Anormales</dt><dd>{{ response.resumen_eeg.anormales }}</dd></div>
|
|
<div><dt>Sin EEG</dt><dd>{{ response.resumen_eeg.sin_eeg }}</dd></div>
|
|
@for (a of response.resumen_eeg.por_alteracion; track a.codigo) {
|
|
<div class="tipo"><dt>{{ a.etiqueta }}</dt><dd>{{ a.n }}</dd></div>
|
|
}
|
|
</dl>
|
|
<p>Un paciente con dos alteraciones cuenta en ambas, así que los tipos pueden sumar más que los anormales.</p>
|
|
} @else {
|
|
<dl>
|
|
<div><dt>Con EEG válido</dt><dd>{{ response.resumen_eeg.con_eeg_valido }}</dd></div>
|
|
<div><dt>Sin EEG válido</dt><dd>{{ response.resumen_eeg.sin_eeg }}</dd></div>
|
|
</dl>
|
|
<p>Las alteraciones del EEG se muestran cuando se validen sus curvas de referencia.</p>
|
|
}
|
|
</section>
|
|
<div class="tracking-table" role="region" aria-label="Lista de seguimiento" tabindex="0">
|
|
<table>
|
|
<caption>Resultados disponibles por paciente</caption>
|
|
<thead><tr><th scope="col">Identificador seudónimo</th><th scope="col">Grupo de edad</th><th scope="col">Estado del caso</th><th scope="col">Último EEG</th><th scope="col">Puntaje M-CHAT</th><th scope="col">CSS ADOS-2</th><th scope="col">Alteraciones EEG</th></tr></thead>
|
|
<tbody>
|
|
@for (item of response.items; track item.id_seudonimo) {
|
|
<tr class="tea-row" [class.abierta]="teaAbierto === item.id_seudonimo" (click)="alternarTea(item.id_seudonimo, $event)">
|
|
<td><button class="row-toggle" type="button" [attr.aria-expanded]="teaAbierto === item.id_seudonimo" [attr.aria-controls]="'tea-detalle-' + item.id_seudonimo"
|
|
[attr.aria-label]="(teaAbierto === item.id_seudonimo ? 'Ocultar' : 'Ver') + ' resumen del paciente ' + item.id_seudonimo" (click)="alternarTea(item.id_seudonimo, $event)">
|
|
<span class="chevron" aria-hidden="true"></span>{{ item.id_seudonimo }}</button></td>
|
|
<td>{{ item.grupo_edad }}</td>
|
|
<td><span class="estado-caso" [attr.data-estado]="item.estado_caso">{{ etiquetaEstado[item.estado_caso] }}</span>
|
|
@if (item.pendientes.length) { <small>Falta: {{ item.pendientes.join(', ') }}</small> }</td>
|
|
<td>{{ item.ultimo_eeg ?? 'No disponible' }}</td>
|
|
<td>{{ item.mchat ?? 'No disponible' }}</td>
|
|
<td>{{ item.css_ados2 ?? 'No disponible' }}@if (item.modulo_ados2) { <small>Módulo {{ item.modulo_ados2 }}</small> }</td>
|
|
<td>@if (item.alteraciones_eeg; as eeg) { <span class="eeg" [class.eeg-anormal]="eeg === 'anormal'">{{ eeg === 'anormal' ? 'Anormal' : 'Normal' }}</span> } @else { No disponible }</td></tr>
|
|
@if (teaAbierto === item.id_seudonimo) {
|
|
<tr class="tea-detalle" [id]="'tea-detalle-' + item.id_seudonimo"><td colspan="7"><app-tea-paciente-resumen [id]="item.id_seudonimo" /></td></tr>
|
|
}
|
|
} @empty { <tr><td colspan="7">No hay registros para los filtros aplicados.</td></tr> }
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
} @else if (data; as response) {
|
|
<div class="tracking-table" role="region" aria-label="Lista de seguimiento" tabindex="0">
|
|
<table>
|
|
<caption>Resultados disponibles por paciente</caption>
|
|
<thead><tr><th scope="col">{{ etiquetaIdentidad(response) }}</th><th scope="col">Grupo de edad</th><th scope="col">Estatus de seguimiento</th><th scope="col">Última citología</th><th scope="col">Último resultado de VPH</th><th scope="col">Estudio más reciente</th><th scope="col">Días de toma a diagnóstico</th><th scope="col">Prioridad</th></tr></thead>
|
|
<tbody>
|
|
@for (item of response.items; track identidad(item).id) {
|
|
<tr tabindex="-1" (click)="abrirPaciente(item, $event)" [attr.data-paciente]="identidad(item).id">
|
|
<td><button class="patient-link" type="button" [attr.aria-label]="'Ver ficha del paciente ' + identidad(item).id" (click)="abrirPaciente(item, $event)">{{ identidad(item).id }}</button></td><td>{{ item.grupo_edad === 'sin_dato' ? 'Sin dato' : item.grupo_edad }}</td><td>{{ item.estatus.etiqueta }}</td>
|
|
<td>@if (item.ultima_citologia; as c) { {{ cytologyLabel(c) }}<small>Fecha: {{ c.fecha }}</small><small>Calidad: {{ c.calidad ?? '—' }}</small> } @else { No disponible }</td>
|
|
<td>@if (item.ultimo_vph; as v) { {{ v.resultado }}<small>Fecha: {{ v.fecha }}</small><small>Genotipo 16/18: {{ v.genotipo_16_18 === null ? 'No disponible' : v.genotipo_16_18 ? 'Presente' : 'No detectado' }}</small> } @else { No disponible }</td>
|
|
<td>{{ latestStudy(item) ?? 'No disponible' }}</td><td>{{ item.dias_toma_diagnostico ?? 'No disponible' }}</td><td>{{ item.prioridad?.etiqueta ?? 'No disponible' }}</td>
|
|
</tr>
|
|
} @empty { <tr><td colspan="8">No hay registros para los filtros aplicados.</td></tr> }
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
}
|
|
@if (response; as response) {
|
|
<nav aria-label="Paginación de seguimiento">
|
|
<button type="button" [disabled]="response.paginacion.page <= 1" (click)="navigate(response.paginacion.page - 1)">Anterior</button>
|
|
<span>Página {{ response.paginacion.page }} de {{ response.paginacion.total_pages }}, {{ response.paginacion.total_items }} registros</span>
|
|
<button type="button" [disabled]="response.paginacion.page >= response.paginacion.total_pages" (click)="navigate(response.paginacion.page + 1)">Siguiente</button>
|
|
</nav>
|
|
}
|
|
}
|
|
</div>
|