CaCu's page by readings, screening stages, ages and exports
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import type { RiskAssessment } from 'fhir/r4';
|
||||
import { ageGroup, currentRisk, windowStart } from './follow-up';
|
||||
import { ageGroup, currentRisk, windowStart, ageAt, bornFor } from './follow-up';
|
||||
import { periods } from './measures';
|
||||
|
||||
describe('follow-up list', () => {
|
||||
@@ -45,3 +45,14 @@ describe('follow-up list', () => {
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('ages', () => {
|
||||
it('ask for the birth dates whose completed years fall in the range', () => {
|
||||
expect(bornFor('2026-06-30', 36, 40)).toEqual(['le1990-06-30', 'gt1985-06-30']);
|
||||
expect(bornFor('2026-06-30', null, null)).toEqual([]);
|
||||
expect(bornFor('2024-02-29', 1, null)).toEqual(['le2023-02-28']);
|
||||
expect([ageAt('1990-06-30', '2026-06-30'), ageAt('1990-07-01', '2026-06-30')]).toEqual([
|
||||
36, 35,
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user