Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bf04fa9a04 | |||
| 49b94b8f18 |
@@ -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 de seguimiento\s*No disponible/); expect(t).not.toMatch(/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');
|
||||
|
||||
@@ -11,10 +11,7 @@
|
||||
<dl class="summary">
|
||||
<div><dt>{{ p.idLabel }}</dt><dd>{{ p.patientId }}</dd></div>
|
||||
<div><dt>Grupo de edad</dt><dd>{{ p.ageGroup ?? notAvailable }}</dd></div>
|
||||
<div><dt>Escenario clínico</dt><dd>{{ p.clinicalScenario ?? notAvailable }}</dd></div>
|
||||
<div><dt>Estatus de seguimiento</dt><dd>{{ p.status ?? notAvailable }}</dd></div>
|
||||
<div><dt>Prioridad</dt><dd>{{ p.priority ?? notAvailable }}</dd></div>
|
||||
<div><dt>Días de mastografía a diagnóstico</dt><dd>{{ p.daysMammographyToDiagnosis ?? notAvailable }}</dd></div>
|
||||
<div><dt>Estatus de seguimiento</dt><dd>{{ p.clinicalScenario ?? notAvailable }}</dd></div>
|
||||
</dl>
|
||||
</header>
|
||||
<div class="detail-grid">
|
||||
|
||||
@@ -68,8 +68,18 @@ 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 "Estatus de seguimiento" label carries the row's follow-up status instead of the clinical scenario, or if the priority or the days to diagnosis come back.
|
||||
it('shows the clinical scenario as "Estatus de seguimiento" and not the status, priority or days to diagnosis', () => {
|
||||
montar({ ...toCamaPatientSummary(complete(), '2026-10-20')!, clinicalScenario: 'En observación', status: 'ESTATUS_DE_LA_FILA' });
|
||||
const labels = [...root().querySelectorAll('header dt')].map(dt => dt.textContent!.trim());
|
||||
expect(labels).toEqual(['Identificador seudónimo', 'Grupo de edad', 'Estatus de seguimiento']);
|
||||
expect(root().querySelector('header')!.textContent).toContain('En observación');
|
||||
expect(root().textContent).not.toContain('ESTATUS_DE_LA_FILA');
|
||||
for (const label of ['Escenario clínico', '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 +88,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
|
||||
|
||||
@@ -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 de seguimiento', '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 under "Estatus de seguimiento" and leaves out the priority and the days to diagnosis.
|
||||
for (const t of ['Escenario clínico', '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".
|
||||
|
||||
@@ -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 de seguimiento', 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]]),
|
||||
|
||||
@@ -8,15 +8,17 @@
|
||||
@case ('error') { <p role="alert">No se pudo validar o cargar el riesgo individual.</p> }
|
||||
@case ('disponible') {
|
||||
@let riesgo = lectura.datos.riesgo;
|
||||
<h5>Modelo y evaluación</h5>
|
||||
<dl class="metadata">
|
||||
<div><dt>Modelo</dt><dd>{{ riesgo.modelo_nombre }}</dd></div>
|
||||
<div><dt>Versión del modelo</dt><dd>{{ riesgo.modelo_version }}</dd></div>
|
||||
<div><dt>Fecha índice</dt><dd>{{ riesgo.fecha_indice }}</dd></div>
|
||||
<div><dt>Desenlace</dt><dd>{{ riesgo.desenlace_texto ?? riesgo.desenlace }}</dd></div>
|
||||
<div><dt>Evaluado en (UTC)</dt><dd>{{ riesgo.evaluado_en }}</dd></div>
|
||||
<div><dt>Estado del lote</dt><dd>{{ riesgo.estado_lote === 'final' ? 'Final (final)' : 'Preliminar (preliminary)' }}</dd></div>
|
||||
</dl>
|
||||
@if (dominio() === 'cama') {
|
||||
<h5>Modelo y evaluación</h5>
|
||||
<dl class="metadata">
|
||||
<div><dt>Modelo</dt><dd>{{ riesgo.modelo_nombre }}</dd></div>
|
||||
<div><dt>Versión del modelo</dt><dd>{{ riesgo.modelo_version }}</dd></div>
|
||||
<div><dt>Fecha índice</dt><dd>{{ riesgo.fecha_indice }}</dd></div>
|
||||
<div><dt>Desenlace</dt><dd>{{ riesgo.desenlace_texto ?? riesgo.desenlace }}</dd></div>
|
||||
<div><dt>Evaluado en (UTC)</dt><dd>{{ riesgo.evaluado_en }}</dd></div>
|
||||
<div><dt>Estado del lote</dt><dd>{{ riesgo.estado_lote === 'final' ? 'Final (final)' : 'Preliminar (preliminary)' }}</dd></div>
|
||||
</dl>
|
||||
}
|
||||
@if (riesgo.horizontes.length) {
|
||||
<div class="risk-scroll" role="region" aria-label="Probabilidades por horizonte, tabla desplazable" tabindex="0">
|
||||
<table>
|
||||
|
||||
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user