Mostrar el motivo de exclusión en la ficha CaCu
This commit is contained in:
@@ -117,6 +117,37 @@ async function open(page: Page, url: string) {
|
||||
await expect(historial(page)).toBeVisible({ timeout: 120_000 });
|
||||
await expect(page.locator('app-loading')).toHaveCount(0, { timeout: 60_000 });
|
||||
}
|
||||
|
||||
test('ficha (simulado): states why a hysterectomy makes this risk assessment unavailable', async ({
|
||||
page,
|
||||
}) => {
|
||||
const { url, sample } = await firstRecord(page);
|
||||
const previousDay = plus(sample, -1);
|
||||
await page.route('**/api/cacu/fhir/Patient/*', async (route) => {
|
||||
const response = await route.fetch();
|
||||
const patient = await response.json();
|
||||
patient.extension = [
|
||||
...(patient.extension ?? []),
|
||||
{ url: EXT + 'first-hysterectomy-recorded', valueDate: sample },
|
||||
];
|
||||
await route.fulfill({ response, json: patient });
|
||||
});
|
||||
await withRisks(page, [risk('past', 'Modelo v1', 'cacu.cin2_pim', previousDay, [[5, 0.2]])]);
|
||||
|
||||
await open(page, url);
|
||||
await expect(
|
||||
page.getByText('Sin estimación de riesgo por antecedente de histerectomía', {
|
||||
exact: false,
|
||||
}),
|
||||
).toBeVisible();
|
||||
await expect(page.locator('app-risk-scales')).toHaveCount(0);
|
||||
|
||||
const historical = new URL(url, 'http://example.test');
|
||||
historical.searchParams.set('citologia', previousDay);
|
||||
await open(page, historical.pathname + historical.search);
|
||||
await expect(page.locator('app-risk-scales')).toBeVisible();
|
||||
});
|
||||
|
||||
/** Where a scale draws its marker, in % of the bar, and the figure it prints. */
|
||||
async function drawn(scaleBox: Locator) {
|
||||
const marker = scaleBox.locator('.risk-marker');
|
||||
|
||||
Reference in New Issue
Block a user