diff --git a/src/app/features/indicadores/indicadores-cohorte-etiquetas.spec.ts b/src/app/features/indicadores/indicadores-cohorte-etiquetas.spec.ts index f69ef7e..e1132c7 100644 --- a/src/app/features/indicadores/indicadores-cohorte-etiquetas.spec.ts +++ b/src/app/features/indicadores/indicadores-cohorte-etiquetas.spec.ts @@ -126,7 +126,7 @@ describe('Ficha y archivos de una fila con biopsia reportada y resultado descono const t = (card.nativeElement.textContent as string).replace(/\s+/g, ' '); expect(t).toContain('Resultado: No disponible'); expect(t).toContain('Fecha de reporte: 2025-02-15'); expect(t).toContain('Categoría BI-RADS: BI-RADS 5'); expect(t).toContain('50 a 59 años'); - expect(t).toMatch(/Estatus de seguimiento\s*No disponible/); expect(t).toMatch(/Prioridad\s*No disponible/); expect(t).toMatch(/Días de mastografía a diagnóstico\s*No disponible/); + expect(t).toMatch(/Estatus\s*No disponible/); expect(t).not.toMatch(/Estatus de seguimiento|Prioridad|Días de mastografía a diagnóstico/); expect(t).not.toContain('Fecha de biopsia'); const pdf = textos(camaPatientDocument(resumen, NOW, 'data:image/png;base64,AAAA')); expect(pdf).toContain('Fecha de reporte'); expect(pdf).not.toContain('Fecha de biopsia'); diff --git a/src/app/features/indicadores/paciente-detalle/cama/cama-patient-card.html b/src/app/features/indicadores/paciente-detalle/cama/cama-patient-card.html index eb4fcfc..7a43c4f 100644 --- a/src/app/features/indicadores/paciente-detalle/cama/cama-patient-card.html +++ b/src/app/features/indicadores/paciente-detalle/cama/cama-patient-card.html @@ -11,10 +11,7 @@
{{ p.idLabel }}
{{ p.patientId }}
Grupo de edad
{{ p.ageGroup ?? notAvailable }}
-
Escenario clínico
{{ p.clinicalScenario ?? notAvailable }}
-
Estatus de seguimiento
{{ p.status ?? notAvailable }}
-
Prioridad
{{ p.priority ?? notAvailable }}
-
Días de mastografía a diagnóstico
{{ p.daysMammographyToDiagnosis ?? notAvailable }}
+
Estatus
{{ p.clinicalScenario ?? notAvailable }}
diff --git a/src/app/features/indicadores/paciente-detalle/cama/cama-patient-card.spec.ts b/src/app/features/indicadores/paciente-detalle/cama/cama-patient-card.spec.ts index d3dd5fe..efc0674 100644 --- a/src/app/features/indicadores/paciente-detalle/cama/cama-patient-card.spec.ts +++ b/src/app/features/indicadores/paciente-detalle/cama/cama-patient-card.spec.ts @@ -68,8 +68,17 @@ describe('Ficha CaMa: componente', () => { const row = complete(); montar(toCamaPatientSummary(row, '2026-10-20')!); const text = root().textContent!.replace(/\s+/g, ' '); - for (const value of [`Paciente ${row['id_seudonimo']}`, 'Fecha de corte: 2026-10-20', String(row['estatus']), String(row['prioridad']), String(row['birads']), - String(row['mastografia_fecha']), String(row['biopsia']), String(row['biopsia_fecha']), String(row['dias_mastografia_diagnostico'])]) expect(text).toContain(value); + for (const value of [`Paciente ${row['id_seudonimo']}`, 'Fecha de corte: 2026-10-20', String(row['birads']), + String(row['mastografia_fecha']), String(row['biopsia']), String(row['biopsia_fecha'])]) expect(text).toContain(value); + }); + + // Fails if the summary brings back the follow-up status, the priority or the days to diagnosis, or loses the "Estatus" label. + it('shows the clinical scenario as "Estatus" and not the status, priority or days to diagnosis', () => { + montar({ ...toCamaPatientSummary(complete(), '2026-10-20')!, clinicalScenario: 'En observación' }); + const labels = [...root().querySelectorAll('header dt')].map(dt => dt.textContent!.trim()); + expect(labels).toEqual(['Identificador seudónimo', 'Grupo de edad', 'Estatus']); + expect(root().querySelector('header')!.textContent).toContain('En observación'); + for (const label of ['Escenario clínico', 'Estatus de seguimiento', 'Prioridad', 'Días de mastografía a diagnóstico']) expect(root().textContent).not.toContain(label); }); // Fails if a missing value is left blank or invented instead of reading "No disponible". @@ -78,7 +87,6 @@ describe('Ficha CaMa: componente', () => { const text = root().textContent!; expect(text).toContain('Resultado: No disponible'); expect(text).toContain('Fecha de biopsia: No disponible'); - expect(text).toContain('Días de mastografía a diagnóstico'); }); // Fails if the cards or their subsections leave the order and the names of the specification: recurrence first, then death, each with diff --git a/src/app/features/indicadores/paciente-detalle/cama/cama-patient-pdf.spec.ts b/src/app/features/indicadores/paciente-detalle/cama/cama-patient-pdf.spec.ts index fc49e84..e917013 100644 --- a/src/app/features/indicadores/paciente-detalle/cama/cama-patient-pdf.spec.ts +++ b/src/app/features/indicadores/paciente-detalle/cama/cama-patient-pdf.spec.ts @@ -35,8 +35,10 @@ describe('Ficha CaMa: PDF individual', () => { it('prints each field of the record under its label', () => { const p = complete(); const found = texts(definition(p)['content']); - for (const t of [`Paciente ${p.patientId}`, 'Fecha de corte: 2026-10-20', p.status!, p.priority!, p.birads!, p.mammographyDate!, p.histopathology!, p.biopsyDate!, String(p.daysMammographyToDiagnosis), - 'Categoría BI-RADS', 'Fecha de la mastografía', 'Resultado histopatológico', 'Fecha de biopsia', 'Días de mastografía a diagnóstico']) expect(found).toContain(t); + for (const t of [`Paciente ${p.patientId}`, 'Fecha de corte: 2026-10-20', p.birads!, p.mammographyDate!, p.histopathology!, p.biopsyDate!, + 'Estatus', 'Categoría BI-RADS', 'Fecha de la mastografía', 'Resultado histopatológico', 'Fecha de biopsia']) expect(found).toContain(t); + // The summary prints the clinical scenario as "Estatus" and leaves out the follow-up status, priority and days to diagnosis. + for (const t of ['Escenario clínico', 'Estatus de seguimiento', 'Prioridad', 'Días de mastografía a diagnóstico']) expect(found).not.toContain(t); }); // Fails if a missing value is printed as something other than "No disponible". diff --git a/src/app/features/indicadores/paciente-detalle/cama/cama-patient-pdf.ts b/src/app/features/indicadores/paciente-detalle/cama/cama-patient-pdf.ts index d368548..0d39941 100644 --- a/src/app/features/indicadores/paciente-detalle/cama/cama-patient-pdf.ts +++ b/src/app/features/indicadores/paciente-detalle/cama/cama-patient-pdf.ts @@ -21,10 +21,7 @@ export function camaPatientDocument(patient: CamaPatientSummary, now: Date, logo ...section('Resumen', [ [patient.idLabel, patient.patientId], ['Grupo de edad', patient.ageGroup], - ['Escenario clínico', patient.clinicalScenario], - ['Estatus de seguimiento', patient.status], - ['Prioridad', patient.priority], - ['Días de mastografía a diagnóstico', patient.daysMammographyToDiagnosis], + ['Estatus', patient.clinicalScenario], ]), ...section('Mastografía', [['Categoría BI-RADS', patient.birads], ['Fecha de la mastografía', patient.mammographyDate]]), ...section('Histopatología', [['Resultado histopatológico', patient.histopathology], [patient.biopsyDateLabel ?? 'Fecha de biopsia', patient.biopsyDate]]), diff --git a/src/app/features/indicadores/paciente-detalle/paciente-riesgo-tabla.html b/src/app/features/indicadores/paciente-detalle/paciente-riesgo-tabla.html index 30a796b..99ee58c 100644 --- a/src/app/features/indicadores/paciente-detalle/paciente-riesgo-tabla.html +++ b/src/app/features/indicadores/paciente-detalle/paciente-riesgo-tabla.html @@ -8,15 +8,17 @@ @case ('error') {

No se pudo validar o cargar el riesgo individual.

} @case ('disponible') { @let riesgo = lectura.datos.riesgo; -
Modelo y evaluación
-
-
Modelo
{{ riesgo.modelo_nombre }}
-
Versión del modelo
{{ riesgo.modelo_version }}
-
Fecha índice
{{ riesgo.fecha_indice }}
-
Desenlace
{{ riesgo.desenlace_texto ?? riesgo.desenlace }}
-
Evaluado en (UTC)
{{ riesgo.evaluado_en }}
-
Estado del lote
{{ riesgo.estado_lote === 'final' ? 'Final (final)' : 'Preliminar (preliminary)' }}
-
+ @if (dominio() === 'cama') { +
Modelo y evaluación
+
+
Modelo
{{ riesgo.modelo_nombre }}
+
Versión del modelo
{{ riesgo.modelo_version }}
+
Fecha índice
{{ riesgo.fecha_indice }}
+
Desenlace
{{ riesgo.desenlace_texto ?? riesgo.desenlace }}
+
Evaluado en (UTC)
{{ riesgo.evaluado_en }}
+
Estado del lote
{{ riesgo.estado_lote === 'final' ? 'Final (final)' : 'Preliminar (preliminary)' }}
+
+ } @if (riesgo.horizontes.length) {
diff --git a/src/app/features/indicadores/paciente-detalle/paciente-riesgo.spec.ts b/src/app/features/indicadores/paciente-detalle/paciente-riesgo.spec.ts index 51c685d..1d1e3c0 100644 --- a/src/app/features/indicadores/paciente-detalle/paciente-riesgo.spec.ts +++ b/src/app/features/indicadores/paciente-detalle/paciente-riesgo.spec.ts @@ -49,9 +49,9 @@ describe('RIESGO-CACU-02: presentación y aislamiento', () => { expect(root.querySelectorAll('tbody th[scope="row"]')).toHaveLength(3); expect([...root.querySelectorAll('.percentage')].map(c => c.textContent!.trim())).toEqual(['8 %', '21 %', '34 %']); expect(root.querySelector('.interval')!.textContent).toContain('5 % – 12 %'); - expect(root.textContent).toContain('Final (final)'); - for (const value of ['modelo-cacu', '2.1.0', '2026-10-01T00:00:00Z', '2026-06-01', 'CIN2+ por biopsia']) { - expect(root.textContent).toContain(value); + // The model and evaluation block (model, version, index date, outcome, evaluation time, batch state) is not shown. + for (const value of ['Modelo y evaluación', 'Versión del modelo', 'Desenlace', 'Evaluado en', 'Estado del lote', 'modelo-cacu', '2.1.0', '2026-10-01T00:00:00Z', 'CIN2+ por biopsia']) { + expect(root.textContent).not.toContain(value); } // The record no longer shows the cohort's internals (its definition, version or model variables). expect(root.textContent).not.toMatch(/cohorte_vigilancia|Variables del modelo|tipo_censura/); @@ -87,7 +87,6 @@ describe('RIESGO-CACU-02: presentación y aislamiento', () => { expect([...root.querySelectorAll('tbody th')].map(c => c.textContent!.trim())).toEqual(['0.5', '8', '12.25']); expect([...root.querySelectorAll('.percentage')].map(c => c.textContent!.trim())).toEqual(['0 %', '100 %', '0.123 %']); expect([...root.querySelectorAll('.interval')].map(c => c.textContent!.trim())).toEqual(['0 % – 0 %', 'No disponible', 'No disponible']); - expect(root.textContent).toContain('Preliminar (preliminary)'); }); it.each([[[]], [[{ code: 'real' }]], [undefined]])('no expone una respuesta no simulada (%j)', tag => {