Dibujar todos los ajustes de supervivencia en la ficha

This commit is contained in:
2026-12-03 07:28:48 -06:00
parent 24415b79b6
commit db74a19439
4 changed files with 42 additions and 4 deletions
+13
View File
@@ -1,11 +1,24 @@
import { scenarioFigure } from '../gobernanza/figures';
import { Figure, PALETTE } from '../plot';
/** All the fits the report has for her values, drawn as a clinical scenario's are. */
export function survivalFigure(c: Combination): Figure {
return c.weibull && c.weibull_fractional && c.points && c.horizons_months
? scenarioFigure('', c, c.horizons_months, 'Supervivencia S(t)').figure
: combinationFigure(c.km!);
}
/** One entry of the survival report's `km_combinaciones`: the patients who share every value. */
export interface Combination {
valores: Record<string, string>;
n: number;
fallecidos: number;
km?: { months: number[]; S: number[]; low: number[]; high: number[] };
/** the other fits; a report from before they were published has the Kaplan-Meier only */
weibull?: { t: number[]; S: number[] };
weibull_fractional?: { t: number[]; S: number[] };
points?: { COMB: { S: number[]; low?: number[]; high?: number[] } };
horizons_months?: number[];
}
/** The entry with exactly her values (a missing one is the report's "NA"); never a partial match. */