Dibujar la ronda subsecuente por última detección y conectar diagnóstico a tratamiento de CaMa

This commit is contained in:
2026-12-04 01:23:41 -06:00
parent 94c3bb6d82
commit cbc41ca365
5 changed files with 60 additions and 43 deletions
+24
View File
@@ -508,3 +508,27 @@ describe('independent bars by group', () => {
expect(bars(mode as any, () => r)!.rows.map((x) => x.color)).toEqual(['#a', '#b']);
});
});
describe('the subsequent round by last screening', () => {
it('draws each answer as its own group after the subsequent one', () => {
const cell = (n: number) => ({ 'initial-population': n });
const r: Reading = {
populations: { 'initial-population': 3 },
strata: {
'round-category': { 'subsequent|NILM': cell(3) },
'subsequent_history-category': { 'within_1_year|NILM': cell(2) },
},
};
const catalog = [{ code: 'NILM', label: 'Normal', color: '#000' }];
const found = grouped(
{ kind: 'grouped', label: 'x', measure: 'M', catalog, unit: 'pacientes', stratum: 'round', order: ['subsequent'] },
() => r,
)!;
expect(found.groups.map((g) => [g.code, g.total])).toEqual([
['subsequent', 3],
['within_1_year', 2],
['2_years', 0],
['3_or_more_years', 0],
]);
});
});