Llamar NCI a las series de referencia y marcar también CIN2+

This commit is contained in:
2026-12-04 19:19:16 -06:00
parent 4789282e17
commit f92bcd80b9
2 changed files with 7 additions and 13 deletions
+1 -3
View File
@@ -25,8 +25,6 @@ describe('risk series', () => {
}); });
expect(series.points).toEqual([{ years: 0, p: 0, low: undefined, high: undefined }]); expect(series.points).toEqual([{ years: 0, p: 0, low: undefined, high: undefined }]);
expect(seriesName(series)).toBe('ISSSTELEON, LIEAG+'); expect(seriesName(series)).toBe('ISSSTELEON, LIEAG+');
expect(seriesName({ ...series, source: 'NCI (tabla de ingreso)' })).toBe( expect(seriesName({ ...series, source: 'NCI', outcome: 'CIN3+' })).toBe('NCI, CIN3+');
'NCI, ingreso a LIEAG+',
);
}); });
}); });
+6 -10
View File
@@ -29,13 +29,9 @@ const OUTCOME_TEXT: Record<string, string> = {
}; };
export const seriesName = (s: Series) => { export const seriesName = (s: Series) => {
const outcome = OUTCOME_TEXT[s.outcome] ?? s.outcome; const outcome = (OUTCOME_TEXT[s.outcome] ?? s.outcome).replace(' (CIN2+)', '');
if (s.source === 'NCI (tabla de ingreso)') // the platform's own models are the hospital's
return `NCI, ingreso a ${outcome.replace(' (CIN2+)', '').replace(/^Cáncer$/, 'cáncer')}`; return `${s.source === 'Institucional' ? 'ISSSTELEON' : s.source}, ${outcome}`;
// the platform's own models are the hospital's: its name, and the outcome without its synonym
return s.source === 'Institucional'
? `ISSSTELEON, ${outcome.replace(' (CIN2+)', '')}`
: `${s.source} · ${outcome}`;
}; };
/** The series of the answer. A value absent from it stays absent. */ /** The series of the answer. A value absent from it stays absent. */
@@ -80,13 +76,13 @@ export function parseSeries(answer: Parameters): Series[] {
export class RiskSeries { export class RiskSeries {
readonly series = input.required<Series[]>(); readonly series = input.required<Series[]>();
protected readonly available = computed(() => this.series().filter((s) => s.points.length)); protected readonly available = computed(() => this.series().filter((s) => s.points.length));
/** the platform's own series and the NCI master table's are drawn until the user says /** the platform's own series and the NCI master table's CIN2+ and CIN3+ are drawn until the
* otherwise */ * user says otherwise */
protected readonly choices = computed(() => protected readonly choices = computed(() =>
this.available().map((s) => ({ this.available().map((s) => ({
id: s.id, id: s.id,
name: seriesName(s), name: seriesName(s),
on: s.source === 'Institucional' || s.id === 'nci-master-CIN3+', on: s.source === 'Institucional' || ['nci-master-CIN2+', 'nci-master-CIN3+'].includes(s.id),
})), })),
); );
private readonly among = computed(() => { private readonly among = computed(() => {