CaCu record: grouped NCI comparison, Spanish outcome names, survival texts and risk-only scales

The NCI comparison shows the reference once per horizon and one block per model, saying the
reasons that every incompatible comparison shares only once. Outcome names are translated for
display only (the API identifiers stay), and the reference outcome is read from the answer.
The CaCu survival card is titled as survival and states that its curves estimate the clinical
scenario's group, not an individual. Survival and recurrence estimates no longer feed the risk
scales, curves, probability table or PDF.
This commit is contained in:
Angel Capetillo Zavala
2026-12-02 17:48:03 -06:00
parent f119ba048a
commit 09e5f4dd34
7 changed files with 833 additions and 105 deletions
+8 -6
View File
@@ -28,7 +28,7 @@ import { ApiConfiguration } from '../api/api-configuration';
import { ANTECEDENTS, Fact, group, split } from './record-groups';
import { referenceView, ReferenceRisk, ReferenceView } from './reference-risk';
import { curveFigure, curveText } from './risk-curve';
import { riskGroups, riskScales, RiskScales } from './risk-scales';
import { isRiskModel, riskGroups, riskScales, RiskScales } 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';
@@ -166,12 +166,14 @@ export class Paciente {
const shown = cytologies.find((r) => r.effectiveDateTime === this.citologia()) ?? cytologies[0];
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 scales = computed(() =>
this.domain() === 'cacu' ? riskScales(this.models()) : [],
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.models()) : [],
this.domain() === 'cacu' ? riskGroups(this.riskModels()) : [],
);
/** CaCu, experimental: the NCI reference comparison of the cytology she was opened at. The API
* answers 404 while the feature is off: then nothing is shown. */
@@ -479,10 +481,10 @@ export class Paciente {
protected readonly zoneOrder = computed(() => byDeviation(this.zoned()?.zones ?? []));
protected readonly head = computed(() => headMap(this.zoned()?.electrodes ?? []));
/** The institutional models' curves, drawn at the horizons each publishes (risk-curve). */
protected readonly curve = computed<Figure>(() => curveFigure(this.models(), this.top()));
protected readonly curveText = computed(() => curveText(this.models()));
protected readonly curve = computed<Figure>(() => curveFigure(this.riskModels(), this.top()));
protected readonly curveText = computed(() => curveText(this.riskModels()));
private top(): number {
return Math.max(0, ...this.models().flatMap((m) => m.predictions.map((p) => p.high ?? p.p)));
return Math.max(0, ...this.riskModels().flatMap((m) => m.predictions.map((p) => p.high ?? p.p)));
}
protected readonly name = name;
protected readonly levelNames = LEVEL_NAMES;