Análisis de riesgos: TEA and CaCu headings and the EEG status label

This commit is contained in:
Angel Capetillo Zavala
2026-11-22 03:21:09 -06:00
parent b5f8e5bfc2
commit ff4ad2c964
4 changed files with 16 additions and 8 deletions
@@ -36,6 +36,7 @@ describe('Seguimiento CaCu con contrato de demostración', () => {
const root:HTMLElement=fixture.nativeElement;
expect(root.textContent).not.toContain('Datos simulados — uso de demostración');
expect(root.textContent).not.toContain('Las reglas de selección son provisionales');
expect(root.querySelector('h2')?.textContent).toBe('Modelos de riesgo asociados a cáncer cervicouterino');
expect(root.textContent).toContain('Ventana consultada:');
expect(root.textContent).toContain('INSATISFACTORIO'); expect(root.textContent).toContain('Normal'); expect(root.textContent).toContain('No detectado');
expect(root.textContent).toContain('Insatisfactoria');
@@ -4,7 +4,7 @@
(registroAgregado)="pacienteDetalle.agregarRegistro($event)" (volver)="volverASeguimiento()" />
}
<div [hidden]="pacienteDetalle.estado().tipo !== 'cerrado'">
@if (dominio !== 'cama') { <h2>Seguimiento de {{ domainLabel }}</h2> }
@if (dominio !== 'cama') { <h2>{{ titulo }}</h2> }
@if (dominio === 'cama') {
<app-seguimiento-tabla [dominio]="dominio" [domainLabel]="domainLabel" [active]="active" [seleccion]="seleccion" (fichaAbierta)="cambiaFichaCama($event)"
(volverAlAnalisis)="volverAlAnalisis.emit()" />
@@ -22,8 +22,8 @@
<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>
<label>{{ dominio === 'tea' ? 'Estatus de EEG' : 'Estatus de seguimiento' }} <select name="estatus" [(ngModel)]="draft.estatus">
<option [ngValue]="undefined">Todos</option>
@for (s of statuses; track s.codigo) { <option [value]="s.codigo">{{ s.etiqueta }}</option> }
</select></label>
@if (dominio === 'tea') {
@@ -82,7 +82,7 @@
<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>
<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">Estatus de 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)">
@@ -25,6 +25,11 @@ import { TeaPacienteResumen } from './tea-paciente-resumen';
export class IndicadoresTracking implements OnChanges {
@Input({ required: true }) domainLabel = '';
@Input() dominio: Dominio = 'tea';
// The section's heading: TEA's follows its EEG, CaCu's names the risk models it will hold; the other domains keep the follow-up one.
get titulo() {
return this.dominio === 'tea' ? 'Alteraciones de EEG relacionadas al TEA'
: this.dominio === 'cacu' ? 'Modelos de riesgo asociados a cáncer cervicouterino' : 'Seguimiento de ' + this.domainLabel;
}
@Input() active = false;
/** CaMa: the patients of a curve or a cell of the analysis, for its follow-up list. */
@Input() seleccion?: SeleccionSeguimiento;
@@ -62,7 +62,7 @@ describe('Seguimiento TEA', () => {
request().flush(data); fixture.detectChanges();
const root: HTMLElement = fixture.nativeElement;
expect(Array.from(root.querySelectorAll('thead th')).map(th => th.textContent)).toEqual(
['Identificador seudónimo', 'Grupo de edad', 'Estado del caso', 'Último EEG', 'Puntaje M-CHAT', 'CSS ADOS-2', 'Alteraciones EEG']);
['Identificador seudónimo', 'Grupo de edad', 'Estado del caso', 'Último EEG', 'Puntaje M-CHAT', 'CSS ADOS-2', 'Estatus de EEG']);
const rows = root.querySelectorAll('tbody tr');
expect(rows).toHaveLength(2);
expect(rows[0].textContent).toContain('Anormal');
@@ -70,7 +70,7 @@ describe('Seguimiento TEA', () => {
expect(root.textContent).toContain('Página 1 de 1, 2 registros');
http.verify();
});
it('usa los filtros de CaCu con Alteraciones EEG en lugar del estatus', () => {
it('usa los filtros de CaCu con Estatus de EEG en lugar del estatus, bajo el título de las alteraciones de EEG', () => {
const fixture = open();
const first = request();
expect(first.request.params.get('meses')).toBe('3');
@@ -79,8 +79,10 @@ describe('Seguimiento TEA', () => {
const root: HTMLElement = fixture.nativeElement;
expect(root.querySelector('input[type=date]')).not.toBeNull();
const select = root.querySelector<HTMLSelectElement>('select[name=estatus]')!;
expect(select.closest('label')?.textContent).toContain('Alteraciones EEG');
expect(Array.from(select.options).map(o => o.textContent?.trim())).toEqual(['Todas', 'Normal', 'Anormal', 'Sin EEG válido']);
// Fails if the section goes back to the «Seguimiento de …» heading or the filter to «Alteraciones EEG».
expect(root.querySelector('h2')?.textContent).toBe('Alteraciones de EEG relacionadas al TEA');
expect(select.closest('label')?.textContent).toContain('Estatus de EEG');
expect(Array.from(select.options).map(o => o.textContent?.trim())).toEqual(['Todos', 'Normal', 'Anormal', 'Sin EEG válido']);
fixture.componentInstance.draft = { ...fixture.componentInstance.draft, estatus: 'anormal', corte: '2026-08-31', meses: 6, page_size: 20 };
fixture.componentInstance.apply();
const filtered = request();