From f92bcd80b9f546ec9b46f803cb9c08ab28740d8b Mon Sep 17 00:00:00 2001 From: edgar Date: Fri, 4 Dec 2026 19:19:16 -0600 Subject: [PATCH] =?UTF-8?q?Llamar=20NCI=20a=20las=20series=20de=20referenc?= =?UTF-8?q?ia=20y=20marcar=20tambi=C3=A9n=20CIN2+?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/paciente/risk-series.spec.ts | 4 +--- src/app/paciente/risk-series.ts | 16 ++++++---------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/app/paciente/risk-series.spec.ts b/src/app/paciente/risk-series.spec.ts index d14d92b..77e6dcf 100644 --- a/src/app/paciente/risk-series.spec.ts +++ b/src/app/paciente/risk-series.spec.ts @@ -25,8 +25,6 @@ describe('risk series', () => { }); expect(series.points).toEqual([{ years: 0, p: 0, low: undefined, high: undefined }]); expect(seriesName(series)).toBe('ISSSTELEON, LIEAG+'); - expect(seriesName({ ...series, source: 'NCI (tabla de ingreso)' })).toBe( - 'NCI, ingreso a LIEAG+', - ); + expect(seriesName({ ...series, source: 'NCI', outcome: 'CIN3+' })).toBe('NCI, CIN3+'); }); }); diff --git a/src/app/paciente/risk-series.ts b/src/app/paciente/risk-series.ts index 139f53a..69e1d6b 100644 --- a/src/app/paciente/risk-series.ts +++ b/src/app/paciente/risk-series.ts @@ -29,13 +29,9 @@ const OUTCOME_TEXT: Record = { }; export const seriesName = (s: Series) => { - const outcome = OUTCOME_TEXT[s.outcome] ?? s.outcome; - if (s.source === 'NCI (tabla de ingreso)') - return `NCI, ingreso a ${outcome.replace(' (CIN2+)', '').replace(/^Cáncer$/, 'cáncer')}`; - // 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}`; + const outcome = (OUTCOME_TEXT[s.outcome] ?? s.outcome).replace(' (CIN2+)', ''); + // the platform's own models are the hospital's + return `${s.source === 'Institucional' ? 'ISSSTELEON' : s.source}, ${outcome}`; }; /** 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 { readonly series = input.required(); 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 - * otherwise */ + /** the platform's own series and the NCI master table's CIN2+ and CIN3+ are drawn until the + * user says otherwise */ protected readonly choices = computed(() => this.available().map((s) => ({ id: s.id, 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(() => {