TEA record: Zonas más afectadas (head map and zones by deviation); survival scenarios leave Gobernanza

This commit is contained in:
Roberto Treviño
2026-11-28 17:15:43 -06:00
parent 20e26b847a
commit fd19fdaefa
10 changed files with 244 additions and 18 deletions
+16
View File
@@ -21,6 +21,7 @@ import { code, EXT, ext, Fhir, label, resources } from '../fhir';
import { scenarioFigure } from '../gobernanza/figures';
import { CURP } from '../indicadores/follow-up';
import { name } from '../indicadores/measures';
import { byDeviation, headMap, METRIC_NAMES, ZONE_NAMES } from '../eeg-labels';
import { Figure, PALETTE, Plot } from '../plot';
import { Loading } from '../loading';
@@ -233,6 +234,21 @@ export class Paciente {
(this.eeg.value()?.analysis?.metrics ?? []).some((m) => m.z !== null && m.z !== undefined),
);
protected readonly shown = signal<string | undefined>(undefined);
protected readonly metricNames = METRIC_NAMES;
protected readonly zoneNames = ZONE_NAMES;
/** "Zonas más afectadas": the alteration chosen, its zones and electrodes. */
protected readonly zone = signal<string | undefined>(undefined);
protected readonly zoned = computed(() => {
const m = this.alterations().find((a) => a.code === this.zone());
return m ? { code: m.code, zones: m.zones ?? [], electrodes: m.electrodes ?? [] } : undefined;
});
protected readonly zonesScored = computed(() =>
[...(this.zoned()?.zones ?? []), ...(this.zoned()?.electrodes ?? [])].some(
(s) => s.z !== null && s.z !== undefined,
),
);
protected readonly zoneOrder = computed(() => byDeviation(this.zoned()?.zones ?? []));
protected readonly head = computed(() => headMap(this.zoned()?.electrodes ?? []));
protected readonly curve = computed<Figure>(() => {
const models = this.models().filter((m) => m.predictions.length > 1);
return {