fix(tea): one card per EEG metric and the electrode map within its column
(cherry picked from commit b53322ed72)
This commit is contained in:
committed by
Angel Capetillo Zavala
parent
c32d2b6012
commit
ef4f606648
@@ -198,6 +198,18 @@ describe('Seguimiento de TEA sobre FHIR', () => {
|
||||
expect(detalle.eeg!.mapas.map(m => m.codigo)).toEqual(['ritmo_posterior']);
|
||||
});
|
||||
|
||||
it('el mapa de electrodos del reporte no da una segunda tarjeta a su métrica', async () => {
|
||||
// Pins down: the report's result lists each metric's observation and its electrode-map one, both coded under the
|
||||
// metric's code, and only the metric observation becomes a card. Fails if the alteraciones filter stops skipping
|
||||
// `electrodos-*` observations and the metric shows up twice.
|
||||
const answer = firstValueFrom(service.detalle('P-4A59E9D8B4'));
|
||||
http.expectOne('/tea/fhir/Patient/P-4A59E9D8B4/$resumen-tea').flush(fx.resumenPaciente);
|
||||
http.expectOne('/tea/fhir/CodeSystem/tea-eeg-metrica').flush(fx.metricasEeg);
|
||||
const detalle = await answer;
|
||||
const codigos = detalle.eeg!.alteraciones.map(a => a.codigo);
|
||||
expect(codigos.filter(c => c === 'ritmo_posterior').length).toBe(1);
|
||||
});
|
||||
|
||||
it('el mapa toma el valor de cada electrodo y deja en blanco lo que ninguno alcanza', () => {
|
||||
// Pins down: the electrode's own z at its position, regions averaged from the measured electrodes only, and no
|
||||
// value far from every electrode. Fails if the map paints the whole head from a few occipital electrodes.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
:host { display: block; container-type: inline-size; }
|
||||
:host { display: block; container: host / inline-size; }
|
||||
.resumen { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: .75rem; }
|
||||
.panel { min-width: 0; padding: .75rem; border: 1px solid var(--issste-border); border-radius: var(--issste-radius); background: var(--issste-surface); }
|
||||
h3 { margin: 0 0 .15rem; font-size: 1rem; }
|
||||
@@ -55,7 +55,7 @@ h3 .mock { display: inline-block; white-space: nowrap; margin-inline-start: .5re
|
||||
.mapa h3 { margin-top: 0; }
|
||||
@keyframes aparecer { from { opacity: 0; } }
|
||||
@container (min-width: 68rem) { .alteraciones-zona { grid-column: span 2; } }
|
||||
@container zona (max-width: 42rem) { .mapa { width: 100cqw; } }
|
||||
@container host (max-width: 42rem) { .mapa { width: 100cqw; } }
|
||||
@container (max-width: 42rem) { .alteraciones-zona.abierta { grid-template-columns: minmax(0, 1fr); } }
|
||||
@media (prefers-reduced-motion: reduce) { .alteraciones-zona { transition: none; } .mapa { animation: none; } }
|
||||
.metricas { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .5rem; align-items: start; }
|
||||
|
||||
@@ -152,7 +152,8 @@ export function eegDeReporte(report: Report | undefined, observations: Observati
|
||||
const listed = observations.filter(o => ids.has(o.id));
|
||||
const calidad = (concept: Concept | undefined) => (code(concept) ?? 'SIN_ANALIZAR').toLowerCase() as TeaNivelCalidad;
|
||||
const duracion = extension(report, 'duracion-min')?.valueDecimal;
|
||||
const alteraciones = listed.filter(o => codeIn(o.code, METRICAS)).map(o => alteracion(o, metricas));
|
||||
// The report lists each metric's electrode map under the same code too; it feeds the maps, not the cards.
|
||||
const alteraciones = listed.filter(o => codeIn(o.code, METRICAS) && !o.id?.startsWith('electrodos-')).map(o => alteracion(o, metricas));
|
||||
// A metric's electrode values are `electrodos-<the metric observation's id>`.
|
||||
const mapas = observations.filter(o => o.id?.startsWith('electrodos-') && ids.has(o.id.slice('electrodos-'.length)))
|
||||
.map(o => {
|
||||
|
||||
Reference in New Issue
Block a user