Mostrar escalas de supervivencia publicadas

This commit is contained in:
2026-12-02 23:00:06 -06:00
parent a22ce12067
commit 5f92c49ed4
4 changed files with 43 additions and 6 deletions
+10 -3
View File
@@ -32,7 +32,7 @@ import { eligibilityFailure, eligibilityView, type EligibilityState } from './el
import { ineligibility } from './ineligibility';
import { parseSeries, RiskSeries, Series } from './risk-series';
import { curveFigure } from './risk-curve';
import { isRiskModel, riskGroups, riskScales, RiskScales } from './risk-scales';
import { riskGroups, riskScales, RiskScales, survivalGroups } from './risk-scales';
import { route, Stages } from './stages';
import { ageAt, ageGroup, CAMA_AGE_GROUPS, camaRows, CURP } from '../indicadores/follow-up';
import { LABELS, name, PRIORITY } from '../indicadores/measures';
@@ -183,13 +183,19 @@ export class Paciente {
return this.domain() === 'cacu' ? route(shown, this.cutoff()) : undefined;
});
/** The models whose estimate is a risk (scales, curves, PDF): not survival or recurrence. */
protected readonly riskModels = computed(() => this.models().filter((m) => isRiskModel(m.model)));
protected readonly riskModels = computed(() => this.models().filter((m) => m.measure === 'risk'));
protected readonly scales = computed(() =>
this.domain() === 'cacu' ? riskScales(this.riskModels()) : [],
);
/** CaCu: both horizons of every model, or both unavailable (the PDF keeps `scales`). */
protected readonly groups = computed(() =>
this.domain() === 'cacu' ? riskGroups(this.riskModels()) : [],
this.domain() === 'cacu'
? (() => {
const survival = survivalGroups(this.models().filter((m) => m.measure === 'mortality'));
return this.riskModels().length ? [...riskGroups(this.riskModels()), ...survival]
: survival.length ? survival : riskGroups([]);
})()
: [],
);
/** CaCu, experimental: the series her record can compare; none while the API has it off. */
protected readonly riskSeries = resource({
@@ -341,6 +347,7 @@ export class Paciente {
text: r.method?.text ?? '',
version: Number(/v(\d+)$/.exec(r.method?.text ?? '')?.[1] ?? 0),
index: r.occurrenceDateTime ?? '',
measure: ext(r, 'prediction-measure')?.valueCode,
// the clinical scenarios of the model's report she falls in
scenarios: (r.extension ?? [])
.filter((e) => e.url === EXT + 'escenario-clinico')