Compare commits
74 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 98eda5bc28 | |||
| f7eb170e15 | |||
| b6e9acd3ba | |||
| 8ebf870f41 | |||
| ef407ce0a7 | |||
| 5cd601651c | |||
| 8ca3b053bd | |||
| c2d4747d69 | |||
| 08c447006c | |||
| a4bf48b60d | |||
| 13146fdca4 | |||
| 4118b050b8 | |||
| 2404a3a66b | |||
| 58fdfd53d7 | |||
| 6a6691bdd5 | |||
| 5bd7793cf7 | |||
| 7d2a861993 | |||
| 0fd5cc70ec | |||
| 71777537e1 | |||
| e14a85261c | |||
| b001594ac7 | |||
| 4929def121 | |||
| 789145b93c | |||
| 5bf022b36f | |||
| f57a42b22a | |||
| 8d7464065d | |||
| ec60f61704 | |||
| 2d0c8565ae | |||
| 3d4032f5d6 | |||
| 728d89f62e | |||
| c4920ed7eb | |||
| 344dafd9fc | |||
| a2bf98e9da | |||
| 7c98566579 | |||
| 8237e9f483 | |||
| 2ea5106d32 | |||
| 32332b0fcf | |||
| fcb3634fa9 | |||
| 9e50655d51 | |||
| a1c079ce43 | |||
| 3a26c63931 | |||
| 374d58f5a5 | |||
| 6df008bf8a | |||
| 52ca5876d0 | |||
| 48e6c9f390 | |||
| f0dd3ec52f | |||
| 61aeed35ff | |||
| d8cb6420a4 | |||
| d3c04a5fcf | |||
| 3655b9857c | |||
| 3e213c4fc0 | |||
| bd897baa2d | |||
| b291885b97 | |||
| b847e04697 | |||
| e5556ebf41 | |||
| 08a1bf910e | |||
| 7e21ebbc7b | |||
| fde3ec08e1 | |||
| 3f6fa28590 | |||
| adff5bac5c | |||
| e2d1c9f277 | |||
| 0760721144 | |||
| 56d1ef2e8a | |||
| 5d03f333f7 | |||
| f7cc141625 | |||
| 84dcebda55 | |||
| 12b056343b | |||
| 38ece960f9 | |||
| b3e5a69783 | |||
| 8442ad5fe6 | |||
| 6732893bcc | |||
| 5ce225df5a | |||
| 8b1cbec66a | |||
| 43b5523f99 |
@@ -1,4 +1,3 @@
|
|||||||
# Editor configuration, see https://editorconfig.org
|
|
||||||
root = true
|
root = true
|
||||||
|
|
||||||
[*]
|
[*]
|
||||||
@@ -11,7 +10,3 @@ trim_trailing_whitespace = true
|
|||||||
[*.ts]
|
[*.ts]
|
||||||
quote_type = single
|
quote_type = single
|
||||||
ij_typescript_use_double_quotes = false
|
ij_typescript_use_double_quotes = false
|
||||||
|
|
||||||
[*.md]
|
|
||||||
max_line_length = off
|
|
||||||
trim_trailing_whitespace = false
|
|
||||||
|
|||||||
@@ -1,17 +1,12 @@
|
|||||||
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
|
|
||||||
|
|
||||||
# Compiled output
|
|
||||||
/dist
|
/dist
|
||||||
/tmp
|
/tmp
|
||||||
/out-tsc
|
/out-tsc
|
||||||
/bazel-out
|
/bazel-out
|
||||||
|
|
||||||
# Node
|
|
||||||
/node_modules
|
/node_modules
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
yarn-error.log
|
yarn-error.log
|
||||||
|
|
||||||
# IDEs and editors
|
|
||||||
.idea/
|
.idea/
|
||||||
.project
|
.project
|
||||||
.classpath
|
.classpath
|
||||||
@@ -20,7 +15,6 @@ yarn-error.log
|
|||||||
.settings/
|
.settings/
|
||||||
*.sublime-workspace
|
*.sublime-workspace
|
||||||
|
|
||||||
# Visual Studio Code
|
|
||||||
.vscode/*
|
.vscode/*
|
||||||
!.vscode/settings.json
|
!.vscode/settings.json
|
||||||
!.vscode/tasks.json
|
!.vscode/tasks.json
|
||||||
@@ -29,7 +23,6 @@ yarn-error.log
|
|||||||
!.vscode/mcp.json
|
!.vscode/mcp.json
|
||||||
.history/*
|
.history/*
|
||||||
|
|
||||||
# Miscellaneous
|
|
||||||
/.angular/cache
|
/.angular/cache
|
||||||
.sass-cache/
|
.sass-cache/
|
||||||
/connect.lock
|
/connect.lock
|
||||||
@@ -39,10 +32,8 @@ testem.log
|
|||||||
/typings
|
/typings
|
||||||
__screenshots__/
|
__screenshots__/
|
||||||
|
|
||||||
# System files
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
|
||||||
# Playwright
|
|
||||||
/test-results/
|
/test-results/
|
||||||
/playwright-report/
|
/playwright-report/
|
||||||
|
|||||||
@@ -39,6 +39,9 @@
|
|||||||
"material-symbols/outlined.css",
|
"material-symbols/outlined.css",
|
||||||
"src/styles.scss"
|
"src/styles.scss"
|
||||||
],
|
],
|
||||||
|
"define": {
|
||||||
|
"global": "globalThis"
|
||||||
|
},
|
||||||
"allowedCommonJsDependencies": [
|
"allowedCommonJsDependencies": [
|
||||||
"plotly.js-cartesian-dist-min"
|
"plotly.js-cartesian-dist-min"
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,338 +0,0 @@
|
|||||||
import { expect, type Locator, type Page, test } from '@playwright/test';
|
|
||||||
import { layoutProblems } from './layout';
|
|
||||||
import { type Simulation, simulateRounds } from './simulated-rounds';
|
|
||||||
|
|
||||||
test.beforeEach(async ({ page }) => {
|
|
||||||
const form = { username: 'admin@isssteleon.mx', password: 'solo-para-pruebas' };
|
|
||||||
expect((await page.request.post('/api/auth/login', { form })).status()).toBe(204);
|
|
||||||
});
|
|
||||||
|
|
||||||
const ROUND = { name: 'Por detección inicial y subsecuente' };
|
|
||||||
const VIEWS_LABEL = 'Lectura de la distribución citológica y del VPH por genotipo';
|
|
||||||
const VIEWS = ['General', 'Por grupo de edad', 'Por estatus de seguimiento', ROUND.name];
|
|
||||||
const TITLES = {
|
|
||||||
cytology: 'Distribución de resultados citológicos',
|
|
||||||
genotype: 'Resultados de VPH por genotipo',
|
|
||||||
biopsy: 'Resultados de biopsia cervical',
|
|
||||||
colposcopy: 'Valor predictivo positivo de la colposcopía',
|
|
||||||
ppvBiopsy: 'Valor predictivo positivo de la biopsia',
|
|
||||||
};
|
|
||||||
|
|
||||||
test('indicadores cacu: its sections in order, each card read one mode at a time', async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
await page.goto('/indicadores/cacu');
|
|
||||||
const tab = page.locator('app-tab-indicadores');
|
|
||||||
await expect(tab.getByRole('heading', { name: 'Indicadores clínicos' })).toBeVisible();
|
|
||||||
await expect(tab.locator('app-loading')).toHaveCount(0, { timeout: 5 * 60_000 });
|
|
||||||
const headings = await tab
|
|
||||||
.locator('h2, app-readings h3')
|
|
||||||
.evaluateAll((els) => els.map((e) => (e as HTMLElement).innerText.trim()));
|
|
||||||
expect(headings.slice(headings.indexOf('Indicadores de oportunidad'))).toEqual([
|
|
||||||
'Indicadores de oportunidad',
|
|
||||||
'Tiempos de la ruta del tamizaje',
|
|
||||||
'Indicadores clínicos',
|
|
||||||
'Resultados de citología, VPH y biopsia',
|
|
||||||
'Distribución de resultados citológicos',
|
|
||||||
'Resultados de VPH por genotipo',
|
|
||||||
'Resultados de biopsia cervical',
|
|
||||||
'Tasa de confirmación histopatológica',
|
|
||||||
'Valor predictivo positivo de la colposcopía',
|
|
||||||
]);
|
|
||||||
const route = tab.locator('app-readings').first();
|
|
||||||
for (const mode of ['Por pasos', 'Por CIE-10', 'Acumulado desde la toma']) {
|
|
||||||
await route.getByRole('radio', { name: mode }).click();
|
|
||||||
await expect(
|
|
||||||
route.getByRole('table', { name: mode }).or(route.getByText('Sin datos en el periodo.')),
|
|
||||||
).toBeVisible();
|
|
||||||
}
|
|
||||||
// one selector for the cytology distribution and the HPV by genotype; the biopsy card is apart
|
|
||||||
await expect(
|
|
||||||
tab.locator('app-readings', {
|
|
||||||
has: page.getByRole('heading', { name: 'Pacientes evaluadas por resultado de VPH' }),
|
|
||||||
}),
|
|
||||||
).toHaveCount(0);
|
|
||||||
const views = tab.getByRole('radiogroup', { name: VIEWS_LABEL });
|
|
||||||
await expect(views.getByRole('radio')).toHaveText(VIEWS);
|
|
||||||
await expect(views.getByRole('radio', { name: 'General' })).toBeChecked();
|
|
||||||
await expect(tab.getByRole('radio', { name: 'Por escenario clínico' })).toHaveCount(0);
|
|
||||||
for (const view of VIEWS.slice(1)) {
|
|
||||||
await views.getByRole('radio', { name: view }).click();
|
|
||||||
for (const card of [TITLES.cytology, TITLES.genotype]) {
|
|
||||||
const readings = tab.locator('app-readings', {
|
|
||||||
has: page.getByRole('heading', { name: card }),
|
|
||||||
});
|
|
||||||
// each card has no toggle of its own: the selector drives both
|
|
||||||
await expect(readings.getByRole('radio')).toHaveCount(0);
|
|
||||||
await expect(
|
|
||||||
readings
|
|
||||||
.locator('.group')
|
|
||||||
.first()
|
|
||||||
.or(readings.getByText(/No disponible|Sin datos en el periodo/)),
|
|
||||||
).toBeVisible();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const biopsyCard = tab.locator('app-readings', {
|
|
||||||
has: page.getByRole('heading', { name: TITLES.biopsy }),
|
|
||||||
});
|
|
||||||
await expect(biopsyCard.getByRole('radio')).toHaveCount(0);
|
|
||||||
await views.getByRole('radio', { name: 'General' }).click();
|
|
||||||
await expect(
|
|
||||||
tab
|
|
||||||
.locator('app-readings', { has: page.getByRole('heading', { name: TITLES.cytology }) })
|
|
||||||
.getByRole('table'),
|
|
||||||
).toBeVisible();
|
|
||||||
// the PPV cards keep their round tab, in the same words and order
|
|
||||||
await tab.getByRole('radio', { name: 'Colposcopía', exact: true }).click();
|
|
||||||
const colposcopy = tab.locator('app-readings', {
|
|
||||||
has: page.getByRole('heading', { name: TITLES.colposcopy }),
|
|
||||||
});
|
|
||||||
await colposcopy.getByRole('radio', ROUND).click();
|
|
||||||
await expect(
|
|
||||||
colposcopy
|
|
||||||
.getByRole('table', ROUND)
|
|
||||||
.or(colposcopy.getByText(/No disponible|Sin datos en el periodo/)),
|
|
||||||
).toBeVisible();
|
|
||||||
await tab.getByRole('radio', { name: 'Biopsia', exact: true }).click();
|
|
||||||
await tab
|
|
||||||
.locator('app-readings', {
|
|
||||||
has: page.getByRole('heading', { name: TITLES.ppvBiopsy }),
|
|
||||||
})
|
|
||||||
.getByRole('radio', ROUND)
|
|
||||||
.click();
|
|
||||||
await expect(
|
|
||||||
tab.getByRole('heading', { name: 'Valor predictivo positivo de la biopsia' }),
|
|
||||||
).toBeVisible();
|
|
||||||
await tab.getByRole('radio', { name: 'Solicitudes' }).click();
|
|
||||||
});
|
|
||||||
|
|
||||||
test('riesgos cacu: ages filter the whole list and a row opens its stages', async ({ page }) => {
|
|
||||||
await page.goto('/indicadores/cacu');
|
|
||||||
await page.getByRole('tab', { name: 'Análisis de riesgos' }).click();
|
|
||||||
const list = page.locator('table.worklist tbody tr');
|
|
||||||
await expect(list.first().locator('app-stages li')).toHaveCount(5);
|
|
||||||
await list.first().getByRole('button', { name: 'Detalle' }).click();
|
|
||||||
await expect(page.locator('tr.stage-detail')).toContainText('Toma de muestra');
|
|
||||||
const answer = page.waitForResponse((r) => r.url().includes('birthdate=le'));
|
|
||||||
await page.getByLabel('Edad mínima').fill('45');
|
|
||||||
expect((await answer).ok()).toBe(true);
|
|
||||||
for (const age of await list.locator('td:nth-child(2)').allInnerTexts())
|
|
||||||
expect(parseInt(age)).toBeGreaterThanOrEqual(45);
|
|
||||||
for (const [button, file] of [
|
|
||||||
['Exportar Excel', 'seguimiento-cacu.xlsx'],
|
|
||||||
['Exportar PDF', 'seguimiento-cacu.pdf'],
|
|
||||||
]) {
|
|
||||||
const saved = page.waitForEvent('download');
|
|
||||||
await page.getByRole('button', { name: button }).click();
|
|
||||||
expect((await saved).suggestedFilename()).toBe(file);
|
|
||||||
}
|
|
||||||
await list.first().locator('a').first().click();
|
|
||||||
await expect(page.locator('[data-section=etapas]')).toContainText('Reporte de biopsia');
|
|
||||||
const record = page.waitForEvent('download');
|
|
||||||
await page.getByRole('button', { name: 'Exportar PDF' }).click();
|
|
||||||
expect((await record).suggestedFilename()).toBe('expediente-cacu.pdf');
|
|
||||||
});
|
|
||||||
|
|
||||||
// ---- Screening rounds on SIMULATED answers (see simulated-rounds.ts): the groups the contract of
|
|
||||||
// `rebuild` allows, tried on top of the API's own answers. They show how the page draws them, not the
|
|
||||||
// backend. The shared selector drives the cytology and the HPV-by-genotype cards; the PPV cards keep a tab.
|
|
||||||
const BAR = {
|
|
||||||
initial: 'rgb(95, 127, 154)',
|
|
||||||
subsequent: 'rgb(143, 167, 187)',
|
|
||||||
no_data: 'rgb(201, 205, 210)',
|
|
||||||
};
|
|
||||||
const GENOTYPE_COLOURS = {
|
|
||||||
Negativo: '#42A77E',
|
|
||||||
'VPH 16': '#DF8640',
|
|
||||||
'VPH 18': '#C29C42',
|
|
||||||
'VPH 16 y 18': '#C24269',
|
|
||||||
Positivo: '#A8C243',
|
|
||||||
};
|
|
||||||
const CYTOLOGY_COLOURS = {
|
|
||||||
Normal: '#408651',
|
|
||||||
'ASC-US': '#2778B8',
|
|
||||||
LIEBG: '#B19525',
|
|
||||||
'ASC-H': '#7955B1',
|
|
||||||
LIEAG: '#CE4778',
|
|
||||||
'Carcinoma in situ': '#AA394D',
|
|
||||||
};
|
|
||||||
|
|
||||||
async function withRounds(page: Page, how: Simulation) {
|
|
||||||
await simulateRounds(page, how);
|
|
||||||
await page.goto('/indicadores/cacu');
|
|
||||||
const tab = page.locator('app-tab-indicadores');
|
|
||||||
await expect(tab.getByRole('heading', { name: 'Indicadores clínicos' })).toBeVisible({
|
|
||||||
timeout: 3 * 60_000,
|
|
||||||
});
|
|
||||||
await expect(tab.locator('app-loading')).toHaveCount(0, { timeout: 5 * 60_000 });
|
|
||||||
const card = (title: string) =>
|
|
||||||
tab.locator('app-readings', { has: page.getByRole('heading', { name: title }) }).first();
|
|
||||||
const view = async (name: string) => {
|
|
||||||
await tab.getByRole('radiogroup', { name: VIEWS_LABEL }).getByRole('radio', { name }).click();
|
|
||||||
};
|
|
||||||
/** A PPV card on its round tab. */
|
|
||||||
const ppv = async (key: 'colposcopy' | 'ppvBiopsy') => {
|
|
||||||
await tab
|
|
||||||
.getByRole('radio', { name: key === 'colposcopy' ? 'Colposcopía' : 'Biopsia', exact: true })
|
|
||||||
.click();
|
|
||||||
const readings = card(TITLES[key]);
|
|
||||||
await readings.getByRole('radio', ROUND).click();
|
|
||||||
return readings;
|
|
||||||
};
|
|
||||||
return { tab, card, view, ppv };
|
|
||||||
}
|
|
||||||
/** The first group of independent bars of a card (the cytology and genotype breakdowns). */
|
|
||||||
const plotOf = (readings: Locator) => readings.locator('.group').first();
|
|
||||||
/** The groups of a card as the page draws them: "label<br>n = N", the width of the first bar and the colour of
|
|
||||||
* each category (the first group's rows), in hex. */
|
|
||||||
const traces = (readings: Locator) =>
|
|
||||||
readings.evaluate((el) => {
|
|
||||||
const hex = (rgb: string) =>
|
|
||||||
'#' +
|
|
||||||
(rgb.match(/\d+/g) ?? [])
|
|
||||||
.slice(0, 3)
|
|
||||||
.map((n) => Number(n).toString(16).padStart(2, '0'))
|
|
||||||
.join('')
|
|
||||||
.toUpperCase();
|
|
||||||
const groups = [...el.querySelectorAll('.group')];
|
|
||||||
return {
|
|
||||||
y: groups.map(
|
|
||||||
(g) =>
|
|
||||||
`${g.querySelector('h4')!.childNodes[0].textContent!.trim()}<br>n = ${g.querySelector('.n')!.textContent!.replace('n = ', '').trim()}`,
|
|
||||||
),
|
|
||||||
x: groups.map((g) => parseFloat((g.querySelector('.fill') as HTMLElement).style.width)),
|
|
||||||
colours: Object.fromEntries(
|
|
||||||
[...groups[0].querySelectorAll('.row')].map((r) => [
|
|
||||||
r.querySelector('.name')!.textContent!.trim(),
|
|
||||||
hex(getComputedStyle(r.querySelector('.fill')!).backgroundColor),
|
|
||||||
]),
|
|
||||||
),
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
for (const key of ['colposcopy', 'ppvBiopsy'] as const) {
|
|
||||||
test(`rondas (simulado) ${key}: three groups in order, each with its own colour`, async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
const { ppv } = await withRounds(page, 'as-is');
|
|
||||||
const readings = await ppv(key);
|
|
||||||
const rows = readings.getByRole('row').filter({ has: page.getByRole('rowheader') });
|
|
||||||
await expect(rows).toHaveCount(3);
|
|
||||||
const names = await readings.getByRole('rowheader').allInnerTexts();
|
|
||||||
expect(names.map((n) => n.trim().split(/\s*\n\s*/)[0])).toEqual([
|
|
||||||
'Detección inicial',
|
|
||||||
'Detección subsecuente',
|
|
||||||
'Sin dato',
|
|
||||||
]);
|
|
||||||
const colours = await readings
|
|
||||||
.locator('tbody .bar')
|
|
||||||
.evaluateAll((els) => els.map((e) => getComputedStyle(e).backgroundColor));
|
|
||||||
expect(colours).toEqual([BAR.initial, BAR.subsequent, BAR.no_data]);
|
|
||||||
});
|
|
||||||
|
|
||||||
test(`rondas (simulado) ${key}: an empty initial group is zero patients, not hidden`, async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
const { ppv } = await withRounds(page, 'no-initial');
|
|
||||||
const readings = await ppv(key);
|
|
||||||
const initial = readings.getByRole('row').filter({ hasText: 'Detección inicial' });
|
|
||||||
await expect(initial).toContainText('Sin pacientes en el periodo');
|
|
||||||
await expect(initial).toContainText('0/0');
|
|
||||||
});
|
|
||||||
|
|
||||||
test(`rondas (simulado) ${key}: without the stratum the card says it is not available`, async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
const { ppv } = await withRounds(page, 'unpublished');
|
|
||||||
const readings = await ppv(key);
|
|
||||||
await expect(readings).toContainText('No disponible');
|
|
||||||
await expect(readings.getByRole('table', ROUND)).toHaveCount(0);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const card of ['cytology', 'genotype'] as const) {
|
|
||||||
test(`rondas (simulado) ${card}: the selector draws the rounds in order, with the category colours`, async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
const { card: of, view } = await withRounds(page, 'as-is');
|
|
||||||
await view(ROUND.name);
|
|
||||||
const readings = of(TITLES[card]);
|
|
||||||
await expect(plotOf(readings)).toBeVisible();
|
|
||||||
const found = await traces(readings);
|
|
||||||
expect(found.y.map((l) => l.split('<br>')[0])).toEqual([
|
|
||||||
'Detección inicial',
|
|
||||||
'Detección subsecuente',
|
|
||||||
'Sin dato',
|
|
||||||
]);
|
|
||||||
expect(found.colours).toMatchObject(card === 'cytology' ? CYTOLOGY_COLOURS : GENOTYPE_COLOURS);
|
|
||||||
});
|
|
||||||
|
|
||||||
test(`rondas (simulado) ${card}: an empty initial group is an empty bar with its zero`, async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
const { card: of, view } = await withRounds(page, 'no-initial');
|
|
||||||
await view(ROUND.name);
|
|
||||||
const found = await traces(of(TITLES[card]));
|
|
||||||
expect(found.y[0]).toBe('Detección inicial<br>n = 0');
|
|
||||||
expect(found.x[0]).toBe(0);
|
|
||||||
});
|
|
||||||
|
|
||||||
test(`rondas (simulado) ${card}: without the stratum the selector says it is not available`, async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
const { card: of, view } = await withRounds(page, 'unpublished');
|
|
||||||
await view(ROUND.name);
|
|
||||||
await expect(of(TITLES[card])).toContainText('No disponible');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
test('rondas (simulado): the genotype card never shows the incomplete positives, and says where they went', async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
const { card, view } = await withRounds(page, 'as-is');
|
|
||||||
const readings = card(TITLES.genotype);
|
|
||||||
await expect(readings).toContainText('«Positivo»');
|
|
||||||
await expect(readings.getByRole('rowheader')).not.toContainText([
|
|
||||||
'Otro de alto riesgo',
|
|
||||||
'incompleto',
|
|
||||||
]);
|
|
||||||
const labels = await readings.getByRole('rowheader').allInnerTexts();
|
|
||||||
expect(labels.map((l) => l.trim())).toEqual([
|
|
||||||
'Negativo',
|
|
||||||
'VPH 16',
|
|
||||||
'VPH 18',
|
|
||||||
'VPH 16 y 18',
|
|
||||||
'Positivo',
|
|
||||||
]);
|
|
||||||
for (const name of VIEWS.slice(1)) {
|
|
||||||
await view(name);
|
|
||||||
const found = await traces(readings);
|
|
||||||
expect(Object.keys(found.colours)).toEqual(Object.keys(GENOTYPE_COLOURS));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
for (const width of [1440, 480]) {
|
|
||||||
test(`rondas (simulado) at ${width} px: the shared selector on each view lays out cleanly`, async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
await page.setViewportSize({ width, height: 1000 });
|
|
||||||
const { view, ppv } = await withRounds(page, 'as-is');
|
|
||||||
for (const name of VIEWS) {
|
|
||||||
await view(name);
|
|
||||||
await page.waitForTimeout(1200);
|
|
||||||
// every option of the selector is inside the window (it wraps on a narrow screen)
|
|
||||||
for (const box of await page
|
|
||||||
.getByRole('radiogroup', { name: VIEWS_LABEL })
|
|
||||||
.getByRole('radio')
|
|
||||||
.evaluateAll((els) =>
|
|
||||||
els.map((e) => e.closest('mat-button-toggle')!.getBoundingClientRect().right),
|
|
||||||
))
|
|
||||||
expect(box).toBeLessThanOrEqual(width);
|
|
||||||
expect(await layoutProblems(page), name).toEqual([]);
|
|
||||||
}
|
|
||||||
await ppv('colposcopy');
|
|
||||||
await ppv('ppvBiopsy');
|
|
||||||
await page.waitForTimeout(1200);
|
|
||||||
expect(await layoutProblems(page)).toEqual([]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@@ -1,974 +0,0 @@
|
|||||||
import { expect, type Locator, type Page, test } from '@playwright/test';
|
|
||||||
import { layoutProblems } from './layout';
|
|
||||||
|
|
||||||
// The individual record of CaCu: the stages inside "Historial médico" and the risk scales.
|
|
||||||
// "(simulado)" tests rewrite the API's answers in the browser to cover what the synthetic data
|
|
||||||
// do not hold (every stage state, every risk value); they show how the page draws them, not the backend.
|
|
||||||
|
|
||||||
const EXT = 'https://isssteleon.org/fhir/StructureDefinition/';
|
|
||||||
test.beforeEach(async ({ page }) => {
|
|
||||||
const form = { username: 'admin@isssteleon.mx', password: 'solo-para-pruebas' };
|
|
||||||
expect((await page.request.post('/api/auth/login', { form })).status()).toBe(204);
|
|
||||||
});
|
|
||||||
|
|
||||||
/** The record of the first patient of the risk list, as an address. */
|
|
||||||
async function firstRecord(page: Page): Promise<{ url: string; sample: string }> {
|
|
||||||
await page.goto('/indicadores/cacu');
|
|
||||||
await page.getByRole('tab', { name: 'Análisis de riesgos' }).click();
|
|
||||||
const link = page.locator('table.worklist tbody tr a').first();
|
|
||||||
await link.waitFor({ timeout: 120_000 });
|
|
||||||
const url = (await link.getAttribute('href'))!;
|
|
||||||
return { url, sample: new URL(url, 'http://x').searchParams.get('citologia')! };
|
|
||||||
}
|
|
||||||
const plus = (day: string, days: number) =>
|
|
||||||
new Date(Date.parse(day) + days * 86_400_000).toISOString().slice(0, 10);
|
|
||||||
|
|
||||||
type Route = Partial<
|
|
||||||
Record<'report' | 'colposcopy' | 'request' | 'biopsy' | 'diagnosis', number>
|
|
||||||
> & {
|
|
||||||
link?: 'recorded';
|
|
||||||
/** more extensions on the report, as the backend would publish them (stage states and sources) */
|
|
||||||
extra?: object[];
|
|
||||||
};
|
|
||||||
/** The shown cytology's report carries these dates (days after its sample). */
|
|
||||||
async function withRoute(page: Page, sample: string, days: Route) {
|
|
||||||
await page.route('**/api/cacu/fhir/DiagnosticReport**', async (route) => {
|
|
||||||
const response = await route.fetch();
|
|
||||||
const body = await response.json();
|
|
||||||
for (const { resource: r } of body.entry ?? []) {
|
|
||||||
if (r.code?.coding?.[0]?.code !== 'cervical_cytology' || r.effectiveDateTime !== sample)
|
|
||||||
continue;
|
|
||||||
const names = {
|
|
||||||
report: 'report-date',
|
|
||||||
colposcopy: 'colposcopy-date',
|
|
||||||
request: 'biopsy-request-date',
|
|
||||||
biopsy: 'biopsy-date',
|
|
||||||
diagnosis: 'diagnosis-date',
|
|
||||||
} as const;
|
|
||||||
r.extension = (r.extension ?? []).filter(
|
|
||||||
(e: any) =>
|
|
||||||
!Object.values(names).some((n) => e.url === EXT + n) && e.url !== EXT + 'biopsy-link',
|
|
||||||
);
|
|
||||||
for (const [key, name] of Object.entries(names)) {
|
|
||||||
const d = days[key as keyof typeof names];
|
|
||||||
if (d !== undefined) r.extension.push({ url: EXT + name, valueDate: plus(sample, d) });
|
|
||||||
}
|
|
||||||
if (days.link) r.extension.push({ url: EXT + 'biopsy-link', valueCode: days.link });
|
|
||||||
r.extension.push(...(days.extra ?? []));
|
|
||||||
}
|
|
||||||
await route.fulfill({
|
|
||||||
response,
|
|
||||||
body: JSON.stringify(body),
|
|
||||||
contentType: 'application/fhir+json',
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
type Prediction = [years: number, p: number, low?: number, high?: number];
|
|
||||||
const risk = (
|
|
||||||
id: string,
|
|
||||||
text: string,
|
|
||||||
model: string,
|
|
||||||
index: string,
|
|
||||||
predictions: Prediction[],
|
|
||||||
) => ({
|
|
||||||
resourceType: 'RiskAssessment',
|
|
||||||
id,
|
|
||||||
status: 'final',
|
|
||||||
method: { text, coding: [{ code: model }] },
|
|
||||||
occurrenceDateTime: index,
|
|
||||||
prediction: predictions.map(([years, p, low, high]) => ({
|
|
||||||
whenRange: { high: { value: years, unit: 'a', code: 'a' } },
|
|
||||||
probabilityDecimal: p,
|
|
||||||
extension:
|
|
||||||
low === undefined
|
|
||||||
? []
|
|
||||||
: [
|
|
||||||
{ url: EXT + 'ic-bajo', valueDecimal: low },
|
|
||||||
{ url: EXT + 'ic-alto', valueDecimal: high },
|
|
||||||
],
|
|
||||||
})),
|
|
||||||
});
|
|
||||||
/** The patient has these risk assessments. */
|
|
||||||
async function withRisks(page: Page, assessments: object[]) {
|
|
||||||
await page.route('**/api/cacu/fhir/RiskAssessment**', (route) =>
|
|
||||||
route.fulfill({
|
|
||||||
contentType: 'application/fhir+json',
|
|
||||||
body: JSON.stringify({
|
|
||||||
resourceType: 'Bundle',
|
|
||||||
type: 'searchset',
|
|
||||||
entry: assessments.map((resource) => ({ resource })),
|
|
||||||
}),
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const historial = (page: Page) =>
|
|
||||||
page.locator('mat-card', {
|
|
||||||
has: page.locator('mat-card-title', { hasText: 'Historial médico' }),
|
|
||||||
});
|
|
||||||
const scale = (page: Page, label: string, nth = 0) =>
|
|
||||||
page.locator(`.risk-scale[data-scale="${label}"]`).nth(nth);
|
|
||||||
const IMMEDIATE = 'Riesgo inmediato (al índice)';
|
|
||||||
const FIVE = 'Riesgo a 5 años';
|
|
||||||
|
|
||||||
async function open(page: Page, url: string) {
|
|
||||||
await page.goto(url);
|
|
||||||
await expect(historial(page)).toBeVisible({ timeout: 120_000 });
|
|
||||||
await expect(page.locator('app-loading')).toHaveCount(0, { timeout: 60_000 });
|
|
||||||
}
|
|
||||||
/** 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');
|
|
||||||
return {
|
|
||||||
markers: await marker.count(),
|
|
||||||
left: (await marker.count())
|
|
||||||
? await marker.evaluate((e) => (e as HTMLElement).style.left)
|
|
||||||
: undefined,
|
|
||||||
value: (await scaleBox.locator('.risk-value').count())
|
|
||||||
? (await scaleBox.locator('.risk-value').innerText()).trim()
|
|
||||||
: undefined,
|
|
||||||
grey: await scaleBox.locator('.risk-plot.unavailable').count(),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
test('ficha: the five stages are a line of nodes inside "Historial médico", with the export button', async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
const { url } = await firstRecord(page);
|
|
||||||
await open(page, url);
|
|
||||||
await expect(page.locator('mat-card-title', { hasText: 'Etapas del tamizaje' })).toHaveCount(0);
|
|
||||||
const stages = historial(page).locator('[data-section=etapas] app-stages li');
|
|
||||||
await expect(stages).toHaveCount(5);
|
|
||||||
// one row: the five nodes are level
|
|
||||||
const tops = await stages
|
|
||||||
.locator('.node')
|
|
||||||
.evaluateAll((els) => els.map((e) => Math.round(e.getBoundingClientRect().top)));
|
|
||||||
expect(new Set(tops).size).toBe(1);
|
|
||||||
// each stage says its name, state, day and both intervals, centred
|
|
||||||
const first = stages.first();
|
|
||||||
await expect(first).toContainText('Toma de muestra');
|
|
||||||
await expect(first).toContainText('Registrada');
|
|
||||||
await expect(first).toContainText('Desde anterior: —');
|
|
||||||
await expect(first).toContainText('Desde toma: 0 días');
|
|
||||||
expect(
|
|
||||||
await first.locator('.info').evaluate((e) => getComputedStyle(e.parentElement!).textAlign),
|
|
||||||
).toBe('center');
|
|
||||||
await expect(historial(page)).toContainText('a la fecha de corte');
|
|
||||||
await expect(historial(page).getByRole('button', { name: 'Exportar PDF' })).toBeVisible();
|
|
||||||
// history and tests keep their tables
|
|
||||||
await expect(historial(page).getByRole('table')).toBeVisible();
|
|
||||||
await expect(page.locator('mat-card-title', { hasText: 'Pruebas y resultados' })).toBeVisible();
|
|
||||||
});
|
|
||||||
|
|
||||||
test('ficha: the export of the record still downloads its PDF', async ({ page }) => {
|
|
||||||
const { url } = await firstRecord(page);
|
|
||||||
await open(page, url);
|
|
||||||
const saved = page.waitForEvent('download');
|
|
||||||
await historial(page).getByRole('button', { name: 'Exportar PDF' }).click();
|
|
||||||
expect((await saved).suggestedFilename()).toBe('expediente-cacu.pdf');
|
|
||||||
});
|
|
||||||
|
|
||||||
test('ficha: with no model both horizons are drawn grey, not available, without a marker', async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
const { url } = await firstRecord(page);
|
|
||||||
await open(page, url);
|
|
||||||
for (const label of [IMMEDIATE, FIVE]) {
|
|
||||||
const box = scale(page, label);
|
|
||||||
await expect(box).toContainText('No disponible');
|
|
||||||
expect(await drawn(box)).toMatchObject({ markers: 0, grey: 1 });
|
|
||||||
await expect(box.locator('.risk-labels span')).toHaveText([
|
|
||||||
'0 %',
|
|
||||||
'25 %',
|
|
||||||
'50 %',
|
|
||||||
'75 %',
|
|
||||||
'100 %',
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
await expect(
|
|
||||||
page.getByText('Divisiones numéricas descriptivas; no representan umbrales clínicos.'),
|
|
||||||
).toBeVisible();
|
|
||||||
});
|
|
||||||
|
|
||||||
test('ficha (simulado): every state of a stage, its dates and its intervals', async ({ page }) => {
|
|
||||||
const { url, sample } = await firstRecord(page);
|
|
||||||
await withRoute(page, sample, {
|
|
||||||
report: 14,
|
|
||||||
colposcopy: 30,
|
|
||||||
request: 40,
|
|
||||||
biopsy: 50,
|
|
||||||
diagnosis: 70,
|
|
||||||
link: 'recorded',
|
|
||||||
});
|
|
||||||
await open(page, `${url.split('?')[0]}?corte=${plus(sample, 200)}&citologia=${sample}`);
|
|
||||||
const stages = historial(page).locator('app-stages li');
|
|
||||||
const text = async (n: number) => (await stages.nth(n).innerText()).replace(/\s+/g, ' ');
|
|
||||||
expect(await text(0)).toContain(`Registrada ${sample}`);
|
|
||||||
expect(await text(1)).toContain(
|
|
||||||
`Registrada ${plus(sample, 14)} Procedencia: Formulario de citología Desde anterior: 14 días Desde toma: 14 días`,
|
|
||||||
);
|
|
||||||
// colposcopy and diagnosis are inferred from dates: their intervals say so
|
|
||||||
expect(await text(2)).toContain(
|
|
||||||
`Inferida por fechas ${plus(sample, 30)} Desde anterior: 16 días (inferido) Desde toma: 30 días (inferido)`,
|
|
||||||
);
|
|
||||||
// a recorded biopsy link is recorded; the interval since an inferred stage is still inferred
|
|
||||||
expect(await text(3)).toContain(
|
|
||||||
`Registrada ${plus(sample, 50)} Desde anterior: 20 días (inferido) Desde toma: 50 días`,
|
|
||||||
);
|
|
||||||
expect(await text(4)).toContain(
|
|
||||||
`Inferida por fechas ${plus(sample, 70)} Desde anterior: 20 días (inferido)`,
|
|
||||||
);
|
|
||||||
const state = (n: number) =>
|
|
||||||
stages
|
|
||||||
.nth(n)
|
|
||||||
.locator('.node')
|
|
||||||
.evaluate(
|
|
||||||
(e) => getComputedStyle(e).backgroundColor + '|' + getComputedStyle(e).borderTopStyle,
|
|
||||||
);
|
|
||||||
expect(await state(0)).toBe('rgb(56, 123, 102)|solid'); // recorded
|
|
||||||
expect(await state(2)).toBe('rgb(66, 105, 160)|double'); // inferred
|
|
||||||
// an inferred biopsy link: inferred as well
|
|
||||||
await page.unroute('**/api/cacu/fhir/DiagnosticReport**');
|
|
||||||
await withRoute(page, sample, {
|
|
||||||
report: 14,
|
|
||||||
colposcopy: 30,
|
|
||||||
request: 40,
|
|
||||||
biopsy: 50,
|
|
||||||
diagnosis: 70,
|
|
||||||
});
|
|
||||||
await open(page, `${url.split('?')[0]}?corte=${plus(sample, 200)}&citologia=${sample}`);
|
|
||||||
expect(await text(3)).toContain('Inferida por fechas');
|
|
||||||
});
|
|
||||||
|
|
||||||
test('ficha (simulado): the cut-off hides what is dated after it; a biopsy asked and not reported is pending', async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
const { url, sample } = await firstRecord(page);
|
|
||||||
await withRoute(page, sample, {
|
|
||||||
report: 14,
|
|
||||||
colposcopy: 30,
|
|
||||||
request: 40,
|
|
||||||
biopsy: 50,
|
|
||||||
diagnosis: 70,
|
|
||||||
});
|
|
||||||
const cutoff = plus(sample, 45); // after the request, before the report
|
|
||||||
await open(page, `${url.split('?')[0]}?corte=${cutoff}&citologia=${sample}`);
|
|
||||||
const stages = historial(page).locator('app-stages li');
|
|
||||||
const states = await stages.locator('.info span:nth-child(2)').allInnerTexts();
|
|
||||||
expect(states.map((s) => s.trim())).toEqual([
|
|
||||||
'Registrada',
|
|
||||||
'Registrada',
|
|
||||||
'Inferida por fechas',
|
|
||||||
'Pendiente',
|
|
||||||
'Sin dato',
|
|
||||||
]);
|
|
||||||
await expect(historial(page)).toContainText(`a la fecha de corte ${cutoff}`);
|
|
||||||
const pending = await stages
|
|
||||||
.nth(3)
|
|
||||||
.locator('.node')
|
|
||||||
.evaluate((e) => getComputedStyle(e).backgroundColor);
|
|
||||||
expect(pending).toBe('rgb(255, 241, 201)');
|
|
||||||
const unknown = await stages
|
|
||||||
.nth(4)
|
|
||||||
.locator('.node')
|
|
||||||
.evaluate((e) => getComputedStyle(e).borderTopStyle);
|
|
||||||
expect(unknown).toBe('dashed');
|
|
||||||
await expect(stages.nth(4)).toContainText('Sin fecha');
|
|
||||||
await expect(stages.nth(4)).toContainText('Desde toma: —');
|
|
||||||
// a cut-off before the sample: nothing is known
|
|
||||||
await page.unroute('**/api/cacu/fhir/DiagnosticReport**');
|
|
||||||
await withRoute(page, sample, { report: 14 });
|
|
||||||
await open(page, `${url.split('?')[0]}?corte=${plus(sample, -1)}&citologia=${sample}`);
|
|
||||||
expect(
|
|
||||||
await historial(page).locator('app-stages li .info span:nth-child(2)').allInnerTexts(),
|
|
||||||
).toEqual(Array(5).fill('Sin dato'));
|
|
||||||
});
|
|
||||||
|
|
||||||
test('ficha (simulado): the scales draw 0, 2, 50, 98 and 100 % in place, and tell zero from absent', async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
const { url } = await firstRecord(page);
|
|
||||||
await withRisks(page, [
|
|
||||||
risk('a', 'Supervivencia v3', 'cacu.survival', '2026-02-01', [
|
|
||||||
[0, 0],
|
|
||||||
[5, 0.5, 0.4, 0.6],
|
|
||||||
]),
|
|
||||||
risk('b', 'Recurrencia v2', 'cacu.recurrence', '2026-03-01', [
|
|
||||||
[0, 0.02, 0.01, 0.03],
|
|
||||||
[5, 0.98, 0.95, 1],
|
|
||||||
]),
|
|
||||||
risk('c', 'Otro modelo v1', 'cacu.other', '2026-04-01', [[5, 1]]), // no immediate horizon
|
|
||||||
risk('d', 'Parcial v1', 'cacu.partial', '2026-05-01', [[0, 0.5]]), // no five-year horizon
|
|
||||||
]);
|
|
||||||
await open(page, url);
|
|
||||||
await expect(
|
|
||||||
page.getByRole('heading', { name: 'Supervivencia v3 · fecha índice 2026-02-01' }),
|
|
||||||
).toBeVisible();
|
|
||||||
await expect(
|
|
||||||
page.getByRole('heading', { name: 'Recurrencia v2 · fecha índice 2026-03-01' }),
|
|
||||||
).toBeVisible();
|
|
||||||
const at = async (label: string, nth: number) => drawn(scale(page, label, nth));
|
|
||||||
// group order follows the page's models: survival, recurrence, other, partial
|
|
||||||
const groups = await page.locator('.risk-scale').count();
|
|
||||||
expect(groups).toBe(8); // both horizons of four models
|
|
||||||
const model = async (n: number) => [await at(IMMEDIATE, n), await at(FIVE, n)];
|
|
||||||
const [survival, recurrence, other, partial] = [
|
|
||||||
await model(0),
|
|
||||||
await model(1),
|
|
||||||
await model(2),
|
|
||||||
await model(3),
|
|
||||||
];
|
|
||||||
expect(survival[0]).toMatchObject({ markers: 1, left: '0%', value: '0.0 %', grey: 0 }); // a real zero
|
|
||||||
expect(survival[1]).toMatchObject({ left: '50%', value: '50.0 %' });
|
|
||||||
expect(recurrence[0]).toMatchObject({ left: '2%', value: '2.0 %' });
|
|
||||||
expect(recurrence[1]).toMatchObject({ left: '98%', value: '98.0 %' });
|
|
||||||
expect(other[0]).toMatchObject({ markers: 0, grey: 1 }); // absent, not zero
|
|
||||||
expect(other[1]).toMatchObject({ left: '100%', value: '100.0 %' });
|
|
||||||
expect(partial[0]).toMatchObject({ left: '50%' });
|
|
||||||
expect(partial[1]).toMatchObject({ markers: 0, grey: 1 });
|
|
||||||
await expect(scale(page, IMMEDIATE, 2)).toContainText('No disponible');
|
|
||||||
await expect(scale(page, FIVE, 3)).toContainText('No disponible');
|
|
||||||
await expect(scale(page, FIVE, 0)).toContainText('IC 95 %: 40.0–60.0 %');
|
|
||||||
await expect(scale(page, FIVE, 1)).toContainText('IC 95 %: 95.0–100.0 %');
|
|
||||||
await expect(scale(page, IMMEDIATE, 0)).not.toContainText('IC 95 %'); // none published, none invented
|
|
||||||
// the descriptive note stays, and the model table and curve of rebuild are still there
|
|
||||||
await expect(page.getByText('no representan umbrales clínicos')).toBeVisible();
|
|
||||||
await expect(page.getByRole('columnheader', { name: 'Probabilidad', exact: true })).toBeVisible();
|
|
||||||
});
|
|
||||||
|
|
||||||
test('ficha (simulado): the scale is drawn in four equal segments with the numeric divisions', async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
const { url } = await firstRecord(page);
|
|
||||||
await withRisks(page, [
|
|
||||||
risk('a', 'Supervivencia v3', 'cacu.survival', '2026-02-01', [[5, 0.5, 0.4, 0.6]]),
|
|
||||||
]);
|
|
||||||
await open(page, url);
|
|
||||||
const box = scale(page, FIVE);
|
|
||||||
await expect(box.locator('.risk-labels span')).toHaveText([
|
|
||||||
'0 %',
|
|
||||||
'25 %',
|
|
||||||
'50 %',
|
|
||||||
'75 %',
|
|
||||||
'100 %',
|
|
||||||
]);
|
|
||||||
const line = await box.locator('.risk-line').evaluate((e) => getComputedStyle(e).backgroundImage);
|
|
||||||
for (const colour of [
|
|
||||||
'rgb(66, 167, 126)',
|
|
||||||
'rgb(168, 194, 67)',
|
|
||||||
'rgb(223, 134, 64)',
|
|
||||||
'rgb(194, 66, 105)',
|
|
||||||
])
|
|
||||||
expect(line).toContain(colour);
|
|
||||||
// the marker sits at 50 % of the bar
|
|
||||||
const [bar, mark] = await Promise.all([
|
|
||||||
box.locator('.risk-plot').boundingBox(),
|
|
||||||
box.locator('.risk-marker').boundingBox(),
|
|
||||||
]);
|
|
||||||
expect(Math.abs(mark!.x + mark!.width / 2 - (bar!.x + bar!.width / 2))).toBeLessThan(3);
|
|
||||||
});
|
|
||||||
|
|
||||||
for (const width of [1440, 480]) {
|
|
||||||
test(`ficha (simulado) at ${width} px: the stages and the scales lay out cleanly`, async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
await page.setViewportSize({ width, height: 1000 });
|
|
||||||
const { url, sample } = await firstRecord(page);
|
|
||||||
await withRoute(page, sample, {
|
|
||||||
report: 14,
|
|
||||||
colposcopy: 30,
|
|
||||||
request: 40,
|
|
||||||
biopsy: 50,
|
|
||||||
diagnosis: 70,
|
|
||||||
link: 'recorded',
|
|
||||||
});
|
|
||||||
await withRisks(page, [
|
|
||||||
risk('a', 'Supervivencia v3', 'cacu.survival', '2026-02-01', [
|
|
||||||
[0, 0],
|
|
||||||
[5, 0.98, 0.95, 1],
|
|
||||||
]),
|
|
||||||
risk('b', 'Otro modelo v1', 'cacu.other', '2026-04-01', [[5, 1]]),
|
|
||||||
]);
|
|
||||||
await open(page, `${url.split('?')[0]}?corte=${plus(sample, 200)}&citologia=${sample}`);
|
|
||||||
await page.waitForTimeout(800);
|
|
||||||
expect(await layoutProblems(page)).toEqual([]);
|
|
||||||
const tops = await historial(page)
|
|
||||||
.locator('app-stages li .node')
|
|
||||||
.evaluateAll((els) => els.map((e) => Math.round(e.getBoundingClientRect().top)));
|
|
||||||
// wide: one row of nodes; narrow: a column (each below the previous)
|
|
||||||
if (width > 700) expect(new Set(tops).size).toBe(1);
|
|
||||||
else {
|
|
||||||
expect(tops).toEqual([...tops].sort((a, b) => a - b));
|
|
||||||
expect(new Set(tops).size).toBe(5);
|
|
||||||
}
|
|
||||||
expect(
|
|
||||||
await page.evaluate(() => document.documentElement.scrollWidth <= window.innerWidth + 1),
|
|
||||||
).toBe(true);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const code = (name: string, valueCode: string) => ({ url: EXT + name, valueCode });
|
|
||||||
const nodeOf = (page: Page, n: number) => historial(page).locator('app-stages li').nth(n);
|
|
||||||
|
|
||||||
/** A record, by the API, whose cytology (the latest of the first patients) satisfies `wanted`. */
|
|
||||||
async function recordWhere(page: Page, wanted: (report: any) => boolean) {
|
|
||||||
const patients = await (await page.request.get('/api/cacu/fhir/Patient?_count=100')).json();
|
|
||||||
const ids: string[] = patients.entry.map((e: any) => e.resource.id);
|
|
||||||
for (let i = 0; i < ids.length; i += 25) {
|
|
||||||
const subject = ids
|
|
||||||
.slice(i, i + 25)
|
|
||||||
.map((p) => 'Patient/' + p)
|
|
||||||
.join(',');
|
|
||||||
const found = await (
|
|
||||||
await page.request.get(`/api/cacu/fhir/DiagnosticReport?_count=200&subject=${subject}`)
|
|
||||||
).json();
|
|
||||||
for (const { resource: r } of found.entry ?? [])
|
|
||||||
if (r.code?.coding?.[0]?.code === 'cervical_cytology' && wanted(r))
|
|
||||||
return {
|
|
||||||
id: r.subject.reference.split('/')[1] as string,
|
|
||||||
sample: r.effectiveDateTime as string,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
throw new Error('no record with those stages in the first patients');
|
|
||||||
}
|
|
||||||
const has = (r: any, name: string) => (r.extension ?? []).some((e: any) => e.url === EXT + name);
|
|
||||||
|
|
||||||
test('ficha: the stages say what the backend demonstrates, with their sources', async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
const { id, sample } = await recordWhere(
|
|
||||||
page,
|
|
||||||
(r) => has(r, 'stage-colposcopy-state') && has(r, 'stage-biopsy-state'),
|
|
||||||
);
|
|
||||||
await open(page, `/indicadores/cacu/pacientes/${id}?corte=2026-12-31&citologia=${sample}`);
|
|
||||||
const states = await historial(page)
|
|
||||||
.locator('app-stages li .info span:nth-child(2)')
|
|
||||||
.allInnerTexts();
|
|
||||||
expect(states[0]).toBe('Registrada');
|
|
||||||
expect(states[2]).toBe('Inferida por fechas'); // colposcopy is always inferred
|
|
||||||
expect(['Inferida por fechas', 'Registrada']).toContain(states[3]);
|
|
||||||
const colposcopy = (await nodeOf(page, 2).innerText()).replace(/\s+/g, ' ');
|
|
||||||
expect(colposcopy).toMatch(/Procedencia: (Nota clínica|Orden de biopsia)/);
|
|
||||||
expect(colposcopy).toContain('Desde anterior:');
|
|
||||||
expect((await nodeOf(page, 3).innerText()).replace(/\s+/g, ' ')).toMatch(
|
|
||||||
/Procedencia: (Asociación por fechas|Registro de la biopsia)/,
|
|
||||||
);
|
|
||||||
// the first two stages come from the form
|
|
||||||
expect(await nodeOf(page, 0).innerText()).toContain('Procedencia: Formulario de citología');
|
|
||||||
});
|
|
||||||
|
|
||||||
test('ficha (simulado): a stage the backend flags as ambiguous is drawn so, with no interval resting on it', async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
const { url, sample } = await firstRecord(page);
|
|
||||||
await withRoute(page, sample, {
|
|
||||||
report: 14,
|
|
||||||
colposcopy: 30,
|
|
||||||
request: 40,
|
|
||||||
biopsy: 50,
|
|
||||||
diagnosis: 70,
|
|
||||||
extra: [
|
|
||||||
code('stage-biopsy-state', 'ambiguous'),
|
|
||||||
code('stage-biopsy-source', 'date-association'),
|
|
||||||
code('stage-colposcopy-state', 'inferred'),
|
|
||||||
code('stage-colposcopy-source', 'clinical-note'),
|
|
||||||
code('stage-colposcopy-source', 'biopsy-order'),
|
|
||||||
],
|
|
||||||
});
|
|
||||||
await open(page, `${url.split('?')[0]}?corte=${plus(sample, 200)}&citologia=${sample}`);
|
|
||||||
const biopsy = (await nodeOf(page, 3).innerText()).replace(/\s+/g, ' ');
|
|
||||||
expect(biopsy).toContain(`Ambigua ${plus(sample, 50)}`);
|
|
||||||
expect(biopsy).toContain('Procedencia: Asociación por fechas');
|
|
||||||
expect(biopsy).toContain('Desde anterior: — Desde toma: —');
|
|
||||||
expect(
|
|
||||||
await nodeOf(page, 3)
|
|
||||||
.locator('.node')
|
|
||||||
.evaluate((e) => getComputedStyle(e).borderTopStyle),
|
|
||||||
).toBe('double');
|
|
||||||
// no interval rests on the ambiguous day, so the next stage has none from the previous one either
|
|
||||||
expect((await nodeOf(page, 4).innerText()).replace(/\s+/g, ' ')).toContain('Desde anterior: —');
|
|
||||||
// a colposcopy dated by a note and a biopsy order lists both sources
|
|
||||||
expect(await nodeOf(page, 2).innerText()).toContain(
|
|
||||||
'Procedencia: Nota clínica · Orden de biopsia',
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('ficha (simulado): a biopsy the backend says is pending shows its request, not a day', async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
const { url, sample } = await firstRecord(page);
|
|
||||||
await withRoute(page, sample, {
|
|
||||||
report: 14,
|
|
||||||
colposcopy: 30,
|
|
||||||
request: 40,
|
|
||||||
extra: [
|
|
||||||
code('stage-biopsy-state', 'pending'),
|
|
||||||
code('stage-biopsy-source', 'date-association'),
|
|
||||||
code('biopsy-link', 'inferred'),
|
|
||||||
],
|
|
||||||
});
|
|
||||||
await open(page, `${url.split('?')[0]}?corte=${plus(sample, 200)}&citologia=${sample}`);
|
|
||||||
const biopsy = (await nodeOf(page, 3).innerText()).replace(/\s+/g, ' ');
|
|
||||||
expect(biopsy).toContain('Pendiente');
|
|
||||||
expect(biopsy).toContain(`Solicitada el ${plus(sample, 40)}`);
|
|
||||||
expect(biopsy).toContain('Desde toma: —');
|
|
||||||
// colposcopy and diagnosis are never pending: no request is known for them
|
|
||||||
expect(
|
|
||||||
await historial(page).locator('app-stages li .info span:nth-child(2)').allInnerTexts(),
|
|
||||||
).not.toContain('Pendiente' + 'x');
|
|
||||||
const states = (
|
|
||||||
await historial(page).locator('app-stages li .info span:nth-child(2)').allInnerTexts()
|
|
||||||
).map((t) => t.trim());
|
|
||||||
expect(states.filter((t) => t === 'Pendiente')).toHaveLength(1);
|
|
||||||
});
|
|
||||||
|
|
||||||
// ---- the record's tests and its antecedents
|
|
||||||
const antecedents = (page: Page) => page.locator('[data-section=antecedentes]');
|
|
||||||
const tests = (page: Page) =>
|
|
||||||
page.locator('mat-card', {
|
|
||||||
has: page.locator('mat-card-title', { hasText: 'Pruebas y resultados' }),
|
|
||||||
});
|
|
||||||
|
|
||||||
test('ficha: antecedents and gynecologic evaluation have their own section; tests keep their results', async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
const { id, sample } = await recordWhere(page, (r) => (r.result ?? []).length > 8);
|
|
||||||
await open(page, `/indicadores/cacu/pacientes/${id}?corte=2026-12-31&citologia=${sample}`);
|
|
||||||
const card = antecedents(page);
|
|
||||||
await expect(card).toBeVisible();
|
|
||||||
await expect(card).toContainText('no son diagnósticos confirmados');
|
|
||||||
await expect(card).toContainText(`Citología cervical · toma ${sample}`);
|
|
||||||
for (const title of [
|
|
||||||
'Detección de cáncer de cérvix',
|
|
||||||
'Condición ginecoobstétrica a la detección',
|
|
||||||
'Actualmente presenta',
|
|
||||||
'A la exploración se observa',
|
|
||||||
])
|
|
||||||
await expect(card.locator('dl.facts dt', { hasText: title })).toBeVisible();
|
|
||||||
// the earlier forms are collapsed, each with its own day
|
|
||||||
const earlier = card.locator('details.findings');
|
|
||||||
if (await earlier.count()) {
|
|
||||||
expect(await earlier.getAttribute('open')).toBeNull();
|
|
||||||
await earlier.locator('summary').click();
|
|
||||||
await expect(earlier.locator('tbody tr').first().locator('td').first()).toHaveText(
|
|
||||||
/\d{4}-\d{2}-\d{2}/,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
// the tests keep date, study, report and the results of the study, without the form's antecedents
|
|
||||||
const table = tests(page);
|
|
||||||
await expect(table.getByRole('columnheader')).toHaveText([
|
|
||||||
'Toma',
|
|
||||||
'Estudio',
|
|
||||||
'Reporte',
|
|
||||||
'Resultados',
|
|
||||||
]);
|
|
||||||
const text = await table.innerText();
|
|
||||||
expect(text).toContain('Resultado (Bethesda)');
|
|
||||||
expect(text).not.toContain('Detección de cáncer de cérvix');
|
|
||||||
expect(text).not.toContain('A la exploración se observa');
|
|
||||||
// the extra findings are collapsed under their report
|
|
||||||
const findings = table.locator('details.findings').first();
|
|
||||||
await expect(findings.locator('summary')).toContainText('Hallazgos (');
|
|
||||||
expect(await findings.getAttribute('open')).toBeNull();
|
|
||||||
expect((await findings.locator('li').first().textContent())!.trim().length).toBeGreaterThan(0);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('ficha (simulado): a missing antecedent says it is not documented; with none, no section', async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
const { url } = await firstRecord(page);
|
|
||||||
const strip = (keep: string[]) =>
|
|
||||||
page.route('**/api/cacu/fhir/Observation**', async (route) => {
|
|
||||||
const response = await route.fetch();
|
|
||||||
const body = await response.json();
|
|
||||||
body.entry = (body.entry ?? []).filter((e: any) => {
|
|
||||||
const field = (e.resource.code?.coding?.[0]?.code ?? '').split('.').pop();
|
|
||||||
const antecedent = [
|
|
||||||
'screening_history',
|
|
||||||
'gynecologic_condition',
|
|
||||||
'presenting_symptom',
|
|
||||||
'cervix_appearance',
|
|
||||||
].includes(field);
|
|
||||||
return !antecedent || keep.includes(field);
|
|
||||||
});
|
|
||||||
await route.fulfill({
|
|
||||||
response,
|
|
||||||
body: JSON.stringify(body),
|
|
||||||
contentType: 'application/fhir+json',
|
|
||||||
});
|
|
||||||
});
|
|
||||||
await strip(['screening_history']);
|
|
||||||
await open(page, url);
|
|
||||||
const card = antecedents(page);
|
|
||||||
await expect(card.locator('dl.facts dd').first()).not.toHaveText('No documentado');
|
|
||||||
await expect(card.locator('dl.facts dd', { hasText: 'No documentado' })).toHaveCount(3);
|
|
||||||
await page.unroute('**/api/cacu/fhir/Observation**');
|
|
||||||
await strip([]);
|
|
||||||
await open(page, url);
|
|
||||||
await expect(antecedents(page)).toHaveCount(0);
|
|
||||||
// the record's tests are still there without them
|
|
||||||
await expect(tests(page).getByRole('table')).toBeVisible();
|
|
||||||
});
|
|
||||||
|
|
||||||
test('ficha: the PDF keeps the stages, antecedents, tests and risks', async ({ page }) => {
|
|
||||||
const { id, sample } = await recordWhere(page, (r) => (r.result ?? []).length > 8);
|
|
||||||
await open(page, `/indicadores/cacu/pacientes/${id}?corte=2026-12-31&citologia=${sample}`);
|
|
||||||
const saved = page.waitForEvent('download');
|
|
||||||
await historial(page).getByRole('button', { name: 'Exportar PDF' }).click();
|
|
||||||
const download = await saved;
|
|
||||||
expect(download.suggestedFilename()).toBe('expediente-cacu.pdf');
|
|
||||||
const file = await download.path();
|
|
||||||
expect(file).toBeTruthy();
|
|
||||||
const { readFileSync } = await import('node:fs');
|
|
||||||
const bytes = readFileSync(file!);
|
|
||||||
expect(bytes.subarray(0, 4).toString()).toBe('%PDF');
|
|
||||||
expect(bytes.length).toBeGreaterThan(5_000);
|
|
||||||
});
|
|
||||||
|
|
||||||
// ---- the NCI reference comparison (experimental) and the institutional curves ---------------------
|
|
||||||
|
|
||||||
const REFERENCE = '**/api/cacu/fhir/Patient/*/$reference-risk*';
|
|
||||||
const section = (page: Page) => page.locator('[data-section=referencia-nci]');
|
|
||||||
const value = (p: any) =>
|
|
||||||
p.valueCode ?? p.valueString ?? p.valueDate ?? p.valueInteger ?? p.valueDecimal ?? p.valueBoolean;
|
|
||||||
|
|
||||||
/** The first patients' answers of the API, to find one with a given state (the data is synthetic). */
|
|
||||||
async function referenceWhere(page: Page, status: string) {
|
|
||||||
const patients = await (await page.request.get('/api/cacu/fhir/Patient?_count=100')).json();
|
|
||||||
for (const { resource } of patients.entry) {
|
|
||||||
const answer = await page.request.get(`/api/cacu/fhir/Patient/${resource.id}/$reference-risk`);
|
|
||||||
if (!answer.ok()) throw new Error(`the reference operation answered ${answer.status()}`);
|
|
||||||
const body = await answer.json();
|
|
||||||
if (value(body.parameter.find((p: any) => p.name === 'status')) === status)
|
|
||||||
return { id: resource.id as string, body };
|
|
||||||
}
|
|
||||||
throw new Error(`no patient with the state ${status}`);
|
|
||||||
}
|
|
||||||
const part = (name: string, extra: object) => ({ name, ...extra });
|
|
||||||
const answerOf = (...parameter: object[]) => ({ resourceType: 'Parameters', parameter });
|
|
||||||
/** A resolved answer for fixtures, with the given horizons and comparisons. */
|
|
||||||
function fixture(
|
|
||||||
horizons: { years: number; reference?: number; comparison?: object[] }[],
|
|
||||||
more: object[] = [],
|
|
||||||
) {
|
|
||||||
return answerOf(
|
|
||||||
part('status', { valueCode: 'resolved' }),
|
|
||||||
part('experimental', { valueBoolean: true }),
|
|
||||||
part('cutoff', { valueDate: '2026-11-30' }),
|
|
||||||
part('scenario', {
|
|
||||||
part: [
|
|
||||||
part('table', { valueCode: 'screening' }),
|
|
||||||
part('label', { valueString: 'Tamizaje' }),
|
|
||||||
part('key', {
|
|
||||||
part: [
|
|
||||||
part('name', { valueCode: 'history' }),
|
|
||||||
part('value', { valueString: 'Cotest-negative' }),
|
|
||||||
],
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
}),
|
|
||||||
part('source', {
|
|
||||||
part: [
|
|
||||||
part('id', { valueString: 'fixture-table' }),
|
|
||||||
part('file', { valueString: 'fixture.xlsx' }),
|
|
||||||
],
|
|
||||||
}),
|
|
||||||
...more,
|
|
||||||
...horizons.map((h) =>
|
|
||||||
part('horizon', {
|
|
||||||
part: [
|
|
||||||
part('years', { valueInteger: h.years }),
|
|
||||||
part('published', { valueBoolean: h.reference !== undefined }),
|
|
||||||
...(h.reference !== undefined ? [part('reference', { valueDecimal: h.reference })] : []),
|
|
||||||
...(h.comparison ?? []),
|
|
||||||
],
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
const comparison = (status: string, reasons: string[], extra: object[] = []) =>
|
|
||||||
part('comparison', {
|
|
||||||
part: [
|
|
||||||
part('model', { valueCode: 'fixture.model' }),
|
|
||||||
part('title', { valueString: 'Modelo de prueba' }),
|
|
||||||
part('outcome', { valueString: 'CIN3+' }),
|
|
||||||
...extra,
|
|
||||||
part('status', { valueCode: status }),
|
|
||||||
...reasons.map((r) => part('reason', { valueCode: r })),
|
|
||||||
],
|
|
||||||
});
|
|
||||||
const answerWith = (page: Page, body: object, status = 200) =>
|
|
||||||
page.route(REFERENCE, (route) =>
|
|
||||||
route.fulfill({ status, contentType: 'application/fhir+json', body: JSON.stringify(body) }),
|
|
||||||
);
|
|
||||||
|
|
||||||
test('referencia NCI: a resolved cytology shows its reference with scenario, source and no institutional model', async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
const { id, body } = await referenceWhere(page, 'resolved');
|
|
||||||
await open(page, `/indicadores/cacu/pacientes/${id}`);
|
|
||||||
const box = section(page);
|
|
||||||
await expect(box).toBeVisible();
|
|
||||||
await expect(box.locator('dd[data-status=resolved]')).toHaveText('Referencia disponible');
|
|
||||||
await expect(box).toContainText('Tamizaje');
|
|
||||||
await expect(box).toContainText('CIN3 o más grave (CIN3+)');
|
|
||||||
await expect(box).toContainText('Master_NCI_Risk_Table.xlsx');
|
|
||||||
const rows = box.locator('tbody tr');
|
|
||||||
await expect(rows).toHaveCount(2);
|
|
||||||
await expect(rows.first()).toContainText('Inmediato (al índice)');
|
|
||||||
await expect(rows.nth(1)).toContainText('5 años');
|
|
||||||
// the figures are the API's: percent with two decimals, and no institutional model is made up
|
|
||||||
const expected = body.parameter
|
|
||||||
.filter((p: any) => p.name === 'horizon')
|
|
||||||
.map((h: any) =>
|
|
||||||
(h.part.find((x: any) => x.name === 'reference').valueDecimal * 100).toFixed(2),
|
|
||||||
);
|
|
||||||
for (const [i, pct] of expected.entries())
|
|
||||||
await expect(rows.nth(i).locator('td').nth(2)).toContainText(`${pct} %`);
|
|
||||||
await expect(rows.first().locator('td').nth(1)).toContainText('No disponible');
|
|
||||||
await expect(rows.first().locator('td').nth(3)).toContainText('No comparable');
|
|
||||||
await expect(rows.first().locator('td').nth(3)).toContainText('Ningún modelo institucional');
|
|
||||||
// the antecedents used are collapsed
|
|
||||||
const used = box.locator('details.used');
|
|
||||||
expect(await used.getAttribute('open')).toBeNull();
|
|
||||||
await used.locator('summary').click();
|
|
||||||
await expect(used).toContainText('Fila de origen');
|
|
||||||
await expect(used).toContainText('Citología evaluada');
|
|
||||||
// the other risk displays of the record are still there, and the reference is below the scales
|
|
||||||
await expect(scale(page, FIVE)).toBeVisible();
|
|
||||||
const [scales, reference] = await Promise.all([
|
|
||||||
scale(page, FIVE).boundingBox(),
|
|
||||||
box.boundingBox(),
|
|
||||||
]);
|
|
||||||
expect(reference!.y).toBeGreaterThan(scales!.y);
|
|
||||||
await expect(
|
|
||||||
page.locator('mat-card-title', { hasText: 'Riesgos y recomendaciones' }),
|
|
||||||
).toBeVisible();
|
|
||||||
});
|
|
||||||
|
|
||||||
test('referencia NCI: a cytology the tables cannot resolve says the state and why, with no figure', async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
const { id } = await referenceWhere(page, 'unverifiable_correspondence');
|
|
||||||
await open(page, `/indicadores/cacu/pacientes/${id}`);
|
|
||||||
const box = section(page);
|
|
||||||
await expect(box.locator('dd[data-status=unverifiable_correspondence]')).toHaveText(
|
|
||||||
'Correspondencia no verificable',
|
|
||||||
);
|
|
||||||
await expect(box.locator('ul.why li').first()).not.toBeEmpty();
|
|
||||||
await expect(box.locator('table')).toHaveCount(0);
|
|
||||||
await expect(box).not.toContainText('%');
|
|
||||||
});
|
|
||||||
|
|
||||||
test('referencia NCI: with the feature off (404) the section is not there and the record is whole', async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
const { url } = await firstRecord(page);
|
|
||||||
await answerWith(
|
|
||||||
page,
|
|
||||||
{ resourceType: 'OperationOutcome', issue: [{ severity: 'error', code: 'not-found' }] },
|
|
||||||
404,
|
|
||||||
);
|
|
||||||
await open(page, url);
|
|
||||||
await expect(section(page)).toHaveCount(0);
|
|
||||||
await expect(scale(page, FIVE)).toBeVisible();
|
|
||||||
});
|
|
||||||
|
|
||||||
test('referencia NCI (simulado): a comparison that is valid shows the difference as institutional minus reference', async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
const { url } = await firstRecord(page);
|
|
||||||
await answerWith(
|
|
||||||
page,
|
|
||||||
fixture([
|
|
||||||
{
|
|
||||||
years: 5,
|
|
||||||
reference: 0.0027,
|
|
||||||
comparison: [
|
|
||||||
comparison(
|
|
||||||
'comparable',
|
|
||||||
[],
|
|
||||||
[
|
|
||||||
part('institutional', { valueDecimal: 0.0127 }),
|
|
||||||
part('institutional-low', { valueDecimal: 0.005 }),
|
|
||||||
part('institutional-high', { valueDecimal: 0.02 }),
|
|
||||||
part('difference-pp', { valueDecimal: 1 }),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
},
|
|
||||||
]),
|
|
||||||
);
|
|
||||||
await open(page, url);
|
|
||||||
const row = section(page).locator('tbody tr').first();
|
|
||||||
await expect(row).toContainText('Modelo de prueba');
|
|
||||||
await expect(row).toContainText('1.27 %');
|
|
||||||
await expect(row).toContainText('IC 95 %: 0.50–2.00 %');
|
|
||||||
await expect(row.locator('td').nth(2)).toContainText('0.27 %');
|
|
||||||
await expect(row.locator('td').nth(3)).toContainText('+1.00');
|
|
||||||
await expect(row.locator('td').nth(3)).not.toContainText('No comparable');
|
|
||||||
});
|
|
||||||
|
|
||||||
test('referencia NCI (simulado): another outcome or horizon is "No comparable" with its reasons and no difference', async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
const { url } = await firstRecord(page);
|
|
||||||
await answerWith(
|
|
||||||
page,
|
|
||||||
fixture([
|
|
||||||
{
|
|
||||||
years: 0,
|
|
||||||
reference: 0.0001,
|
|
||||||
comparison: [
|
|
||||||
comparison(
|
|
||||||
'not_comparable',
|
|
||||||
['outcome_differs', 'horizon_not_published_by_model', 'population_not_verified'],
|
|
||||||
[part('institutional', { valueDecimal: 0.05 })],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{ years: 5, reference: 0.0027 },
|
|
||||||
]),
|
|
||||||
);
|
|
||||||
await open(page, url);
|
|
||||||
const first = section(page).locator('tbody tr').first();
|
|
||||||
await expect(first.locator('td').nth(3)).toContainText('No comparable');
|
|
||||||
await expect(first.locator('td').nth(3)).toContainText(
|
|
||||||
'El desenlace del modelo no es el de la tabla (CIN3+)',
|
|
||||||
);
|
|
||||||
await expect(first.locator('td').nth(3)).toContainText(
|
|
||||||
'no publica una predicción a este horizonte',
|
|
||||||
);
|
|
||||||
await expect(first.locator('td').nth(3)).not.toContainText(/[+-]\d/); // no signed difference
|
|
||||||
await expect(first.locator('td').nth(1)).toContainText('5.00 %'); // the model's own risk is shown, never subtracted
|
|
||||||
});
|
|
||||||
|
|
||||||
test('referencia NCI (simulado): a year-one reference is a year, never the immediate risk; a blank is not zero', async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
const { url } = await firstRecord(page);
|
|
||||||
await answerWith(page, fixture([{ years: 1, reference: 0.0136 }, { years: 5 }]));
|
|
||||||
await open(page, url);
|
|
||||||
const rows = section(page).locator('tbody tr');
|
|
||||||
await expect(rows.first()).toContainText('1 año');
|
|
||||||
await expect(section(page)).not.toContainText('Inmediato');
|
|
||||||
await expect(rows.nth(1).locator('td').nth(2)).toContainText('No publicado');
|
|
||||||
await expect(rows.nth(1).locator('td').nth(2)).not.toContainText('0.00');
|
|
||||||
await expect(rows.first().locator('td').nth(2)).toContainText('1.36 %');
|
|
||||||
});
|
|
||||||
|
|
||||||
for (const width of [1440, 480]) {
|
|
||||||
test(`referencia NCI (simulado) at ${width} px: the section lays out cleanly beside the scales and curves`, async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
await page.setViewportSize({ width, height: 1000 });
|
|
||||||
const { url } = await firstRecord(page);
|
|
||||||
await answerWith(
|
|
||||||
page,
|
|
||||||
fixture(
|
|
||||||
[
|
|
||||||
{
|
|
||||||
years: 0,
|
|
||||||
reference: 0.0001,
|
|
||||||
comparison: [
|
|
||||||
comparison(
|
|
||||||
'not_comparable',
|
|
||||||
['outcome_differs', 'population_not_verified'],
|
|
||||||
[part('institutional', { valueDecimal: 0.05 })],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
years: 5,
|
|
||||||
reference: 0.0027,
|
|
||||||
comparison: [
|
|
||||||
comparison(
|
|
||||||
'comparable',
|
|
||||||
[],
|
|
||||||
[
|
|
||||||
part('institutional', { valueDecimal: 0.0127 }),
|
|
||||||
part('difference-pp', { valueDecimal: 1 }),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[part('assumption', { valueString: 'un supuesto sin verificar' })],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
await withRisks(page, [
|
|
||||||
risk('a', 'Riesgo LIEAG+ v3', 'cacu.survival', '2026-06-01', [
|
|
||||||
[1, 0.08, 0.05, 0.12],
|
|
||||||
[3, 0.21, 0.15, 0.28],
|
|
||||||
[5, 0.34, 0.26, 0.44],
|
|
||||||
]),
|
|
||||||
risk('b', 'Riesgo cáncer v2', 'cacu.recurrence', '2026-06-01', [
|
|
||||||
[1, 0.002, 0.001, 0.005],
|
|
||||||
[3, 0.008],
|
|
||||||
[5, 0.015, 0.008, 0.028],
|
|
||||||
]),
|
|
||||||
]);
|
|
||||||
await open(page, url);
|
|
||||||
await section(page).locator('details.used summary').click();
|
|
||||||
await page.waitForTimeout(800);
|
|
||||||
expect(await layoutProblems(page)).toEqual([]);
|
|
||||||
expect(
|
|
||||||
await page.evaluate(() => document.documentElement.scrollWidth <= window.innerWidth + 1),
|
|
||||||
).toBe(true);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
test('curvas (simulado): one series per model at its published horizons, its band only where it has intervals, and no NCI data', async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
const { url } = await firstRecord(page);
|
|
||||||
await answerWith(page, fixture([{ years: 5, reference: 0.0027 }]));
|
|
||||||
await withRisks(page, [
|
|
||||||
risk('a', 'Riesgo LIEAG+ v3', 'cacu.survival', '2026-06-01', [
|
|
||||||
[1, 0.08, 0.05, 0.12],
|
|
||||||
[3, 0.21, 0.15, 0.28],
|
|
||||||
[5, 0.34, 0.26, 0.44],
|
|
||||||
]),
|
|
||||||
risk('b', 'Riesgo cáncer v2', 'cacu.recurrence', '2026-06-01', [
|
|
||||||
[1, 0.002, 0.001, 0.005],
|
|
||||||
[3, 0.008],
|
|
||||||
[5, 0.015, 0.008, 0.028],
|
|
||||||
]),
|
|
||||||
risk('c', 'Sin intervalo v1', 'cacu.other', '2026-06-01', [
|
|
||||||
[2, 0.1],
|
|
||||||
[4, 0.2],
|
|
||||||
]),
|
|
||||||
risk('d', 'Un punto v1', 'cacu.partial', '2026-06-01', [[5, 0.5]]),
|
|
||||||
]);
|
|
||||||
await open(page, url);
|
|
||||||
const card = page.locator('details.curves');
|
|
||||||
await expect(card.locator('summary')).toHaveText('Curvas de probabilidad con su intervalo');
|
|
||||||
await expect(card).toHaveAttribute('open', '');
|
|
||||||
await expect(card.locator('li').first()).toContainText(
|
|
||||||
'Riesgo LIEAG+ (fecha índice 2026-06-01): 1 año: 8.0 % (IC 95 %: 5.0–12.0 %); 3 años: 21.0 %',
|
|
||||||
);
|
|
||||||
const plot = await card.locator('.js-plotly-plot').evaluate((e: any) => ({
|
|
||||||
names: e.data.filter((t: any) => t.showlegend !== false).map((t: any) => t.name),
|
|
||||||
series: Object.fromEntries(
|
|
||||||
e.data.filter((t: any) => t.mode?.includes('markers')).map((t: any) => [t.name, t.x]),
|
|
||||||
),
|
|
||||||
bands: e.data.filter((t: any) => t.fill === 'tonexty').map((t: any) => t.name),
|
|
||||||
ticks: e.layout.xaxis.tickvals,
|
|
||||||
title: e.layout.xaxis.title.text,
|
|
||||||
}));
|
|
||||||
expect(plot.series).toEqual({
|
|
||||||
'Riesgo LIEAG+': [1, 3, 5],
|
|
||||||
'Riesgo cáncer': [1, 3, 5],
|
|
||||||
'Sin intervalo': [2, 4],
|
|
||||||
'Un punto': [5],
|
|
||||||
});
|
|
||||||
expect(plot.bands).toEqual(['IC 95 % Riesgo LIEAG+', 'IC 95 % Riesgo cáncer']); // none for the models without intervals
|
|
||||||
expect(plot.ticks).toEqual([1, 2, 3, 4, 5]);
|
|
||||||
expect(plot.title).toBe('Horizonte (años desde la fecha índice (2026-06-01))');
|
|
||||||
// the reference is a separate table: its 0.27 % is nowhere in the figure
|
|
||||||
expect(
|
|
||||||
JSON.stringify(await card.locator('.js-plotly-plot').evaluate((e: any) => e.data)),
|
|
||||||
).not.toContain('0.27');
|
|
||||||
await expect(page.locator('[data-section=referencia-nci]')).toBeVisible();
|
|
||||||
});
|
|
||||||
-122
@@ -1,122 +0,0 @@
|
|||||||
import type { Page } from '@playwright/test';
|
|
||||||
|
|
||||||
/** What breaks a page's layout, measured in the browser: overlapping texts (also inside
|
|
||||||
* Plotly figures: legend against axis titles, tick labels), labels clipped at a figure's
|
|
||||||
* edge, labels that wrap where they should not (buttons, badges), a header taller than one
|
|
||||||
* row, text cut by its own box, and a page wider than the window. Empty: nothing found. */
|
|
||||||
export async function layoutProblems(page: Page): Promise<string[]> {
|
|
||||||
return page.evaluate(() => {
|
|
||||||
const found: string[] = [];
|
|
||||||
const box = (e: Element) => e.getBoundingClientRect();
|
|
||||||
const hit = (a: DOMRect, b: DOMRect) =>
|
|
||||||
a.width > 0 &&
|
|
||||||
b.width > 0 &&
|
|
||||||
a.left < b.right - 1 &&
|
|
||||||
b.left < a.right - 1 &&
|
|
||||||
a.top < b.bottom - 1 &&
|
|
||||||
b.top < a.bottom - 1;
|
|
||||||
const where = (el: Element) => {
|
|
||||||
const card = el.closest('mat-card, section, .card');
|
|
||||||
const h = card?.querySelector('h1,h2,h3,h4,mat-card-title');
|
|
||||||
return (h?.textContent ?? '').trim().slice(0, 60);
|
|
||||||
};
|
|
||||||
if (document.documentElement.scrollWidth > window.innerWidth + 1)
|
|
||||||
found.push(
|
|
||||||
`page overflows horizontally: ${document.documentElement.scrollWidth} > ${window.innerWidth}`,
|
|
||||||
);
|
|
||||||
for (const plot of document.querySelectorAll('.js-plotly-plot')) {
|
|
||||||
const texts = [
|
|
||||||
...plot.querySelectorAll(
|
|
||||||
'.legend, .g-xtitle text, .g-ytitle text, .xtitle, .ytitle, .gtitle',
|
|
||||||
),
|
|
||||||
];
|
|
||||||
for (let i = 0; i < texts.length; i++)
|
|
||||||
for (let j = i + 1; j < texts.length; j++)
|
|
||||||
if (
|
|
||||||
!texts[i].contains(texts[j]) &&
|
|
||||||
!texts[j].contains(texts[i]) &&
|
|
||||||
hit(box(texts[i]), box(texts[j]))
|
|
||||||
)
|
|
||||||
found.push(
|
|
||||||
`plot "${where(plot)}": ${texts[i].getAttribute('class')} overlaps ${texts[j].getAttribute('class')}`,
|
|
||||||
);
|
|
||||||
const host = box(plot);
|
|
||||||
for (const t of plot.querySelectorAll('.slicetext, .xtick text, .ytick text, .legendtext')) {
|
|
||||||
const b = box(t);
|
|
||||||
if (b.width && (b.left < host.left - 1 || b.right > host.right + 1))
|
|
||||||
found.push(`plot "${where(plot)}": text "${t.textContent}" clipped at the edge`);
|
|
||||||
}
|
|
||||||
const ticks = [...plot.querySelectorAll('.xtick text')].map(box);
|
|
||||||
for (let i = 1; i < ticks.length; i++)
|
|
||||||
if (hit(ticks[i - 1], ticks[i])) {
|
|
||||||
found.push(`plot "${where(plot)}": x tick labels overlap`);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Text elements overlapping each other (headings, labels, buttons, table cells).
|
|
||||||
const els = [
|
|
||||||
...document.querySelectorAll<HTMLElement>(
|
|
||||||
'h1,h2,h3,h4,p,label,button,a,dt,dd,th,td,mat-card-title,.mdc-tab__text-label,mat-label,li',
|
|
||||||
),
|
|
||||||
].filter(
|
|
||||||
(e: any) =>
|
|
||||||
e.offsetParent &&
|
|
||||||
box(e).width > 0 &&
|
|
||||||
box(e).height > 0 &&
|
|
||||||
!e.closest('.js-plotly-plot, .cdk-overlay-container') &&
|
|
||||||
!e.closest('details:not([open]) > :not(summary)'),
|
|
||||||
);
|
|
||||||
for (let i = 0; i < els.length; i++)
|
|
||||||
for (let j = i + 1; j < Math.min(els.length, i + 40); j++) {
|
|
||||||
const a = els[i],
|
|
||||||
b = els[j];
|
|
||||||
if (a.contains(b) || b.contains(a)) continue;
|
|
||||||
if (hit(box(a), box(b)))
|
|
||||||
found.push(
|
|
||||||
`"${(a.textContent ?? '').trim().slice(0, 30)}" overlaps "${(b.textContent ?? '').trim().slice(0, 30)}" (${where(a)})`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
// Text cut by its own box (ellipsis or overflow hidden).
|
|
||||||
for (const e of document.querySelectorAll<HTMLElement>(
|
|
||||||
'button, .mdc-tab__text-label, th, mat-label, .mat-mdc-select-value-text',
|
|
||||||
))
|
|
||||||
if (
|
|
||||||
e.offsetParent &&
|
|
||||||
e.scrollWidth > e.clientWidth + 2 &&
|
|
||||||
getComputedStyle(e).overflow !== 'visible'
|
|
||||||
)
|
|
||||||
found.push(`text cut: "${(e.textContent ?? '').trim().slice(0, 40)}"`);
|
|
||||||
const header = document.querySelector('.header');
|
|
||||||
if (header && header.getBoundingClientRect().height > 90 && window.innerWidth > 720)
|
|
||||||
found.push(
|
|
||||||
`header taller than one row: ${Math.round(header.getBoundingClientRect().height)}px`,
|
|
||||||
);
|
|
||||||
for (const b of document.querySelectorAll<HTMLElement>(
|
|
||||||
'button:not(.mat-button-toggle-button), a.mdc-button, .badge, .mat-mdc-chip',
|
|
||||||
)) {
|
|
||||||
const label = (b.querySelector('.mdc-button__label') as HTMLElement | null) ?? b;
|
|
||||||
const lines =
|
|
||||||
label.getClientRects().length &&
|
|
||||||
Math.round(
|
|
||||||
label.getBoundingClientRect().height /
|
|
||||||
parseFloat(getComputedStyle(label).lineHeight || '20'),
|
|
||||||
);
|
|
||||||
if (b.offsetParent && lines > 1 && (label.textContent ?? '').trim().length < 40)
|
|
||||||
found.push(`label wraps: "${(label.textContent ?? '').trim()}"`);
|
|
||||||
}
|
|
||||||
const icons = [
|
|
||||||
...document.querySelectorAll('header mat-icon, header a, header button, header .title'),
|
|
||||||
];
|
|
||||||
for (let i = 0; i < icons.length; i++)
|
|
||||||
for (let j = i + 1; j < icons.length; j++)
|
|
||||||
if (
|
|
||||||
!icons[i].contains(icons[j]) &&
|
|
||||||
!icons[j].contains(icons[i]) &&
|
|
||||||
hit(box(icons[i]), box(icons[j]))
|
|
||||||
)
|
|
||||||
found.push(
|
|
||||||
`header: "${(icons[i].textContent ?? '').trim().slice(0, 20)}" overlaps "${(icons[j].textContent ?? '').trim().slice(0, 20)}"`,
|
|
||||||
);
|
|
||||||
return [...new Set(found)];
|
|
||||||
});
|
|
||||||
}
|
|
||||||
+427
-337
@@ -1,368 +1,458 @@
|
|||||||
import { readFileSync } from 'node:fs';
|
import { expect } from '@playwright/test';
|
||||||
import { expect, Page, test } from '@playwright/test';
|
import { downloaded, test, watch } from './support';
|
||||||
import { layoutProblems } from './layout';
|
|
||||||
|
|
||||||
/** Every page loads from the API with no failed request and no console error. */
|
test('tea indicators: every tab loads, and the follow-up list exports to Excel', async ({
|
||||||
function watch(page: Page): string[] {
|
|
||||||
const problems: string[] = [];
|
|
||||||
page.on('console', (m) => m.type() === 'error' && problems.push(`console: ${m.text()}`));
|
|
||||||
page.on('response', (r) => r.status() >= 400 && problems.push(`${r.status()} ${r.url()}`));
|
|
||||||
page.on('pageerror', (e) => problems.push(`page: ${e.message}`));
|
|
||||||
return problems;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The pages show only to someone signed in (the API itself answers everyone).
|
|
||||||
test.beforeEach(async ({ page }) => {
|
|
||||||
const signed = await page.request.post('/api/auth/login', {
|
|
||||||
form: { username: 'admin@isssteleon.mx', password: 'solo-para-pruebas' },
|
|
||||||
});
|
|
||||||
expect(signed.status()).toBe(204);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('login: the pages wait for a sign-in, and a wrong password says so', async ({ browser }) => {
|
|
||||||
const page = await browser.newPage({ baseURL: 'http://127.0.0.1:4310' });
|
|
||||||
await page.goto('/conectar');
|
|
||||||
await expect(page).toHaveURL(/\/login\?next=%2Fconectar/);
|
|
||||||
await expect(page.getByRole('heading', { name: 'Inicio de sesión' })).toBeVisible();
|
|
||||||
await page.getByRole('textbox', { name: 'Usuario' }).fill('admin@isssteleon.mx');
|
|
||||||
await page.getByRole('textbox', { name: 'Contraseña' }).fill('otra');
|
|
||||||
await page.getByRole('button', { name: 'Ingresar' }).click();
|
|
||||||
await expect(page.getByText('Usuario o contraseña incorrectos.')).toBeVisible();
|
|
||||||
await page.getByRole('textbox', { name: 'Contraseña' }).fill('solo-para-pruebas');
|
|
||||||
await page.getByRole('button', { name: 'Ingresar' }).click();
|
|
||||||
await expect(page).toHaveURL(/\/conectar$/);
|
|
||||||
await page.getByRole('button', { name: 'Cuenta' }).click();
|
|
||||||
await page.getByRole('menuitem', { name: 'Salir' }).click();
|
|
||||||
await expect(page).toHaveURL(/\/login/);
|
|
||||||
await page.close();
|
|
||||||
});
|
|
||||||
|
|
||||||
test("indicators: the KPIs are the API's MeasureReports, every tab and the patient view load", async ({
|
|
||||||
page,
|
page,
|
||||||
}) => {
|
}) => {
|
||||||
const problems = watch(page);
|
const problems = watch(page);
|
||||||
const report = page.waitForResponse(
|
const listed = page.waitForResponse(
|
||||||
(r) =>
|
(r) => r.url().includes('/tea/fhir/Measure') && !r.url().includes('MeasureReport'),
|
||||||
r.url().includes('MeasureReport') &&
|
|
||||||
r.url().includes('measure=cacu-eu7') &&
|
|
||||||
!r.url().includes('%2C'),
|
|
||||||
);
|
);
|
||||||
await page.goto('/indicadores/cacu');
|
await page.goto('/indicadores/tea');
|
||||||
const eu7 = await (await report).json();
|
const measures = (await (await listed).json()).entry.length;
|
||||||
const count = eu7.entry[0].resource.group[0].population.find(
|
expect(measures).toBe(11);
|
||||||
(p: any) => p.code.coding[0].code === 'initial-population',
|
await expect(page.getByRole('tab', { name: 'Resumen' })).toBeVisible();
|
||||||
).count;
|
const indicators = page.locator('app-tab-indicadores');
|
||||||
// the card says it as the old one did: "<n> pacientes"
|
await expect(indicators.locator('[data-measure]')).toHaveCount(10);
|
||||||
await expect(page.locator('[data-measure="CACU_EU7"] .kpi-value')).toHaveText(
|
await expect(indicators.locator('[data-figure="sankey"] .sankey')).toBeVisible();
|
||||||
`${count.toLocaleString('es-MX')} pacientes`,
|
await expect(indicators.locator('[data-measure="M31_PREVALENCIA"] .barlayer')).toBeVisible();
|
||||||
);
|
await expect(
|
||||||
await expect(page.locator('app-tab-indicadores app-plot').first()).toBeVisible();
|
indicators.locator('[data-measure="M24_CONFIRMACION_DIAGNOSTICO"] app-plot'),
|
||||||
|
).toHaveCount(1);
|
||||||
|
await expect(
|
||||||
|
indicators.locator('[data-measure="M23_PACIENTES_EVALUADOS"] mat-button-toggle-group'),
|
||||||
|
).toHaveCount(0);
|
||||||
|
await expect(
|
||||||
|
indicators.getByRole('heading', { name: 'Porcentaje de EEG normal y anormal' }),
|
||||||
|
).toHaveCount(0);
|
||||||
|
|
||||||
await page.getByRole('tab', { name: 'Trazabilidad' }).click();
|
await page.getByRole('tab', { name: 'Trazabilidad' }).click();
|
||||||
await expect(page.locator('app-tab-trazabilidad section.panel')).toHaveCount(9);
|
const history = page.locator('app-tab-trazabilidad');
|
||||||
|
await expect(history.locator('[data-measure]')).toHaveCount(11);
|
||||||
|
await expect(
|
||||||
|
history.getByRole('heading', { name: 'Prevalencia registrada de TEA' }),
|
||||||
|
).toBeVisible();
|
||||||
|
await expect(
|
||||||
|
history.getByRole('heading', { name: 'Porcentaje de EEG normal y anormal' }),
|
||||||
|
).toBeVisible();
|
||||||
|
await expect(page.locator('app-tab-trazabilidad app-plot').first()).toBeVisible();
|
||||||
|
|
||||||
|
await page.getByRole('tab', { name: 'Seguimiento' }).click();
|
||||||
|
const rows = page.locator('app-tab-seguimiento-tea table tbody tr');
|
||||||
|
await expect(rows.first().locator('td').first()).toHaveText(/^N-?\d{4}$/);
|
||||||
|
await expect(rows.first().locator('app-tea-stepper li')).toHaveCount(4);
|
||||||
|
await expect(page.locator('app-tab-seguimiento-tea').getByRole('columnheader')).toHaveText([
|
||||||
|
'Expediente',
|
||||||
|
'Nombre',
|
||||||
|
'Sexo',
|
||||||
|
'Edad (meses)',
|
||||||
|
'Etapa',
|
||||||
|
'Puntaje M-CHAT',
|
||||||
|
'CSS ADOS-2',
|
||||||
|
'Estatus de EEG',
|
||||||
|
'Alteraciones encontradas',
|
||||||
|
]);
|
||||||
|
const name = await downloaded(
|
||||||
|
page,
|
||||||
|
page.getByRole('button', { name: 'Exportar a Excel' }),
|
||||||
|
'xlsx',
|
||||||
|
);
|
||||||
|
expect(name).toMatch(/^tea-seguimiento-/);
|
||||||
|
|
||||||
|
await page.getByRole('tab', { name: 'Análisis de riesgo' }).click();
|
||||||
|
const risk = page.locator('app-tab-riesgos-tea');
|
||||||
|
await expect(
|
||||||
|
risk.getByRole('heading', { name: 'EEG de los pacientes del periodo' }),
|
||||||
|
).toBeVisible();
|
||||||
|
await expect(risk.locator('table.worklist tbody tr').first().locator('td').first()).toHaveText(
|
||||||
|
/^N-?\d{4}$/,
|
||||||
|
);
|
||||||
|
await expect(risk.locator('table.worklist > thead').getByRole('columnheader')).toHaveText([
|
||||||
|
'Expediente',
|
||||||
|
'Nombre',
|
||||||
|
'Sexo',
|
||||||
|
'Edad (meses)',
|
||||||
|
'Asociación principal',
|
||||||
|
'Razón de momios',
|
||||||
|
'IC 95 %',
|
||||||
|
'q',
|
||||||
|
'Probabilidad',
|
||||||
|
'Probabilidad de referencia',
|
||||||
|
]);
|
||||||
|
await risk.getByRole('combobox', { name: 'Modelo de asociación' }).click();
|
||||||
|
await page.getByRole('option', { name: 'Con resultados' }).click();
|
||||||
|
await expect(risk.locator('table.worklist tbody tr').first()).toBeVisible();
|
||||||
|
|
||||||
await page.getByRole('tab', { name: 'Datos y definiciones' }).click();
|
await page.getByRole('tab', { name: 'Datos y definiciones' }).click();
|
||||||
await expect(page.locator('app-tab-definiciones details')).toHaveCount(21);
|
const definitions = page.locator('app-tab-definiciones');
|
||||||
|
await expect(definitions.locator('details')).toHaveCount(measures);
|
||||||
const list = page.waitForResponse((r) => r.url().includes('/fhir/Patient?'));
|
|
||||||
await page.getByRole('tab', { name: 'Análisis de riesgos' }).click();
|
|
||||||
const bundle = await (await list).json();
|
|
||||||
const patient = bundle.entry.find((e: any) => e.search.mode === 'match').resource;
|
|
||||||
const first = patient.name?.[0]?.text ?? patient.id.slice(0, 10);
|
|
||||||
const rows = page.locator('table.worklist tbody tr');
|
|
||||||
await expect(rows).toHaveCount(Math.min(20, bundle.total));
|
|
||||||
await expect(rows.first().locator('a').first()).toHaveText(first);
|
|
||||||
await page.getByRole('button', { name: 'Siguiente' }).click();
|
|
||||||
await expect(page.getByText('Página 2 de')).toBeVisible();
|
|
||||||
|
|
||||||
await page.getByRole('button', { name: 'Anterior' }).click();
|
|
||||||
await rows.first().locator('a').first().click();
|
|
||||||
await expect(page.getByText('Historial médico')).toBeVisible();
|
|
||||||
await expect(page.getByText('Pruebas y resultados')).toBeVisible();
|
|
||||||
await expect(
|
await expect(
|
||||||
page.locator('app-paciente table').nth(1).locator('tbody tr').first(),
|
definitions.getByText('Porcentaje de EEG normal y anormal', { exact: true }),
|
||||||
).not.toContainText('Sin estudios');
|
).toBeVisible();
|
||||||
|
await definitions.getByText('Prevalencia registrada de TEA', { exact: true }).click();
|
||||||
|
await expect(definitions.getByText(/Every child loaded on the platform/)).toBeVisible();
|
||||||
|
expect(problems).toEqual([]);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('tea complete child: every screen has data', async ({ page }) => {
|
||||||
|
const problems = watch(page);
|
||||||
|
const recordNumber = /^N-?0011$/;
|
||||||
|
const filled = /^\s*(?!—\s*$)\S/;
|
||||||
|
const mark = '.point, .slice path, .sankey-node, .box';
|
||||||
|
const tab = (name: string) => page.getByRole('tab', { name }).click();
|
||||||
|
const section = (title: string) =>
|
||||||
|
page.locator('app-tea-section').filter({
|
||||||
|
has: page.locator('mat-card-title').getByText(title, { exact: true }),
|
||||||
|
});
|
||||||
|
const find = async (host: string) => {
|
||||||
|
const search = page.locator(host).getByRole('searchbox', { name: 'Buscar paciente' });
|
||||||
|
await search.fill('N0011');
|
||||||
|
await search.press('Enter');
|
||||||
|
};
|
||||||
|
const childRow = (table: string) =>
|
||||||
|
page
|
||||||
|
.locator(table)
|
||||||
|
.getByRole('row')
|
||||||
|
.filter({
|
||||||
|
has: page.getByRole('cell', { name: recordNumber }),
|
||||||
|
});
|
||||||
|
|
||||||
await page.goto('/indicadores/cama');
|
|
||||||
await expect(page.getByRole('tab', { name: 'Indicadores' })).toBeVisible();
|
|
||||||
await page.getByRole('tab', { name: 'Análisis de riesgos' }).click();
|
|
||||||
await page.locator('mat-form-field', { hasText: 'Ventana' }).click();
|
|
||||||
await page.getByRole('option', { name: '12 meses' }).click();
|
|
||||||
const camaRows = page.locator('table.worklist tbody tr');
|
|
||||||
await expect(camaRows.first()).toContainText('BI-RADS');
|
|
||||||
await page.goto('/indicadores/tea');
|
await page.goto('/indicadores/tea');
|
||||||
await expect(page.getByRole('tab', { name: 'Resumen' })).toBeVisible();
|
const summary = page.locator('app-tab-indicadores');
|
||||||
|
await summary.getByText('Semestral', { exact: true }).click();
|
||||||
|
await summary.getByRole('combobox', { name: 'Periodo seleccionado' }).click();
|
||||||
|
await page.getByRole('option', { name: '2025-S2', exact: true }).click();
|
||||||
|
await summary.getByRole('button', { name: 'Aplicar' }).click();
|
||||||
|
await expect(summary.locator('.summary mark').first()).toHaveText(/\d/);
|
||||||
|
const summaryFigures = summary.locator('.figure-card, .box-card');
|
||||||
|
await expect(summaryFigures).toHaveCount(10);
|
||||||
|
for (const card of await summaryFigures.all()) {
|
||||||
|
await expect(card.locator(`app-plot :is(${mark})`).first()).toBeAttached();
|
||||||
|
}
|
||||||
|
await expect(summary.getByText('Sin datos publicados')).toHaveCount(0);
|
||||||
|
|
||||||
|
await tab('Trazabilidad');
|
||||||
|
const history = page.locator('app-tab-trazabilidad');
|
||||||
|
const panels = history.locator('[data-measure]');
|
||||||
|
await expect(panels).toHaveCount(11);
|
||||||
|
for (const panel of await panels.all()) {
|
||||||
|
await expect(panel.locator(`app-plot :is(${mark})`).first()).toBeAttached();
|
||||||
|
}
|
||||||
|
await expect(history.getByText('Sin datos para el periodo.')).toHaveCount(0);
|
||||||
|
|
||||||
|
await tab('Seguimiento');
|
||||||
|
await find('app-tab-seguimiento-tea');
|
||||||
|
const followUp = childRow('app-tab-seguimiento-tea table.worklist');
|
||||||
|
await expect(followUp.getByRole('cell')).toHaveCount(9);
|
||||||
|
await expect(followUp.locator('td:not(:nth-child(5))')).toHaveText(Array(8).fill(filled));
|
||||||
|
await expect(followUp.locator('app-tea-stepper li.completed')).toHaveCount(4);
|
||||||
|
await expect(followUp.getByRole('cell').last()).toHaveText(/^[1-9]\d*$/);
|
||||||
|
|
||||||
|
await tab('Análisis de riesgo');
|
||||||
|
const risk = page.locator('app-tab-riesgos-tea');
|
||||||
|
await find('app-tab-riesgos-tea');
|
||||||
|
await risk.getByRole('combobox', { name: 'Modelo de asociación' }).click();
|
||||||
|
await page.getByRole('option', { name: 'Con resultados' }).click();
|
||||||
|
const riskRow = childRow('app-tab-riesgos-tea table.worklist');
|
||||||
|
await expect(riskRow.getByRole('cell')).toHaveText(Array(10).fill(filled));
|
||||||
|
|
||||||
|
await tab('Datos y definiciones');
|
||||||
|
const definitions = page.locator('app-tab-definiciones');
|
||||||
|
await expect(definitions.locator('details')).toHaveCount(11);
|
||||||
|
await definitions.getByText('Prevalencia registrada de TEA', { exact: true }).click();
|
||||||
|
await expect(definitions.getByText(/Every child loaded on the platform/)).toBeVisible();
|
||||||
|
|
||||||
|
await tab('Seguimiento');
|
||||||
|
await followUp.getByRole('link').click();
|
||||||
|
await expect(page.getByText(recordNumber)).toBeVisible();
|
||||||
|
const gantt = section('Línea del tiempo');
|
||||||
|
await expect(gantt.locator('app-plot .barlayer .point').first()).toBeAttached();
|
||||||
|
const diamonds = gantt.locator('app-plot .scatterlayer path.point');
|
||||||
|
await expect(diamonds).toHaveCount(4);
|
||||||
|
for (const diamond of await diamonds.all()) {
|
||||||
|
await expect(diamond).toHaveAttribute('d', /^M[\d.]+,0L0,[\d.]+L-/);
|
||||||
|
}
|
||||||
|
await expect(section('ADOS-2').locator('tbody tr').first().locator('td').nth(2)).toHaveText(
|
||||||
|
/^[AB]-\d+$/,
|
||||||
|
);
|
||||||
|
await expect(section('Calidad del EEG').locator('tbody tr').first()).toBeVisible();
|
||||||
|
const alterations = section('Alteraciones');
|
||||||
|
await expect(
|
||||||
|
alterations.locator('h3:text-is("Norma por edad · p5–p95") + app-plot .point').first(),
|
||||||
|
).toBeAttached();
|
||||||
|
await expect(
|
||||||
|
alterations.locator('h3:text-is("Mapa de la cabeza") + app-plot .contourlayer path').first(),
|
||||||
|
).toBeAttached();
|
||||||
|
await expect(section('Relación con el ADOS-2').locator('tbody tr').first()).toBeVisible();
|
||||||
|
|
||||||
|
await page.getByRole('link', { name: 'Análisis de riesgo' }).click();
|
||||||
|
await expect(page.getByRole('heading', { name: 'Análisis de riesgo TEA' })).toBeVisible();
|
||||||
|
await expect(section('Qué calcula').locator('p').first()).toHaveText(/ADOS-2/);
|
||||||
|
await expect(
|
||||||
|
section('Puntuaciones z por métrica y zona').locator('app-plot .point').first(),
|
||||||
|
).toBeAttached();
|
||||||
|
await expect(
|
||||||
|
section('Razones de momios por par').locator('app-plot .point').first(),
|
||||||
|
).toBeAttached();
|
||||||
|
await expect(
|
||||||
|
section('Probabilidad frente a la referencia').locator('tbody tr').first(),
|
||||||
|
).toBeVisible();
|
||||||
|
await expect(section('Probabilidad según z').locator('app-plot .point').first()).toBeAttached();
|
||||||
|
await expect(section('Limitaciones').locator('p').first()).toHaveText(/cohorte/);
|
||||||
|
|
||||||
|
await page.goto('/gobernanza/tea');
|
||||||
|
await expect(page.getByRole('region', { name: 'Ejecución' }).getByRole('status')).toContainText(
|
||||||
|
'Disponible',
|
||||||
|
);
|
||||||
|
const models = page.getByRole('region', { name: 'Modelos' });
|
||||||
|
const modelCards = models.locator('section.model');
|
||||||
|
await expect(modelCards).toHaveCount(8);
|
||||||
|
for (const model of await modelCards.all()) {
|
||||||
|
await expect(model.getByText('champion', { exact: true })).toBeVisible();
|
||||||
|
}
|
||||||
|
await expect(page.locator('app-governance-training formly-form')).toBeVisible();
|
||||||
|
await expect(page.getByText('Subir archivos', { exact: true })).toHaveCount(0);
|
||||||
|
const bundles = page.getByRole('region', { name: 'Bundles' });
|
||||||
|
await expect(bundles.getByRole('combobox', { name: 'Versiones' })).toHaveText('En producción');
|
||||||
|
await expect(bundles.getByRole('button', { name: 'Exportar bundle' })).toBeEnabled();
|
||||||
|
const studies = page.locator('app-eeg-studies');
|
||||||
|
const completeEeg = studies.getByRole('row').filter({ hasText: 'LAB-N-0011-1' });
|
||||||
|
await expect(completeEeg).toContainText(/\bVálido\b/);
|
||||||
|
await completeEeg.getByRole('button').click();
|
||||||
|
await expect(
|
||||||
|
studies
|
||||||
|
.locator('table.plain:not(.eegs) tbody tr td')
|
||||||
|
.filter({ hasText: /^tea\./ })
|
||||||
|
.first(),
|
||||||
|
).toBeVisible();
|
||||||
|
await studies.getByRole('button', { name: 'Evaluar un solo estudio' }).click();
|
||||||
|
const preview = page.locator('app-eeg-preview');
|
||||||
|
await expect(preview.getByLabel('EDF')).toBeAttached();
|
||||||
|
await expect(preview.getByLabel('ADOS-2 (PDF)')).toBeAttached();
|
||||||
|
await expect(preview.getByLabel('Fecha de nacimiento')).toBeVisible();
|
||||||
|
await expect(page.getByRole('heading', { name: 'Vista previa', level: 2 })).toHaveCount(0);
|
||||||
expect(problems).toEqual([]);
|
expect(problems).toEqual([]);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('conectar: open the hospital pipeline, preview a source, run it to success', async ({
|
test('tea patient: the record and the risk page load and export to PDF', async ({ page }) => {
|
||||||
|
const problems = watch(page);
|
||||||
|
await page.goto('/indicadores/tea');
|
||||||
|
await page.getByRole('tab', { name: 'Seguimiento' }).click();
|
||||||
|
const first = page.locator('app-tab-seguimiento-tea table tbody tr').first();
|
||||||
|
await expect(first.locator('td').first()).toHaveText(/^N-?\d{4}$/);
|
||||||
|
await first.getByRole('link').click();
|
||||||
|
|
||||||
|
await expect(page).toHaveURL(/\/indicadores\/tea\/pacientes\/[^/]+$/);
|
||||||
|
await expect(page.getByRole('heading', { level: 1 })).toBeVisible();
|
||||||
|
const timeline = page.locator('app-tea-section').first();
|
||||||
|
await expect(timeline.getByText('Línea del tiempo', { exact: true })).toBeVisible();
|
||||||
|
await expect(timeline.locator('app-plot .scatterlayer .point').first()).toBeVisible();
|
||||||
|
await expect(timeline.getByRole('table')).toHaveCount(0);
|
||||||
|
const record = await downloaded(page, page.getByRole('button', { name: 'Exportar PDF' }), 'pdf');
|
||||||
|
expect(record).toMatch(/^tea-seguimiento-/);
|
||||||
|
|
||||||
|
await page.getByRole('link', { name: 'Regresar' }).click();
|
||||||
|
const focused = page.locator('app-tab-seguimiento-tea');
|
||||||
|
await expect(focused.getByRole('button', { name: 'Ver todos los pacientes' })).toBeVisible();
|
||||||
|
const focusedRows = focused.locator('table tbody tr');
|
||||||
|
await expect(focusedRows).toHaveCount(1);
|
||||||
|
await expect(focusedRows.first().locator('td')).toHaveCount(9);
|
||||||
|
await expect(focusedRows.first().locator('app-tea-stepper')).toBeVisible();
|
||||||
|
await focusedRows.first().getByRole('link').click();
|
||||||
|
|
||||||
|
await page.getByRole('link', { name: 'Análisis de riesgo' }).click();
|
||||||
|
await expect(page.getByRole('heading', { name: 'Análisis de riesgo TEA' })).toBeVisible();
|
||||||
|
await expect(page.locator('app-tea-section').first()).toBeVisible();
|
||||||
|
expect(await downloaded(page, page.getByRole('button', { name: 'Exportar PDF' }), 'pdf')).toMatch(
|
||||||
|
/^tea-riesgos-/,
|
||||||
|
);
|
||||||
|
await page.goto('/indicadores/tea');
|
||||||
|
await page.getByRole('tab', { name: 'Análisis de riesgo' }).click();
|
||||||
|
const riskList = page.locator('app-tab-riesgos-tea table.worklist');
|
||||||
|
const patientLink = riskList.getByRole('row').nth(1).getByRole('link');
|
||||||
|
await expect(patientLink).toHaveAttribute(
|
||||||
|
'href',
|
||||||
|
/\/indicadores\/tea\/pacientes\/[^/]+\/riesgo$/,
|
||||||
|
);
|
||||||
|
await patientLink.click();
|
||||||
|
await expect(page).toHaveURL(/\/indicadores\/tea\/pacientes\/[^/]+\/riesgo$/);
|
||||||
|
await expect(page.getByRole('heading', { name: 'Análisis de riesgo TEA' })).toBeVisible();
|
||||||
|
expect(problems).toEqual([]);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('tea gobernanza: every section in sync mode, and the preview saved as PDF', async ({
|
||||||
page,
|
page,
|
||||||
}) => {
|
}) => {
|
||||||
|
const problems = watch(page);
|
||||||
|
await page.goto('/gobernanza/tea');
|
||||||
|
await expect(page.locator('app-gobernanza').getByRole('heading', { level: 2 })).toHaveText([
|
||||||
|
'Ejecución',
|
||||||
|
'Modelos',
|
||||||
|
'Entrenamiento',
|
||||||
|
'Bundles',
|
||||||
|
'Estudios EEG',
|
||||||
|
]);
|
||||||
|
await expect(page.getByRole('heading', { name: 'Subir archivos', exact: true })).toHaveCount(0);
|
||||||
|
await expect(page.getByText('Archivos de entrenamiento', { exact: true })).toHaveCount(0);
|
||||||
|
await page.getByRole('combobox', { name: 'Modo' }).click();
|
||||||
|
await page.getByRole('option', { name: 'Sync' }).click();
|
||||||
|
await expect(page.getByRole('status').filter({ hasText: 'Disponible' })).toBeVisible();
|
||||||
|
|
||||||
|
await page.getByRole('button', { name: 'Entrenar modelos' }).click();
|
||||||
|
const training = page.getByRole('heading', { name: 'Entrenamiento', level: 2 });
|
||||||
|
await expect(training).toBeVisible();
|
||||||
|
await expect(training).toBeFocused();
|
||||||
|
await expect(page.locator('app-governance-training formly-form')).toBeVisible();
|
||||||
|
|
||||||
|
const source = page.getByRole('combobox', { name: 'Origen' });
|
||||||
|
const folder = page.getByRole('textbox', { name: 'Carpeta', exact: true });
|
||||||
|
const line = page.getByRole('combobox', { name: 'Frecuencia de la red eléctrica (Hz)' });
|
||||||
|
await expect(source).toHaveText('Niños del sitio sin el diagnóstico');
|
||||||
|
await expect(folder).toBeHidden();
|
||||||
|
await expect(line).toBeHidden();
|
||||||
|
await source.click();
|
||||||
|
await page.getByRole('option', { name: 'Carpeta de EDF con edades' }).click();
|
||||||
|
await expect(folder).toBeVisible();
|
||||||
|
await expect(line).toBeVisible();
|
||||||
|
await source.click();
|
||||||
|
await page.getByRole('option', { name: 'Niños del sitio sin el diagnóstico' }).click();
|
||||||
|
await expect(folder).toBeHidden();
|
||||||
|
await expect(line).toBeHidden();
|
||||||
|
|
||||||
|
await expect(page.getByRole('button', { name: 'Calcular riesgos' })).toHaveCount(0);
|
||||||
|
await page.getByRole('button', { name: 'Analizar EEG' }).click();
|
||||||
|
await expect(page.getByRole('heading', { name: 'Estudios EEG', level: 2 })).toBeFocused();
|
||||||
|
await page.getByRole('button', { name: 'Promover candidatas' }).click();
|
||||||
|
await expect(page.getByText('No hay candidatas que se puedan promover.')).toBeVisible();
|
||||||
|
|
||||||
|
const studies = page.locator('app-eeg-studies');
|
||||||
|
await expect(studies.locator('input[type=file]')).toHaveCount(0);
|
||||||
|
await expect(studies.locator('table.eegs tbody tr').first()).toContainText(/Válido|No válido/);
|
||||||
|
await studies.locator('table.eegs tbody button:enabled').first().click();
|
||||||
|
await expect(studies.getByRole('heading', { name: /^EEG .* meses$/ })).toBeVisible();
|
||||||
|
await studies.getByRole('button', { name: 'Analizar', exact: true }).click();
|
||||||
|
await expect(studies.locator('app-run-monitor').first().getByRole('status')).toHaveText(
|
||||||
|
'SUCCESS',
|
||||||
|
{ timeout: 10 * 60_000 },
|
||||||
|
);
|
||||||
|
|
||||||
|
const toggle = studies.getByRole('button', { name: 'Evaluar un solo estudio' });
|
||||||
|
const preview = studies.locator('app-eeg-preview');
|
||||||
|
const edf = preview.getByRole('button', { name: 'EDF', exact: true });
|
||||||
|
const ados = preview.getByRole('button', { name: 'ADOS-2 (PDF)', exact: true });
|
||||||
|
const birth = preview.getByLabel('Fecha de nacimiento');
|
||||||
|
await expect(toggle).toHaveAttribute('aria-pressed', 'false');
|
||||||
|
await expect(edf).toBeHidden();
|
||||||
|
await expect(ados).toBeHidden();
|
||||||
|
await expect(birth).toBeHidden();
|
||||||
|
await toggle.click();
|
||||||
|
await expect(toggle).toHaveAttribute('aria-pressed', 'true');
|
||||||
|
await expect(page.getByRole('heading', { name: 'Vista previa', exact: true })).toHaveCount(0);
|
||||||
|
await expect(edf).toBeVisible();
|
||||||
|
await expect(ados).toBeVisible();
|
||||||
|
await expect(birth).toBeVisible();
|
||||||
|
await toggle.click();
|
||||||
|
await expect(toggle).toHaveAttribute('aria-pressed', 'false');
|
||||||
|
await expect(edf).toBeHidden();
|
||||||
|
await expect(ados).toBeHidden();
|
||||||
|
await expect(birth).toBeHidden();
|
||||||
|
await toggle.click();
|
||||||
|
await preview.getByLabel('EDF').setInputFiles(process.env['TEA_EDF']!);
|
||||||
|
await preview.getByLabel('ADOS-2 (PDF)').setInputFiles(process.env['TEA_ADOS2']!);
|
||||||
|
await preview.getByLabel('Fecha de nacimiento').fill(process.env['TEA_BIRTH']!);
|
||||||
|
await preview.getByRole('button', { name: 'Vista previa' }).click();
|
||||||
|
const dialog = page.getByRole('dialog', { name: 'Vista previa del estudio' });
|
||||||
|
await expect(dialog.getByText('Resultado de la vista previa')).toBeVisible({
|
||||||
|
timeout: 10 * 60_000,
|
||||||
|
});
|
||||||
|
await expect(dialog.locator('dt').first()).toHaveText(/^[AB]-\d+ \S/);
|
||||||
|
expect(
|
||||||
|
await downloaded(page, dialog.getByRole('button', { name: 'Guardar como PDF' }), 'pdf'),
|
||||||
|
).toMatch(/^tea-gobernanza-/);
|
||||||
|
await dialog.getByRole('button', { name: 'Cerrar' }).click();
|
||||||
|
|
||||||
|
const bundles = page.locator('app-governance-bundles');
|
||||||
|
await bundles.getByRole('combobox', { name: 'Versiones' }).click();
|
||||||
|
await page.getByRole('option', { name: 'Todas' }).click();
|
||||||
|
const [bundle] = await Promise.all([
|
||||||
|
page.waitForEvent('download'),
|
||||||
|
bundles.getByRole('button', { name: 'Exportar bundle' }).click(),
|
||||||
|
]);
|
||||||
|
expect(bundle.suggestedFilename()).toMatch(/^tea-models-[0-9a-f]{12}\.zip$/);
|
||||||
|
await expect(bundles.locator('code')).toHaveText(/^[0-9a-f]{64}$/);
|
||||||
|
expect(problems).toEqual([]);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('conectar: the tea pipeline on the canvas, and a node form', async ({ page }) => {
|
||||||
const problems = watch(page);
|
const problems = watch(page);
|
||||||
await page.goto('/conectar');
|
await page.goto('/conectar');
|
||||||
await page.getByText('cacu', { exact: true }).click();
|
const pipelines = page.locator('aside.pipelines a');
|
||||||
await expect(page.locator('vflow')).toBeVisible();
|
await expect(pipelines).toHaveCount(1);
|
||||||
// a node's caption: its kind, then its name
|
await expect(pipelines.first()).toContainText('tea');
|
||||||
await page.locator('.node-caption', { hasText: 'Fuente de datosPacientes' }).click();
|
await pipelines.first().click();
|
||||||
// drawn from a fixture, read back as a guided SQLite source: the dialog edits it
|
|
||||||
await expect(page.getByRole('button', { name: 'Editar conexión' })).toBeVisible();
|
const canvas = page.locator('.canvas');
|
||||||
await page.getByRole('button', { name: 'Vista previa' }).click();
|
await expect(page.getByRole('button', { name: 'Leer EDF' })).toBeVisible();
|
||||||
await expect(page.locator('.preview tr[mat-row]').first()).toBeVisible();
|
const extract = canvas.locator('.node-caption', { hasText: 'Extraer datos' });
|
||||||
// A map node shows the site's codes in platform terms (its ConceptMap), editable as rows.
|
await expect(extract).toBeVisible();
|
||||||
await page
|
await extract.click();
|
||||||
.locator('.node-caption', { hasText: 'Traducir códigos' })
|
|
||||||
.filter({ has: page.locator('.name', { hasText: /^Citología$/ }) })
|
const panel = page.locator('aside.panel');
|
||||||
.click();
|
await expect(panel.getByRole('heading', { name: 'Extraer datos · ados2_results' })).toBeVisible();
|
||||||
await expect(page.getByRole('heading', { name: /^Códigos del sitio/ })).toBeVisible();
|
await expect(panel.locator('formly-form')).toBeVisible();
|
||||||
await expect
|
|
||||||
.poll(() =>
|
|
||||||
page
|
|
||||||
.locator('app-concept-map-editor input')
|
|
||||||
.evaluateAll((els) => els.map((e) => (e as HTMLInputElement).value)),
|
|
||||||
)
|
|
||||||
.toContain('LIEAG');
|
|
||||||
await page.getByRole('button', { name: 'Ejecutar' }).click();
|
|
||||||
await expect(page.getByText('SUCCESS')).toBeVisible({ timeout: 10 * 60_000 });
|
|
||||||
expect(problems).toEqual([]);
|
expect(problems).toEqual([]);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('revision: what the hospital source holds, and a decision through the page', async ({
|
test('revision: the unrecognised-documents tab mirrors the pipeline', async ({ page }) => {
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
const problems = watch(page);
|
const problems = watch(page);
|
||||||
|
const answer = page.waitForResponse((r) => r.url().includes('/review/unrecognised'));
|
||||||
await page.goto('/revision');
|
await page.goto('/revision');
|
||||||
await page.getByRole('tab', { name: 'Personas' }).click();
|
await expect(page.getByRole('heading', { name: 'Revisión' })).toBeVisible();
|
||||||
await page.locator('mat-form-field', { hasText: 'Canalización' }).click();
|
const count = ((await (await answer).json()) as unknown[]).length;
|
||||||
await page.getByRole('option', { name: 'site', exact: true }).click();
|
const tab = page.getByRole('tab', { name: 'Documentos no reconocidos' });
|
||||||
await expect(page.getByText(/Posibles pacientes duplicadas \([1-9]/)).toBeVisible();
|
await expect(tab).toHaveText(`Documentos no reconocidos (${count})`);
|
||||||
await page.getByRole('button', { name: 'Distintas' }).first().click();
|
await tab.click();
|
||||||
await expect(page.getByText('Decisión registrada.')).toBeVisible();
|
if (count === 0) {
|
||||||
|
await expect(page.getByText('Sin documentos no reconocidos.')).toBeVisible();
|
||||||
|
} else {
|
||||||
|
await expect(page.locator('table.plain:not(.card) tbody tr')).toHaveCount(count);
|
||||||
|
}
|
||||||
expect(problems).toEqual([]);
|
expect(problems).toEqual([]);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('gobernanza: a version with its reports, its curves, and promotion refused without validation', async ({
|
test('cacu and cama indicators: the four tabs over domains without data', async ({ page }) => {
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
const problems = watch(page);
|
const problems = watch(page);
|
||||||
await page.goto('/gobernanza/cama');
|
expect(await (await page.request.get('/api/domains')).json()).toEqual(['cacu', 'cama', 'tea']);
|
||||||
await expect(page.getByRole('heading', { name: 'Supervivencia' })).toBeVisible();
|
for (const [domain, title] of [
|
||||||
const version = page.locator('tr', { hasText: 'v1' });
|
['cacu', 'Cáncer cervicouterino'],
|
||||||
await expect(version.getByRole('link', { name: 'Validación técnica' })).toBeVisible();
|
['cama', 'Cáncer de mama'],
|
||||||
await version.getByRole('button', { name: 'Ver gráficas' }).click();
|
]) {
|
||||||
await expect(page.locator('app-plot .plot svg').first()).toBeVisible();
|
await page.goto(`/indicadores/${domain}`);
|
||||||
await version.getByRole('button', { name: 'Promover' }).click();
|
await expect(page.getByRole('heading', { name: title, level: 1 })).toBeVisible();
|
||||||
await expect(page.getByText('No se promovió')).toContainText('Validación clínica');
|
await expect(page.getByRole('tab')).toHaveText([
|
||||||
expect(problems.filter((p) => !p.includes('409'))).toEqual([]);
|
'Indicadores',
|
||||||
});
|
'Trazabilidad',
|
||||||
|
'Análisis de riesgos',
|
||||||
test('conectar: someone who knows nothing of databases connects the SQL Server with the dialog', async ({
|
'Datos y definiciones',
|
||||||
page,
|
]);
|
||||||
}) => {
|
await expect(page.getByText('Sin datos en el periodo.').first()).toBeVisible();
|
||||||
const site = new URL((process.env['SITE_URL'] ?? '').replace(/^mssql\+pymssql/, 'http'));
|
}
|
||||||
const problems = watch(page);
|
|
||||||
await page.goto('/conectar');
|
|
||||||
await page.getByLabel('Nueva canalización').fill('asistente');
|
|
||||||
await page.getByLabel('Nueva canalización').press('Enter');
|
|
||||||
await page.getByRole('button', { name: 'Fuente de datos' }).click();
|
|
||||||
await expect(page.getByText('¿Dónde están los datos?')).toBeVisible();
|
|
||||||
await page.locator('[data-type="sqlserver"]').click();
|
|
||||||
await page.locator('[data-field="host"]').fill(site.hostname);
|
|
||||||
await page.locator('[data-field="database"]').fill(site.pathname.slice(1));
|
|
||||||
await page.locator('[data-field="user"]').fill(decodeURIComponent(site.username));
|
|
||||||
await page.locator('[data-field="password"]').fill(decodeURIComponent(site.password));
|
|
||||||
await page.getByRole('button', { name: 'Probar conexión' }).click();
|
|
||||||
await expect(page.getByText('Conexión correcta: 1 tabla.')).toBeVisible();
|
|
||||||
await page.locator('mat-select[data-field="table"]').click();
|
|
||||||
await page.getByRole('option', { name: 'ResultadoSubrogado' }).click();
|
|
||||||
await expect(page.getByText(/(Las primeras \d+ filas|La primera fila):/)).toBeVisible();
|
|
||||||
await page.getByLabel('Nombre de esta fuente').fill('Resultados');
|
|
||||||
await page.getByRole('button', { name: 'Guardar', exact: true }).last().click();
|
|
||||||
await expect(page.locator('.node-caption', { hasText: 'Resultados' })).toBeVisible();
|
|
||||||
// A wrong password says so in words, not a stack trace.
|
|
||||||
await page.getByRole('button', { name: 'Editar conexión' }).click();
|
|
||||||
await page.locator('[data-field="password"]').fill('not-it');
|
|
||||||
await page.getByRole('button', { name: 'Probar conexión' }).click();
|
|
||||||
await expect(page.getByText(/usuario o la contraseña no son correctos/)).toBeVisible();
|
|
||||||
await page.getByRole('button', { name: 'Cancelar' }).click();
|
|
||||||
await expect(page.getByRole('dialog')).toHaveCount(0);
|
|
||||||
await page.getByRole('button', { name: 'Guardar', exact: true }).click();
|
|
||||||
await expect(page.getByText('Versión 1 guardada.')).toBeVisible();
|
|
||||||
expect(problems).toEqual([]);
|
expect(problems).toEqual([]);
|
||||||
});
|
});
|
||||||
|
|
||||||
/** The old app's Indicadores tab as captured (tools/capture_pages.py): its headings from the
|
test('cacu gobernanza: the shared sections only, none of the TEA ones', async ({ page }) => {
|
||||||
* opportunity section on, in order, and the kind of each plot (its traces' types). */
|
const problems = watch(page);
|
||||||
function captured(domain: string) {
|
await page.goto('/gobernanza/cacu');
|
||||||
const path = `../tests/fixtures/reference/${domain}/ui/pages.json`;
|
await expect(page.locator('app-gobernanza').getByRole('heading', { level: 2 })).toHaveText([
|
||||||
const tabs = JSON.parse(readFileSync(path, 'utf8')).tabs;
|
'Ejecución',
|
||||||
const items = (tabs['Indicadores'] ?? tabs['Resumen']) as any[]; // TEA's first tab is its summary
|
'Modelos',
|
||||||
const from = items.findIndex((i) => i.text === 'Indicadores de oportunidad');
|
'Entrenamiento',
|
||||||
return items
|
'Bundles',
|
||||||
.slice(from)
|
]);
|
||||||
.filter((i) => ['h2', 'h3', 'plot'].includes(i.kind))
|
await expect(page.locator('app-eeg-studies')).toHaveCount(0);
|
||||||
.filter((i) => !/^(cacu|cama|tea), /.test(i.text ?? '')); // a figure's machine caption
|
await expect(page.locator('app-eeg-preview')).toHaveCount(0);
|
||||||
}
|
const nav = page.getByRole('navigation', { name: 'Dominios' });
|
||||||
const period = (text: string) => text.replace(/, \d{4}-(S[12]|\d{2})$/, ', <periodo>');
|
await expect(nav.getByRole('link', { name: 'Cáncer de mama' })).toBeVisible();
|
||||||
const kindOf = (types: string[]) => [...new Set(types)].sort().join('+');
|
await expect(nav.getByRole('link', { name: 'Trastorno del espectro autista' })).toBeVisible();
|
||||||
|
expect(problems.filter((p) => !p.startsWith('console: Failed to load'))).toEqual([]);
|
||||||
// CaCu's page is its own (Phase 6); CaMa's and TEA's follow the old one.
|
});
|
||||||
for (const domain of ['cama', 'tea']) {
|
|
||||||
test(`indicadores ${domain}: the old page's headings, in order, and the same kinds of plots`, async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
const all = captured(domain);
|
|
||||||
// CaMa's five timeliness boxes are one route card now: its heading stands for them.
|
|
||||||
const route = all.findIndex(
|
|
||||||
(i) => i.kind === 'h3' && i.text === 'Tiempo de tamizaje a diagnóstico',
|
|
||||||
);
|
|
||||||
const clinical = all.findIndex((i) => i.text === 'Indicadores clínicos');
|
|
||||||
// Lote 2: the detection rate has its own title, and the histopathology figures are two
|
|
||||||
// cards (the result by BI-RADS; the confirmation in two readings).
|
|
||||||
const detection = (i: { text?: string }) =>
|
|
||||||
i.text === 'Tasa de confirmación histopatológica'
|
|
||||||
? { ...i, text: 'Tasa de detección histopatológica' }
|
|
||||||
: i;
|
|
||||||
const results = all.findIndex(
|
|
||||||
(i) => i.text === 'Resultado histopatológico por categoría BI-RADS',
|
|
||||||
);
|
|
||||||
const cards = [
|
|
||||||
{ kind: 'h3', text: 'Resultado histopatológico por categoría BI-RADS' },
|
|
||||||
{ kind: 'h3', text: 'Confirmación histopatológica' }, // one card: title, tabs and reading
|
|
||||||
];
|
|
||||||
const old =
|
|
||||||
domain === 'cama'
|
|
||||||
? [...all.slice(0, route + 1).map(detection), ...all.slice(clinical, results), ...cards]
|
|
||||||
: all;
|
|
||||||
await page.goto(`/indicadores/${domain}`);
|
|
||||||
const tab = page.locator('app-tab-indicadores');
|
|
||||||
await expect(tab.getByRole('heading', { name: 'Indicadores clínicos' })).toBeVisible();
|
|
||||||
await expect(tab.locator('app-loading')).toHaveCount(0, { timeout: 5 * 60_000 });
|
|
||||||
const headings = await tab
|
|
||||||
.locator('h2, h3')
|
|
||||||
.evaluateAll((els) => els.map((e) => (e as HTMLElement).innerText.trim()));
|
|
||||||
const from = headings.indexOf('Indicadores de oportunidad');
|
|
||||||
expect(headings.slice(from).map(period)).toEqual(
|
|
||||||
old.filter((i) => i.kind !== 'plot').map((i) => period(i.text)),
|
|
||||||
);
|
|
||||||
// Each figure drawn is one of the old kinds (a figure with no data in the period is named).
|
|
||||||
const drawn = await tab
|
|
||||||
.locator('.js-plotly-plot')
|
|
||||||
.evaluateAll((els) =>
|
|
||||||
els.map((e: any) => (e.data ?? []).map((t: any) => t.type ?? 'scatter')),
|
|
||||||
);
|
|
||||||
const kinds = new Set(
|
|
||||||
old.filter((i) => i.kind === 'plot').map((i) => kindOf(i.traces.map((t: any) => t.type))),
|
|
||||||
);
|
|
||||||
for (const types of drawn) expect(kinds).toContain(kindOf(types));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const domain of ['cacu', 'cama', 'tea']) {
|
|
||||||
test(`trazabilidad ${domain}: the old tab's panels, in order, and the same kinds of plots`, async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
const tabs = JSON.parse(
|
|
||||||
readFileSync(`../tests/fixtures/reference/${domain}/ui/pages.json`, 'utf8'),
|
|
||||||
).tabs;
|
|
||||||
const old = (tabs['Trazabilidad'] as any[]).filter((i) =>
|
|
||||||
['h2', 'h3', 'plot'].includes(i.kind),
|
|
||||||
);
|
|
||||||
await page.goto(`/indicadores/${domain}`);
|
|
||||||
await page.getByRole('tab', { name: 'Trazabilidad' }).click();
|
|
||||||
const tab = page.locator('app-tab-trazabilidad');
|
|
||||||
await expect(tab.getByRole('heading', { name: 'Filtros' })).toBeVisible();
|
|
||||||
await expect(tab.locator('app-loading')).toHaveCount(0, { timeout: 5 * 60_000 });
|
|
||||||
const headings = await tab
|
|
||||||
.locator('h2, h3')
|
|
||||||
.evaluateAll((els) => els.map((e) => (e as HTMLElement).innerText.trim()));
|
|
||||||
expect(headings).toEqual(old.filter((i) => i.kind !== 'plot').map((i) => i.text));
|
|
||||||
const drawn = await tab
|
|
||||||
.locator('.js-plotly-plot')
|
|
||||||
.evaluateAll((els) =>
|
|
||||||
els.map((e: any) => (e.data ?? []).map((t: any) => t.type ?? 'scatter')),
|
|
||||||
);
|
|
||||||
const kinds = new Set(
|
|
||||||
old.filter((i) => i.kind === 'plot').map((i) => kindOf(i.traces.map((t: any) => t.type))),
|
|
||||||
);
|
|
||||||
for (const types of drawn) expect(kinds).toContain(kindOf(types));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const domain of ['cacu', 'cama', 'tea']) {
|
|
||||||
test(`datos y definiciones ${domain}: the old tab's headings and an indicator that opens`, async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
const tabs = JSON.parse(
|
|
||||||
readFileSync(`../tests/fixtures/reference/${domain}/ui/pages.json`, 'utf8'),
|
|
||||||
).tabs;
|
|
||||||
const old = (tabs['Datos y definiciones'] as any[])
|
|
||||||
.filter((i) => ['h2', 'h3'].includes(i.kind))
|
|
||||||
.map((i) => i.text);
|
|
||||||
await page.goto(`/indicadores/${domain}`);
|
|
||||||
await page.getByRole('tab', { name: 'Datos y definiciones' }).click();
|
|
||||||
const tab = page.locator('app-tab-definiciones');
|
|
||||||
await expect(tab.getByRole('heading', { name: 'Catálogo de indicadores' })).toBeVisible();
|
|
||||||
const headings = await tab
|
|
||||||
.locator('h2, h3')
|
|
||||||
.evaluateAll((els) => els.map((e) => (e as HTMLElement).innerText.trim()));
|
|
||||||
expect(headings).toEqual(old);
|
|
||||||
await tab.locator('summary').first().click();
|
|
||||||
await expect(
|
|
||||||
tab.getByRole('heading', { name: 'Tipos de periodo admitidos' }).first(),
|
|
||||||
).toBeVisible();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Waits for a page's data: no loading indicator left. */
|
|
||||||
async function loaded(page: Page): Promise<void> {
|
|
||||||
await expect(page.locator('app-loading, mat-progress-bar')).toHaveCount(0, {
|
|
||||||
timeout: 5 * 60_000,
|
|
||||||
});
|
|
||||||
await page.waitForTimeout(1000); // plots finish drawing
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const width of [1440, 820]) {
|
|
||||||
test(`layout at ${width} px: no page has overlapping, clipped or wrapped labels`, async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
await page.setViewportSize({ width, height: 1000 });
|
|
||||||
const found: string[] = [];
|
|
||||||
const check = async (where: string) => {
|
|
||||||
await loaded(page);
|
|
||||||
for (const p of await layoutProblems(page)) found.push(`${where}: ${p}`);
|
|
||||||
};
|
|
||||||
for (const domain of ['cacu', 'cama', 'tea']) {
|
|
||||||
await page.goto(`/indicadores/${domain}`);
|
|
||||||
const tabs = page.locator('.mdc-tab');
|
|
||||||
for (let i = 0; i < (await tabs.count()); i++) {
|
|
||||||
await tabs.nth(i).click();
|
|
||||||
await check(`${domain} tab ${i + 1}`);
|
|
||||||
}
|
|
||||||
// the record of the risk list's first patient
|
|
||||||
await tabs.nth(2).click();
|
|
||||||
await loaded(page);
|
|
||||||
const first = page.locator('table a[href*="/pacientes/"]').first();
|
|
||||||
if (await first.count()) {
|
|
||||||
await first.click();
|
|
||||||
await check(`${domain} record`);
|
|
||||||
}
|
|
||||||
await page.goto(`/gobernanza/${domain}`);
|
|
||||||
await check(`${domain} gobernanza`);
|
|
||||||
}
|
|
||||||
await page.goto('/conectar');
|
|
||||||
await check('conectar');
|
|
||||||
// a pipeline open, a node chosen, in both of its panel's tabs
|
|
||||||
await page.locator('.pipelines [mat-list-item]').first().click();
|
|
||||||
await page.locator('.node-caption').first().dispatchEvent('click'); // the canvas may draw it off-screen
|
|
||||||
await check('conectar node');
|
|
||||||
await page.getByRole('tab', { name: 'Avanzado' }).click();
|
|
||||||
await check('conectar node, advanced');
|
|
||||||
await page.goto('/revision');
|
|
||||||
const tabs = page.locator('.mdc-tab');
|
|
||||||
for (let i = 0; i < (await tabs.count()); i++) {
|
|
||||||
await tabs.nth(i).click();
|
|
||||||
await check(`revision tab ${i + 1}`);
|
|
||||||
}
|
|
||||||
expect(found).toEqual([]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
import { expect, test } from '@playwright/test';
|
||||||
|
import { watch } from './support';
|
||||||
|
|
||||||
|
const besidesAuthProbes = (problems: string[]) =>
|
||||||
|
problems.filter(
|
||||||
|
(p) =>
|
||||||
|
!p.includes('/api/auth/') &&
|
||||||
|
!p.includes('/api/users/me') &&
|
||||||
|
!p.startsWith('console: Failed to load resource'),
|
||||||
|
);
|
||||||
|
|
||||||
|
test('sign-in: the guard asks first, and the form lands on the requested page', async ({
|
||||||
|
page,
|
||||||
|
}) => {
|
||||||
|
const problems = watch(page);
|
||||||
|
await page.goto('/indicadores/tea');
|
||||||
|
await expect(page).toHaveURL(/\/login\?next=%2Findicadores%2Ftea$/);
|
||||||
|
await expect(page.getByRole('heading', { name: 'Inicio de sesión' })).toBeVisible();
|
||||||
|
await page.getByLabel('Usuario', { exact: true }).fill('admin@isssteleon.mx');
|
||||||
|
await page.getByLabel('Contraseña', { exact: true }).fill('solo-para-pruebas');
|
||||||
|
await page.getByRole('button', { name: 'Ingresar', exact: true }).click();
|
||||||
|
await expect(page).toHaveURL(/\/indicadores\/tea$/);
|
||||||
|
await expect(page.getByRole('tab', { name: 'Resumen' })).toBeVisible();
|
||||||
|
expect(besidesAuthProbes(problems)).toEqual([]);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('sign-in: a wrong password shows the error and stays', async ({ page }) => {
|
||||||
|
const problems = watch(page);
|
||||||
|
await page.goto('/login');
|
||||||
|
await page.getByLabel('Usuario', { exact: true }).fill('admin@isssteleon.mx');
|
||||||
|
await page.getByLabel('Contraseña', { exact: true }).fill('solo-para-pruebas-pero-mal');
|
||||||
|
await page.getByRole('button', { name: 'Ingresar', exact: true }).click();
|
||||||
|
await expect(page.getByRole('alert')).toHaveText('Usuario o contraseña incorrectos.');
|
||||||
|
await expect(page).toHaveURL(/\/login$/);
|
||||||
|
expect(besidesAuthProbes(problems)).toEqual([]);
|
||||||
|
});
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
import type { Page } from '@playwright/test';
|
|
||||||
|
|
||||||
/** SIMULATED answers. The pages read the API's aggregated MeasureReports; these helpers pass them
|
|
||||||
* through the browser and rewrite the screening-round strata, so the cards can be tried with the
|
|
||||||
* groups the contract of `rebuild` allows (stratum `round`, crossed `round-category`) without
|
|
||||||
* loading data. They prove how the page draws such answers, not what the backend computes.
|
|
||||||
*
|
|
||||||
* - `as-is`: the answers untouched, with a stratum named `screening_round` renamed `round`.
|
|
||||||
* - `no-initial`: nobody is in the initial group (the group is absent and the totals drop).
|
|
||||||
* - `unclassified`: the initial group folds into "Sin dato" (what 5740's answers look like).
|
|
||||||
* - `unpublished`: the round strata are not in the answers. */
|
|
||||||
export type Simulation = 'as-is' | 'no-initial' | 'unclassified' | 'unpublished';
|
|
||||||
|
|
||||||
type Stratum = {
|
|
||||||
value?: { text?: string };
|
|
||||||
component?: { value?: { text?: string } }[];
|
|
||||||
population?: { code?: { coding?: { code?: string }[] }; count: number }[];
|
|
||||||
};
|
|
||||||
type Stratifier = { code?: { coding?: { code?: string }[] }[]; stratum?: Stratum[] };
|
|
||||||
|
|
||||||
const named = (s: Stratifier) => (s.code ?? []).map((c) => c.coding?.[0]?.code).join('-');
|
|
||||||
const label = (x: Stratum) => x.component?.[0]?.value?.text ?? x.value?.text;
|
|
||||||
const pop = (o: { population?: Stratum['population'] }, code: string) =>
|
|
||||||
o.population?.find((p) => p.code?.coding?.[0]?.code === code);
|
|
||||||
|
|
||||||
function fold(into: Stratum, from: Stratum) {
|
|
||||||
for (const p of from.population ?? []) {
|
|
||||||
const q = pop(into, p.code!.coding![0].code!);
|
|
||||||
if (q) q.count += p.count;
|
|
||||||
else (into.population ??= []).push(structuredClone(p));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function simulate(report: any, how: Simulation) {
|
|
||||||
const group = report?.group?.[0];
|
|
||||||
if (!group) return report;
|
|
||||||
for (const s of group.stratifier ?? ([] as Stratifier[]))
|
|
||||||
for (const c of s.code ?? []) {
|
|
||||||
const k = c.coding?.[0];
|
|
||||||
if (k?.code === 'screening_round') k.code = 'round';
|
|
||||||
}
|
|
||||||
const rounds: Stratifier[] = (group.stratifier ?? []).filter((s: Stratifier) =>
|
|
||||||
['round', 'round-category'].includes(named(s)),
|
|
||||||
);
|
|
||||||
if (how === 'unpublished')
|
|
||||||
group.stratifier = (group.stratifier ?? []).filter((s: Stratifier) => !rounds.includes(s));
|
|
||||||
if (how === 'no-initial' || how === 'unclassified')
|
|
||||||
for (const s of rounds) {
|
|
||||||
const initial = (s.stratum ?? []).filter((x) => label(x) === 'initial');
|
|
||||||
const rest = (s.stratum ?? []).filter((x) => label(x) !== 'initial');
|
|
||||||
for (const x of initial) {
|
|
||||||
if (how === 'unclassified') {
|
|
||||||
const other = x.component?.[1]?.value?.text;
|
|
||||||
const target = rest.find(
|
|
||||||
(y) => label(y) === 'no_data' && (!other || y.component?.[1]?.value?.text === other),
|
|
||||||
);
|
|
||||||
if (target) fold(target, x);
|
|
||||||
else {
|
|
||||||
(x.component ? x.component[0].value! : x.value!).text = 'no_data';
|
|
||||||
rest.push(x);
|
|
||||||
}
|
|
||||||
} else if (named(s) === 'round') {
|
|
||||||
// the group vanishes and the period's total drops by its patients: a real zero
|
|
||||||
for (const p of x.population ?? []) {
|
|
||||||
const total = pop(group, p.code!.coding![0].code!);
|
|
||||||
if (total && p.code!.coding![0].code !== 'numerator')
|
|
||||||
total.count = Math.max(0, total.count - p.count);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
s.stratum = rest;
|
|
||||||
}
|
|
||||||
return report;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Answers every CaCu MeasureReport search through `simulate`. */
|
|
||||||
export async function simulateRounds(page: Page, how: Simulation) {
|
|
||||||
await page.route('**/api/cacu/fhir/MeasureReport**', async (route) => {
|
|
||||||
const response = await route.fetch();
|
|
||||||
const body = await response.json();
|
|
||||||
for (const entry of body.entry ?? []) simulate(entry.resource, how);
|
|
||||||
await route.fulfill({
|
|
||||||
response,
|
|
||||||
body: JSON.stringify(body),
|
|
||||||
contentType: 'application/fhir+json',
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
import { statSync } from 'node:fs';
|
||||||
|
import { expect, Locator, Page, test as base } from '@playwright/test';
|
||||||
|
|
||||||
|
export const test = base.extend<{ admin: void }>({
|
||||||
|
admin: [
|
||||||
|
async ({ page }, use) => {
|
||||||
|
const signed = await page.request.post('/api/auth/login', {
|
||||||
|
form: { username: 'admin@isssteleon.mx', password: 'solo-para-pruebas' },
|
||||||
|
});
|
||||||
|
expect(signed.status()).toBe(204);
|
||||||
|
await use();
|
||||||
|
},
|
||||||
|
{ auto: true },
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
export function watch(page: Page): string[] {
|
||||||
|
const problems: string[] = [];
|
||||||
|
page.on('console', (m) => m.type() === 'error' && problems.push(`console: ${m.text()}`));
|
||||||
|
page.on('response', (r) => r.status() >= 400 && problems.push(`${r.status()} ${r.url()}`));
|
||||||
|
page.on('pageerror', (e) => problems.push(`page: ${e.message}`));
|
||||||
|
return problems;
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function downloaded(
|
||||||
|
page: Page,
|
||||||
|
button: Locator,
|
||||||
|
kind: 'pdf' | 'xlsx',
|
||||||
|
): Promise<string> {
|
||||||
|
const [file] = await Promise.all([page.waitForEvent('download'), button.click()]);
|
||||||
|
const name = file.suggestedFilename();
|
||||||
|
expect(name).toMatch(new RegExp(`^tea-[a-z]+-\\d{4}-\\d{2}-\\d{2}\\.${kind}$`));
|
||||||
|
expect(name).not.toMatch(/N-?\d{4}/);
|
||||||
|
expect(statSync(await file.path()).size).toBeGreaterThan(0);
|
||||||
|
return name;
|
||||||
|
}
|
||||||
+2390
-661
File diff suppressed because it is too large
Load Diff
Generated
+2116
-263
File diff suppressed because it is too large
Load Diff
+3
-5
@@ -2,10 +2,8 @@
|
|||||||
"name": "webapp",
|
"name": "webapp",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
|
||||||
"start": "ng serve --proxy-config proxy.conf.json",
|
"start": "ng serve --proxy-config proxy.conf.json",
|
||||||
"build": "ng build",
|
"build": "ng build",
|
||||||
"watch": "ng build --watch --configuration development",
|
|
||||||
"test": "ng test",
|
"test": "ng test",
|
||||||
"api": "ng-openapi-gen -c ng-openapi-gen.json"
|
"api": "ng-openapi-gen -c ng-openapi-gen.json"
|
||||||
},
|
},
|
||||||
@@ -29,8 +27,8 @@
|
|||||||
"d3-zoom": "3.0.0",
|
"d3-zoom": "3.0.0",
|
||||||
"material-symbols": "0.48.3",
|
"material-symbols": "0.48.3",
|
||||||
"ngx-vflow": "2.7.0",
|
"ngx-vflow": "2.7.0",
|
||||||
"pdfmake": "0.3.14",
|
"pdfmake": "0.3.15",
|
||||||
"plotly.js-cartesian-dist-min": "4.1.2",
|
"plotly.js": "4.1.2",
|
||||||
"rxjs": "~7.8.0",
|
"rxjs": "~7.8.0",
|
||||||
"tslib": "^2.3.0",
|
"tslib": "^2.3.0",
|
||||||
"write-excel-file": "4.1.1"
|
"write-excel-file": "4.1.1"
|
||||||
@@ -44,7 +42,7 @@
|
|||||||
"@types/d3-selection": "3.0.13",
|
"@types/d3-selection": "3.0.13",
|
||||||
"@types/d3-zoom": "3.0.9",
|
"@types/d3-zoom": "3.0.9",
|
||||||
"@types/fhir": "0.0.44",
|
"@types/fhir": "0.0.44",
|
||||||
"@types/pdfmake": "0.3.5",
|
"@types/pdfmake": "0.3.3",
|
||||||
"@types/plotly.js": "3.0.15",
|
"@types/plotly.js": "3.0.15",
|
||||||
"jsdom": "^31.0.0",
|
"jsdom": "^31.0.0",
|
||||||
"ng-openapi-gen": "^1.1.0",
|
"ng-openapi-gen": "^1.1.0",
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
import { defineConfig } from '@playwright/test';
|
import { defineConfig } from '@playwright/test';
|
||||||
|
|
||||||
/** The pages against a running API (API_URL), served by the dev server with the same
|
|
||||||
* proxy the app uses in production (`/api`). Run by WebApi/tests/test_webapp.py, which
|
|
||||||
* starts the platform and loads the synthetic hospital first. */
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
testDir: 'e2e',
|
testDir: 'e2e',
|
||||||
timeout: 15 * 60_000,
|
timeout: 15 * 60_000,
|
||||||
@@ -12,10 +9,9 @@ export default defineConfig({
|
|||||||
use: {
|
use: {
|
||||||
baseURL: 'http://127.0.0.1:4310',
|
baseURL: 'http://127.0.0.1:4310',
|
||||||
viewport: { width: 1440, height: 1000 },
|
viewport: { width: 1440, height: 1000 },
|
||||||
actionTimeout: 60_000, // a stuck step fails, not the whole run
|
actionTimeout: 60_000,
|
||||||
},
|
},
|
||||||
webServer: {
|
webServer: {
|
||||||
// IPv4 explicitly: `localhost` may resolve to ::1 only (CI containers), where the url below never answers.
|
|
||||||
command: 'npx ng serve --host 127.0.0.1 --port 4310 --proxy-config proxy.e2e.mjs',
|
command: 'npx ng serve --host 127.0.0.1 --port 4310 --proxy-config proxy.e2e.mjs',
|
||||||
env: { NG_CLI_ANALYTICS: 'false' },
|
env: { NG_CLI_ANALYTICS: 'false' },
|
||||||
url: 'http://127.0.0.1:4310',
|
url: 'http://127.0.0.1:4310',
|
||||||
|
|||||||
@@ -1,2 +1 @@
|
|||||||
// `/api` to the API the e2e run started (API_URL).
|
|
||||||
export default { '/api': { target: process.env.API_URL, pathRewrite: { '^/api': '' } } };
|
export default { '/api': { target: process.env.API_URL, pathRewrite: { '^/api': '' } } };
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
// This file was generated by running 'ng generate @angular/material:theme-color'.
|
|
||||||
// Proceed with caution if making changes to this file.
|
|
||||||
|
|
||||||
@use 'sass:map';
|
@use 'sass:map';
|
||||||
@use '@angular/material' as mat;
|
@use '@angular/material' as mat;
|
||||||
|
|
||||||
// Note: Color palettes are generated from primary: #a8c243, tertiary: #5f9ea0
|
|
||||||
$_palettes: (
|
$_palettes: (
|
||||||
primary: (
|
primary: (
|
||||||
0: #000000,
|
0: #000000,
|
||||||
|
|||||||
@@ -0,0 +1,100 @@
|
|||||||
|
import type { Observation, ObservationComponent } from 'fhir/r4';
|
||||||
|
import { describe, expect, it } from 'vitest';
|
||||||
|
import { ados2Component, ados2Groups } from './ados2';
|
||||||
|
import { EXT } from './fhir';
|
||||||
|
|
||||||
|
function item(
|
||||||
|
field: string,
|
||||||
|
domain: string,
|
||||||
|
subdomain: string,
|
||||||
|
code: string,
|
||||||
|
title: string,
|
||||||
|
value?: number,
|
||||||
|
): ObservationComponent {
|
||||||
|
return {
|
||||||
|
code: {
|
||||||
|
coding: [{ code: `ados2.${field}` }, { code, display: title }],
|
||||||
|
text: title,
|
||||||
|
},
|
||||||
|
extension: [
|
||||||
|
{ url: EXT + 'ados2-domain', valueCoding: { code: domain[0], display: domain } },
|
||||||
|
{ url: EXT + 'ados2-subdomain', valueCoding: { code: subdomain, display: subdomain } },
|
||||||
|
],
|
||||||
|
valueQuantity: value == null ? undefined : { value },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const AS = 'Afectación social (AS)';
|
||||||
|
const CRR = 'Comportamiento restringido y repetitivo (CRR)';
|
||||||
|
|
||||||
|
const observation: Observation = {
|
||||||
|
resourceType: 'Observation',
|
||||||
|
status: 'final',
|
||||||
|
code: { coding: [{ code: 'ados2' }] },
|
||||||
|
component: [
|
||||||
|
{ code: { coding: [{ code: 'ados2.module' }] }, valueCodeableConcept: { text: 'Módulo 1' } },
|
||||||
|
item('pointing', AS, 'Comunicación', 'A-7', 'Señalar', 2),
|
||||||
|
item('gestures', AS, 'Comunicación', 'A-8', 'Gestos', 1),
|
||||||
|
item(
|
||||||
|
'unusual_eye_contact',
|
||||||
|
AS,
|
||||||
|
'Interacción social recíproca',
|
||||||
|
'B-1',
|
||||||
|
'Contacto visual inusual',
|
||||||
|
),
|
||||||
|
item(
|
||||||
|
'intonation',
|
||||||
|
CRR,
|
||||||
|
'Comportamientos restringidos y repetitivos',
|
||||||
|
'A-3',
|
||||||
|
'Entonación de las vocalizaciones o verbalizaciones',
|
||||||
|
3,
|
||||||
|
),
|
||||||
|
{ code: { coding: [{ code: 'ados2.response_to_name' }] } },
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
describe('Ítems del ADOS-2', () => {
|
||||||
|
it('agrupa los ítems del módulo por dominio y subdominio en su orden', () => {
|
||||||
|
expect(ados2Groups(observation)).toEqual([
|
||||||
|
{
|
||||||
|
domain: AS,
|
||||||
|
subdomains: [
|
||||||
|
{
|
||||||
|
subdomain: 'Comunicación',
|
||||||
|
items: [
|
||||||
|
{ code: 'A-7', title: 'Señalar', score: 2 },
|
||||||
|
{ code: 'A-8', title: 'Gestos', score: 1 },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
subdomain: 'Interacción social recíproca',
|
||||||
|
items: [{ code: 'B-1', title: 'Contacto visual inusual', score: undefined }],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
domain: CRR,
|
||||||
|
subdomains: [
|
||||||
|
{
|
||||||
|
subdomain: 'Comportamientos restringidos y repetitivos',
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
code: 'A-3',
|
||||||
|
title: 'Entonación de las vocalizaciones o verbalizaciones',
|
||||||
|
score: 3,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
expect(ados2Groups(undefined)).toEqual([]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('encuentra el ítem de una asociación por su número', () => {
|
||||||
|
expect(ados2Component(observation, 2)?.code.text).toBe('Señalar');
|
||||||
|
expect(ados2Component(observation, 8)?.code.coding?.[0].code).toBe('ados2.response_to_name');
|
||||||
|
expect(ados2Component(observation, 0)).toBeUndefined();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
import type { Observation, ObservationComponent } from 'fhir/r4';
|
||||||
|
import { code, ext } from './fhir';
|
||||||
|
|
||||||
|
const ADOS2_ITEMS = [
|
||||||
|
'vocalization_directed',
|
||||||
|
'pointing',
|
||||||
|
'gestures',
|
||||||
|
'unusual_eye_contact',
|
||||||
|
'facial_expressions',
|
||||||
|
'gaze_integration',
|
||||||
|
'shared_enjoyment',
|
||||||
|
'response_to_name',
|
||||||
|
'ignoring',
|
||||||
|
'requesting',
|
||||||
|
'showing',
|
||||||
|
'joint_attention_initiation',
|
||||||
|
'joint_attention_response',
|
||||||
|
'social_overtures_quality',
|
||||||
|
'social_overtures_caregiver',
|
||||||
|
'reciprocal_communication',
|
||||||
|
'rapport_quality',
|
||||||
|
'intonation',
|
||||||
|
'stereotyped_language',
|
||||||
|
'unusual_sensory_interest',
|
||||||
|
'hand_finger_mannerisms',
|
||||||
|
'repetitive_interests',
|
||||||
|
];
|
||||||
|
|
||||||
|
interface Ados2Item {
|
||||||
|
code: string;
|
||||||
|
title: string;
|
||||||
|
score?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Ados2Subdomain {
|
||||||
|
subdomain: string;
|
||||||
|
items: Ados2Item[];
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Ados2Domain {
|
||||||
|
domain: string;
|
||||||
|
subdomains: Ados2Subdomain[];
|
||||||
|
}
|
||||||
|
|
||||||
|
function coded(component: ObservationComponent, name: string): string {
|
||||||
|
const coding = ext(component, name)?.valueCoding;
|
||||||
|
return coding?.display ?? coding?.code ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ados2Groups(observation: Observation | undefined): Ados2Domain[] {
|
||||||
|
const groups: Ados2Domain[] = [];
|
||||||
|
for (const component of observation?.component ?? []) {
|
||||||
|
const item = component.code.coding?.[1];
|
||||||
|
if (!ext(component, 'ados2-domain') || !item?.code) continue;
|
||||||
|
const domain = coded(component, 'ados2-domain');
|
||||||
|
const subdomain = coded(component, 'ados2-subdomain');
|
||||||
|
let group = groups.at(-1);
|
||||||
|
if (!group || group.domain !== domain) {
|
||||||
|
group = { domain, subdomains: [] };
|
||||||
|
groups.push(group);
|
||||||
|
}
|
||||||
|
let sub = group.subdomains.at(-1);
|
||||||
|
if (!sub || sub.subdomain !== subdomain) {
|
||||||
|
sub = { subdomain, items: [] };
|
||||||
|
group.subdomains.push(sub);
|
||||||
|
}
|
||||||
|
sub.items.push({
|
||||||
|
code: item.code,
|
||||||
|
title: component.code.text ?? item.display ?? item.code,
|
||||||
|
score: component.valueQuantity?.value,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return groups;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ados2Component(
|
||||||
|
observation: Observation | undefined,
|
||||||
|
number: number,
|
||||||
|
): ObservationComponent | undefined {
|
||||||
|
const field = ADOS2_ITEMS[number - 1];
|
||||||
|
return observation?.component?.find((c) => field && code(c.code) === `ados2.${field}`);
|
||||||
|
}
|
||||||
@@ -3,9 +3,6 @@
|
|||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides the ApiConfiguration configuration object with a given root URL.
|
|
||||||
*/
|
|
||||||
export function provideApiConfiguration(rootUrl: string) {
|
export function provideApiConfiguration(rootUrl: string) {
|
||||||
var config = new ApiConfiguration();
|
var config = new ApiConfiguration();
|
||||||
config.rootUrl = rootUrl;
|
config.rootUrl = rootUrl;
|
||||||
@@ -15,9 +12,6 @@ export function provideApiConfiguration(rootUrl: string) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Global configuration
|
|
||||||
*/
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -11,9 +11,6 @@ import { StrictHttpResponse } from './strict-http-response';
|
|||||||
export type ApiFnOptional<P, R> = (http: HttpClient, rootUrl: string, params?: P, context?: HttpContext) => Observable<StrictHttpResponse<R>>;
|
export type ApiFnOptional<P, R> = (http: HttpClient, rootUrl: string, params?: P, context?: HttpContext) => Observable<StrictHttpResponse<R>>;
|
||||||
export type ApiFnRequired<P, R> = (http: HttpClient, rootUrl: string, params: P, context?: HttpContext) => Observable<StrictHttpResponse<R>>;
|
export type ApiFnRequired<P, R> = (http: HttpClient, rootUrl: string, params: P, context?: HttpContext) => Observable<StrictHttpResponse<R>>;
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper service to call API functions directly
|
|
||||||
*/
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class Api {
|
export class Api {
|
||||||
constructor(
|
constructor(
|
||||||
@@ -24,24 +21,14 @@ export class Api {
|
|||||||
|
|
||||||
private _rootUrl?: string;
|
private _rootUrl?: string;
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the root url for API operations. If not set directly here,
|
|
||||||
* will fallback to `ApiConfiguration.rootUrl`.
|
|
||||||
*/
|
|
||||||
get rootUrl(): string {
|
get rootUrl(): string {
|
||||||
return this._rootUrl || this.config.rootUrl;
|
return this._rootUrl || this.config.rootUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the root URL for API operations
|
|
||||||
*/
|
|
||||||
set rootUrl(rootUrl: string) {
|
set rootUrl(rootUrl: string) {
|
||||||
this._rootUrl = rootUrl;
|
this._rootUrl = rootUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Executes an API call, returning the response body only
|
|
||||||
*/
|
|
||||||
invoke<P, R>(fn: ApiFnRequired<P, R>, params: P, context?: HttpContext): Promise<R>;
|
invoke<P, R>(fn: ApiFnRequired<P, R>, params: P, context?: HttpContext): Promise<R>;
|
||||||
invoke<P, R>(fn: ApiFnOptional<P, R>, params?: P, context?: HttpContext): Promise<R>;
|
invoke<P, R>(fn: ApiFnOptional<P, R>, params?: P, context?: HttpContext): Promise<R>;
|
||||||
async invoke<P, R>(fn: ApiFnRequired<P, R> | ApiFnOptional<P, R>, params: P, context?: HttpContext): Promise<R> {
|
async invoke<P, R>(fn: ApiFnRequired<P, R> | ApiFnOptional<P, R>, params: P, context?: HttpContext): Promise<R> {
|
||||||
@@ -49,9 +36,6 @@ export class Api {
|
|||||||
return (await resp).body;
|
return (await resp).body;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Executes an API call, returning the entire response
|
|
||||||
*/
|
|
||||||
invoke$Response<P, R>(fn: ApiFnRequired<P, R>, params: P, context?: HttpContext): Promise<StrictHttpResponse<R>>;
|
invoke$Response<P, R>(fn: ApiFnRequired<P, R>, params: P, context?: HttpContext): Promise<StrictHttpResponse<R>>;
|
||||||
invoke$Response<P, R>(fn: ApiFnOptional<P, R>, params?: P, context?: HttpContext): Promise<StrictHttpResponse<R>>;
|
invoke$Response<P, R>(fn: ApiFnOptional<P, R>, params?: P, context?: HttpContext): Promise<StrictHttpResponse<R>>;
|
||||||
invoke$Response<P, R>(fn: ApiFnRequired<P, R> | ApiFnOptional<P, R>, params: P, context?: HttpContext): Promise<StrictHttpResponse<R>> {
|
invoke$Response<P, R>(fn: ApiFnRequired<P, R> | ApiFnOptional<P, R>, params: P, context?: HttpContext): Promise<StrictHttpResponse<R>> {
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { filter, map } from 'rxjs/operators';
|
||||||
|
import { StrictHttpResponse } from '../../strict-http-response';
|
||||||
|
import { RequestBuilder } from '../../request-builder';
|
||||||
|
|
||||||
|
import { AnalyzeRequest } from '../../models/analyze-request';
|
||||||
|
|
||||||
|
export interface AnalyzeEegs$Params {
|
||||||
|
body: AnalyzeRequest
|
||||||
|
}
|
||||||
|
|
||||||
|
export function analyzeEegs(http: HttpClient, rootUrl: string, params: AnalyzeEegs$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||||
|
[key: string]: string;
|
||||||
|
}>> {
|
||||||
|
const rb = new RequestBuilder(rootUrl, analyzeEegs.PATH, 'post');
|
||||||
|
if (params) {
|
||||||
|
rb.body(params.body, 'application/json');
|
||||||
|
}
|
||||||
|
|
||||||
|
return http.request(
|
||||||
|
rb.build({ responseType: 'json', accept: 'application/json', context })
|
||||||
|
).pipe(
|
||||||
|
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
|
||||||
|
map((r: HttpResponse<any>) => {
|
||||||
|
return r as StrictHttpResponse<{
|
||||||
|
[key: string]: string;
|
||||||
|
}>;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
analyzeEegs.PATH = '/tea/eegs/analyze';
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { filter, map } from 'rxjs/operators';
|
||||||
|
import { StrictHttpResponse } from '../../strict-http-response';
|
||||||
|
import { RequestBuilder } from '../../request-builder';
|
||||||
|
|
||||||
|
|
||||||
|
export interface EegStudiesSummary$Params {
|
||||||
|
}
|
||||||
|
|
||||||
|
export function eegStudiesSummary(http: HttpClient, rootUrl: string, params?: EegStudiesSummary$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||||
|
[key: string]: number;
|
||||||
|
}>> {
|
||||||
|
const rb = new RequestBuilder(rootUrl, eegStudiesSummary.PATH, 'get');
|
||||||
|
if (params) {
|
||||||
|
}
|
||||||
|
|
||||||
|
return http.request(
|
||||||
|
rb.build({ responseType: 'json', accept: 'application/json', context })
|
||||||
|
).pipe(
|
||||||
|
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
|
||||||
|
map((r: HttpResponse<any>) => {
|
||||||
|
return r as StrictHttpResponse<{
|
||||||
|
[key: string]: number;
|
||||||
|
}>;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
eegStudiesSummary.PATH = '/tea/eegs/summary';
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { filter, map } from 'rxjs/operators';
|
||||||
|
import { StrictHttpResponse } from '../../strict-http-response';
|
||||||
|
import { RequestBuilder } from '../../request-builder';
|
||||||
|
|
||||||
|
import { Health } from '../../models/health';
|
||||||
|
|
||||||
|
export interface ExecutionHealth$Params {
|
||||||
|
mode?: ('sync' | 'local' | 'remote' | null);
|
||||||
|
scheduler?: (string | null);
|
||||||
|
reference?: (string | null);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function executionHealth(http: HttpClient, rootUrl: string, params?: ExecutionHealth$Params, context?: HttpContext): Observable<StrictHttpResponse<Health>> {
|
||||||
|
const rb = new RequestBuilder(rootUrl, executionHealth.PATH, 'get');
|
||||||
|
if (params) {
|
||||||
|
rb.query('mode', params.mode, {});
|
||||||
|
rb.query('scheduler', params.scheduler, {});
|
||||||
|
rb.query('reference', params.reference, {});
|
||||||
|
}
|
||||||
|
|
||||||
|
return http.request(
|
||||||
|
rb.build({ responseType: 'json', accept: 'application/json', context })
|
||||||
|
).pipe(
|
||||||
|
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
|
||||||
|
map((r: HttpResponse<any>) => {
|
||||||
|
return r as StrictHttpResponse<Health>;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
executionHealth.PATH = '/execution/health';
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { filter, map } from 'rxjs/operators';
|
||||||
|
import { StrictHttpResponse } from '../../strict-http-response';
|
||||||
|
import { RequestBuilder } from '../../request-builder';
|
||||||
|
|
||||||
|
import { Options } from '../../models/options';
|
||||||
|
|
||||||
|
export interface ExecutionOptions$Params {
|
||||||
|
}
|
||||||
|
|
||||||
|
export function executionOptions(http: HttpClient, rootUrl: string, params?: ExecutionOptions$Params, context?: HttpContext): Observable<StrictHttpResponse<Options>> {
|
||||||
|
const rb = new RequestBuilder(rootUrl, executionOptions.PATH, 'get');
|
||||||
|
if (params) {
|
||||||
|
}
|
||||||
|
|
||||||
|
return http.request(
|
||||||
|
rb.build({ responseType: 'json', accept: 'application/json', context })
|
||||||
|
).pipe(
|
||||||
|
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
|
||||||
|
map((r: HttpResponse<any>) => {
|
||||||
|
return r as StrictHttpResponse<Options>;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
executionOptions.PATH = '/execution/options';
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { filter, map } from 'rxjs/operators';
|
||||||
|
import { StrictHttpResponse } from '../../strict-http-response';
|
||||||
|
import { RequestBuilder } from '../../request-builder';
|
||||||
|
|
||||||
|
import { Domain } from '../../models/domain';
|
||||||
|
|
||||||
|
export interface EegSummary$Params {
|
||||||
|
domain: Domain;
|
||||||
|
|
||||||
|
'follow-up-window'?: (number | null);
|
||||||
|
|
||||||
|
'follow-up-start'?: (string | null);
|
||||||
|
|
||||||
|
'follow-up-cutoff'?: (string | null);
|
||||||
|
'follow-up-status'?: (string | null);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function eegSummary(http: HttpClient, rootUrl: string, params: EegSummary$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||||
|
}>> {
|
||||||
|
const rb = new RequestBuilder(rootUrl, eegSummary.PATH, 'get');
|
||||||
|
if (params) {
|
||||||
|
rb.path('domain', params.domain, {});
|
||||||
|
rb.query('follow-up-window', params['follow-up-window'], {});
|
||||||
|
rb.query('follow-up-start', params['follow-up-start'], {});
|
||||||
|
rb.query('follow-up-cutoff', params['follow-up-cutoff'], {});
|
||||||
|
rb.query('follow-up-status', params['follow-up-status'], {});
|
||||||
|
}
|
||||||
|
|
||||||
|
return http.request(
|
||||||
|
rb.build({ responseType: 'json', accept: 'application/fhir+json', context })
|
||||||
|
).pipe(
|
||||||
|
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
|
||||||
|
map((r: HttpResponse<any>) => {
|
||||||
|
return r as StrictHttpResponse<{
|
||||||
|
}>;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
eegSummary.PATH = '/{domain}/fhir/Patient/$eeg-summary';
|
||||||
@@ -12,9 +12,6 @@ import { Domain } from '../../models/domain';
|
|||||||
export interface PostBundle$Params {
|
export interface PostBundle$Params {
|
||||||
domain: Domain;
|
domain: Domain;
|
||||||
|
|
||||||
/**
|
|
||||||
* the sender's pipeline (its fhir nodes read this inbox)
|
|
||||||
*/
|
|
||||||
sender: string;
|
sender: string;
|
||||||
body: {
|
body: {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
|
|||||||
@@ -12,9 +12,6 @@ import { Domain } from '../../models/domain';
|
|||||||
export interface SearchCondition$Params {
|
export interface SearchCondition$Params {
|
||||||
domain: Domain;
|
domain: Domain;
|
||||||
|
|
||||||
/**
|
|
||||||
* Patient/<id>, comma-separated
|
|
||||||
*/
|
|
||||||
subject?: (string | null);
|
subject?: (string | null);
|
||||||
'_count'?: (number | null);
|
'_count'?: (number | null);
|
||||||
'_offset'?: number;
|
'_offset'?: number;
|
||||||
|
|||||||
@@ -12,9 +12,6 @@ import { Domain } from '../../models/domain';
|
|||||||
export interface SearchDiagnosticReport$Params {
|
export interface SearchDiagnosticReport$Params {
|
||||||
domain: Domain;
|
domain: Domain;
|
||||||
|
|
||||||
/**
|
|
||||||
* Patient/<id>, comma-separated
|
|
||||||
*/
|
|
||||||
subject?: (string | null);
|
subject?: (string | null);
|
||||||
'_count'?: (number | null);
|
'_count'?: (number | null);
|
||||||
'_offset'?: number;
|
'_offset'?: number;
|
||||||
|
|||||||
@@ -12,9 +12,6 @@ import { Domain } from '../../models/domain';
|
|||||||
export interface SearchEncounter$Params {
|
export interface SearchEncounter$Params {
|
||||||
domain: Domain;
|
domain: Domain;
|
||||||
|
|
||||||
/**
|
|
||||||
* Patient/<id>, comma-separated
|
|
||||||
*/
|
|
||||||
subject?: (string | null);
|
subject?: (string | null);
|
||||||
'_count'?: (number | null);
|
'_count'?: (number | null);
|
||||||
'_offset'?: number;
|
'_offset'?: number;
|
||||||
|
|||||||
@@ -12,24 +12,12 @@ import { Domain } from '../../models/domain';
|
|||||||
export interface SearchMeasureReport$Params {
|
export interface SearchMeasureReport$Params {
|
||||||
domain: Domain;
|
domain: Domain;
|
||||||
|
|
||||||
/**
|
|
||||||
* the Measure's id or canonical URL
|
|
||||||
*/
|
|
||||||
measure: string;
|
measure: string;
|
||||||
|
|
||||||
/**
|
|
||||||
* semesters (2025-S1) or months (2025-03), comma-separated
|
|
||||||
*/
|
|
||||||
'reporting-period': string;
|
'reporting-period': string;
|
||||||
|
|
||||||
/**
|
|
||||||
* count only what was known by then
|
|
||||||
*/
|
|
||||||
'as-of'?: (string | null);
|
'as-of'?: (string | null);
|
||||||
|
|
||||||
/**
|
|
||||||
* durations count to this day
|
|
||||||
*/
|
|
||||||
'event-cutoff'?: (string | null);
|
'event-cutoff'?: (string | null);
|
||||||
'_count'?: (number | null);
|
'_count'?: (number | null);
|
||||||
'_offset'?: number;
|
'_offset'?: number;
|
||||||
|
|||||||
@@ -12,9 +12,6 @@ import { Domain } from '../../models/domain';
|
|||||||
export interface SearchObservation$Params {
|
export interface SearchObservation$Params {
|
||||||
domain: Domain;
|
domain: Domain;
|
||||||
|
|
||||||
/**
|
|
||||||
* Patient/<id>, comma-separated
|
|
||||||
*/
|
|
||||||
subject?: (string | null);
|
subject?: (string | null);
|
||||||
'_count'?: (number | null);
|
'_count'?: (number | null);
|
||||||
'_offset'?: number;
|
'_offset'?: number;
|
||||||
|
|||||||
@@ -13,50 +13,23 @@ export interface SearchPatient$Params {
|
|||||||
domain: Domain;
|
domain: Domain;
|
||||||
'_id'?: (string | null);
|
'_id'?: (string | null);
|
||||||
|
|
||||||
/**
|
|
||||||
* months: the domain's follow-up list over that window up to the cut-off
|
|
||||||
*/
|
|
||||||
'follow-up-window'?: (number | null);
|
'follow-up-window'?: (number | null);
|
||||||
|
|
||||||
/**
|
'follow-up-start'?: (string | null);
|
||||||
* default: the last day with data
|
|
||||||
*/
|
|
||||||
'follow-up-cutoff'?: (string | null);
|
'follow-up-cutoff'?: (string | null);
|
||||||
'follow-up-status'?: (string | null);
|
'follow-up-status'?: (string | null);
|
||||||
|
|
||||||
/**
|
|
||||||
* each word starts a word of her name (case and accents ignored)
|
|
||||||
*/
|
|
||||||
name?: (string | null);
|
name?: (string | null);
|
||||||
|
|
||||||
/**
|
|
||||||
* [system|]value: a CURP or record number (case ignored)
|
|
||||||
*/
|
|
||||||
identifier?: (string | null);
|
identifier?: (string | null);
|
||||||
|
|
||||||
/**
|
|
||||||
* gt, ge, lt or le and a day (2000-12-31)
|
|
||||||
*/
|
|
||||||
birthdate?: Array<string>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* -recent or -risk-<outcome>
|
|
||||||
*/
|
|
||||||
'_sort'?: string;
|
'_sort'?: string;
|
||||||
|
|
||||||
/**
|
|
||||||
* years
|
|
||||||
*/
|
|
||||||
'risk-horizon'?: (number | null);
|
'risk-horizon'?: (number | null);
|
||||||
|
|
||||||
/**
|
|
||||||
* any of ('DiagnosticReport:subject', 'RiskAssessment:subject', 'Observation:subject')
|
|
||||||
*/
|
|
||||||
'_revinclude'?: Array<string>;
|
'_revinclude'?: Array<string>;
|
||||||
|
|
||||||
/**
|
|
||||||
* DiagnosticReport:result
|
|
||||||
*/
|
|
||||||
'_include:iterate'?: Array<string>;
|
'_include:iterate'?: Array<string>;
|
||||||
'_count'?: (number | null);
|
'_count'?: (number | null);
|
||||||
'_offset'?: number;
|
'_offset'?: number;
|
||||||
@@ -69,11 +42,11 @@ export function searchPatient(http: HttpClient, rootUrl: string, params: SearchP
|
|||||||
rb.path('domain', params.domain, {});
|
rb.path('domain', params.domain, {});
|
||||||
rb.query('_id', params['_id'], {});
|
rb.query('_id', params['_id'], {});
|
||||||
rb.query('follow-up-window', params['follow-up-window'], {});
|
rb.query('follow-up-window', params['follow-up-window'], {});
|
||||||
|
rb.query('follow-up-start', params['follow-up-start'], {});
|
||||||
rb.query('follow-up-cutoff', params['follow-up-cutoff'], {});
|
rb.query('follow-up-cutoff', params['follow-up-cutoff'], {});
|
||||||
rb.query('follow-up-status', params['follow-up-status'], {});
|
rb.query('follow-up-status', params['follow-up-status'], {});
|
||||||
rb.query('name', params.name, {});
|
rb.query('name', params.name, {});
|
||||||
rb.query('identifier', params.identifier, {});
|
rb.query('identifier', params.identifier, {});
|
||||||
rb.query('birthdate', params.birthdate, {});
|
|
||||||
rb.query('_sort', params['_sort'], {});
|
rb.query('_sort', params['_sort'], {});
|
||||||
rb.query('risk-horizon', params['risk-horizon'], {});
|
rb.query('risk-horizon', params['risk-horizon'], {});
|
||||||
rb.query('_revinclude', params['_revinclude'], {});
|
rb.query('_revinclude', params['_revinclude'], {});
|
||||||
|
|||||||
@@ -12,9 +12,6 @@ import { Domain } from '../../models/domain';
|
|||||||
export interface SearchProcedure$Params {
|
export interface SearchProcedure$Params {
|
||||||
domain: Domain;
|
domain: Domain;
|
||||||
|
|
||||||
/**
|
|
||||||
* Patient/<id>, comma-separated
|
|
||||||
*/
|
|
||||||
subject?: (string | null);
|
subject?: (string | null);
|
||||||
'_count'?: (number | null);
|
'_count'?: (number | null);
|
||||||
'_offset'?: number;
|
'_offset'?: number;
|
||||||
|
|||||||
@@ -12,9 +12,6 @@ import { Domain } from '../../models/domain';
|
|||||||
export interface SearchRiskAssessment$Params {
|
export interface SearchRiskAssessment$Params {
|
||||||
domain: Domain;
|
domain: Domain;
|
||||||
|
|
||||||
/**
|
|
||||||
* Patient/<id>, comma-separated
|
|
||||||
*/
|
|
||||||
subject?: (string | null);
|
subject?: (string | null);
|
||||||
'_count'?: (number | null);
|
'_count'?: (number | null);
|
||||||
'_offset'?: number;
|
'_offset'?: number;
|
||||||
|
|||||||
@@ -7,10 +7,12 @@ import { filter, map } from 'rxjs/operators';
|
|||||||
import { StrictHttpResponse } from '../../strict-http-response';
|
import { StrictHttpResponse } from '../../strict-http-response';
|
||||||
import { RequestBuilder } from '../../request-builder';
|
import { RequestBuilder } from '../../request-builder';
|
||||||
|
|
||||||
|
import { Analyze } from '../../models/analyze';
|
||||||
import { Domain } from '../../models/domain';
|
import { Domain } from '../../models/domain';
|
||||||
|
|
||||||
export interface Analyze$Params {
|
export interface Analyze$Params {
|
||||||
domain: Domain;
|
domain: Domain;
|
||||||
|
body?: Analyze
|
||||||
}
|
}
|
||||||
|
|
||||||
export function analyze(http: HttpClient, rootUrl: string, params: Analyze$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
export function analyze(http: HttpClient, rootUrl: string, params: Analyze$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||||
@@ -19,6 +21,7 @@ export function analyze(http: HttpClient, rootUrl: string, params: Analyze$Param
|
|||||||
const rb = new RequestBuilder(rootUrl, analyze.PATH, 'post');
|
const rb = new RequestBuilder(rootUrl, analyze.PATH, 'post');
|
||||||
if (params) {
|
if (params) {
|
||||||
rb.path('domain', params.domain, {});
|
rb.path('domain', params.domain, {});
|
||||||
|
rb.body(params.body, 'application/json');
|
||||||
}
|
}
|
||||||
|
|
||||||
return http.request(
|
return http.request(
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { filter, map } from 'rxjs/operators';
|
||||||
|
import { StrictHttpResponse } from '../../strict-http-response';
|
||||||
|
import { RequestBuilder } from '../../request-builder';
|
||||||
|
|
||||||
|
import { Domain } from '../../models/domain';
|
||||||
|
|
||||||
|
export interface Curve$Params {
|
||||||
|
domain: Domain;
|
||||||
|
name: string;
|
||||||
|
version: number;
|
||||||
|
feature?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function curve(http: HttpClient, rootUrl: string, params: Curve$Params, context?: HttpContext): Observable<StrictHttpResponse<Array<{
|
||||||
|
[key: string]: any;
|
||||||
|
}>>> {
|
||||||
|
const rb = new RequestBuilder(rootUrl, curve.PATH, 'get');
|
||||||
|
if (params) {
|
||||||
|
rb.path('domain', params.domain, {});
|
||||||
|
rb.path('name', params.name, {});
|
||||||
|
rb.path('version', params.version, {});
|
||||||
|
rb.query('feature', params.feature, {});
|
||||||
|
}
|
||||||
|
|
||||||
|
return http.request(
|
||||||
|
rb.build({ responseType: 'json', accept: 'application/json', context })
|
||||||
|
).pipe(
|
||||||
|
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
|
||||||
|
map((r: HttpResponse<any>) => {
|
||||||
|
return r as StrictHttpResponse<Array<{
|
||||||
|
[key: string]: any;
|
||||||
|
}>>;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
curve.PATH = '/models/{domain}/{name}/versions/{version}/curve';
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { filter, map } from 'rxjs/operators';
|
||||||
|
import { StrictHttpResponse } from '../../strict-http-response';
|
||||||
|
import { RequestBuilder } from '../../request-builder';
|
||||||
|
|
||||||
|
import { Domain } from '../../models/domain';
|
||||||
|
|
||||||
|
export interface ExportModels$Params {
|
||||||
|
domain: Domain;
|
||||||
|
names?: (Array<string> | null);
|
||||||
|
versions?: 'champion' | 'latest' | 'all';
|
||||||
|
}
|
||||||
|
|
||||||
|
export function exportModels(http: HttpClient, rootUrl: string, params: ExportModels$Params, context?: HttpContext): Observable<StrictHttpResponse<any>> {
|
||||||
|
const rb = new RequestBuilder(rootUrl, exportModels.PATH, 'get');
|
||||||
|
if (params) {
|
||||||
|
rb.path('domain', params.domain, {});
|
||||||
|
rb.query('names', params.names, {});
|
||||||
|
rb.query('versions', params.versions, {});
|
||||||
|
}
|
||||||
|
|
||||||
|
return http.request(
|
||||||
|
rb.build({ responseType: 'blob', accept: 'application/zip', context })
|
||||||
|
).pipe(
|
||||||
|
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
|
||||||
|
map((r: HttpResponse<any>) => {
|
||||||
|
return r as StrictHttpResponse<any>;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
exportModels.PATH = '/models/{domain}/export';
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { filter, map } from 'rxjs/operators';
|
||||||
|
import { StrictHttpResponse } from '../../strict-http-response';
|
||||||
|
import { RequestBuilder } from '../../request-builder';
|
||||||
|
|
||||||
|
import { BodyImportModels } from '../../models/body-import-models';
|
||||||
|
import { Domain } from '../../models/domain';
|
||||||
|
|
||||||
|
export interface ImportModels$Params {
|
||||||
|
domain: Domain;
|
||||||
|
sha256: string;
|
||||||
|
body: BodyImportModels
|
||||||
|
}
|
||||||
|
|
||||||
|
export function importModels(http: HttpClient, rootUrl: string, params: ImportModels$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||||
|
[key: string]: string;
|
||||||
|
}>> {
|
||||||
|
const rb = new RequestBuilder(rootUrl, importModels.PATH, 'post');
|
||||||
|
if (params) {
|
||||||
|
rb.path('domain', params.domain, {});
|
||||||
|
rb.query('sha256', params.sha256, {});
|
||||||
|
rb.body(params.body, 'multipart/form-data');
|
||||||
|
}
|
||||||
|
|
||||||
|
return http.request(
|
||||||
|
rb.build({ responseType: 'json', accept: 'application/json', context })
|
||||||
|
).pipe(
|
||||||
|
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
|
||||||
|
map((r: HttpResponse<any>) => {
|
||||||
|
return r as StrictHttpResponse<{
|
||||||
|
[key: string]: string;
|
||||||
|
}>;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
importModels.PATH = '/models/{domain}/import';
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { filter, map } from 'rxjs/operators';
|
||||||
|
import { StrictHttpResponse } from '../../strict-http-response';
|
||||||
|
import { RequestBuilder } from '../../request-builder';
|
||||||
|
|
||||||
|
import { Domain } from '../../models/domain';
|
||||||
|
|
||||||
|
export interface Lineage$Params {
|
||||||
|
domain: Domain;
|
||||||
|
name: string;
|
||||||
|
version: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function lineage(http: HttpClient, rootUrl: string, params: Lineage$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||||
|
[key: string]: any;
|
||||||
|
}>> {
|
||||||
|
const rb = new RequestBuilder(rootUrl, lineage.PATH, 'get');
|
||||||
|
if (params) {
|
||||||
|
rb.path('domain', params.domain, {});
|
||||||
|
rb.path('name', params.name, {});
|
||||||
|
rb.path('version', params.version, {});
|
||||||
|
}
|
||||||
|
|
||||||
|
return http.request(
|
||||||
|
rb.build({ responseType: 'json', accept: 'application/json', context })
|
||||||
|
).pipe(
|
||||||
|
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
|
||||||
|
map((r: HttpResponse<any>) => {
|
||||||
|
return r as StrictHttpResponse<{
|
||||||
|
[key: string]: any;
|
||||||
|
}>;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
lineage.PATH = '/models/{domain}/{name}/versions/{version}/lineage';
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { filter, map } from 'rxjs/operators';
|
||||||
|
import { StrictHttpResponse } from '../../strict-http-response';
|
||||||
|
import { RequestBuilder } from '../../request-builder';
|
||||||
|
|
||||||
|
import { Domain } from '../../models/domain';
|
||||||
|
|
||||||
|
export interface Retire$Params {
|
||||||
|
domain: Domain;
|
||||||
|
name: string;
|
||||||
|
version: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function retire(http: HttpClient, rootUrl: string, params: Retire$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||||
|
[key: string]: string;
|
||||||
|
}>> {
|
||||||
|
const rb = new RequestBuilder(rootUrl, retire.PATH, 'post');
|
||||||
|
if (params) {
|
||||||
|
rb.path('domain', params.domain, {});
|
||||||
|
rb.path('name', params.name, {});
|
||||||
|
rb.path('version', params.version, {});
|
||||||
|
}
|
||||||
|
|
||||||
|
return http.request(
|
||||||
|
rb.build({ responseType: 'json', accept: 'application/json', context })
|
||||||
|
).pipe(
|
||||||
|
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
|
||||||
|
map((r: HttpResponse<any>) => {
|
||||||
|
return r as StrictHttpResponse<{
|
||||||
|
[key: string]: string;
|
||||||
|
}>;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
retire.PATH = '/models/{domain}/{name}/versions/{version}/retire';
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { filter, map } from 'rxjs/operators';
|
||||||
|
import { StrictHttpResponse } from '../../strict-http-response';
|
||||||
|
import { RequestBuilder } from '../../request-builder';
|
||||||
|
|
||||||
|
import { Domain } from '../../models/domain';
|
||||||
|
import { TrainingConfig } from '../../models/training-config';
|
||||||
|
|
||||||
|
export interface TrainingConfig$Params {
|
||||||
|
domain: Domain;
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function trainingConfig(http: HttpClient, rootUrl: string, params: TrainingConfig$Params, context?: HttpContext): Observable<StrictHttpResponse<TrainingConfig>> {
|
||||||
|
const rb = new RequestBuilder(rootUrl, trainingConfig.PATH, 'get');
|
||||||
|
if (params) {
|
||||||
|
rb.path('domain', params.domain, {});
|
||||||
|
rb.path('name', params.name, {});
|
||||||
|
}
|
||||||
|
|
||||||
|
return http.request(
|
||||||
|
rb.build({ responseType: 'json', accept: 'application/json', context })
|
||||||
|
).pipe(
|
||||||
|
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
|
||||||
|
map((r: HttpResponse<any>) => {
|
||||||
|
return r as StrictHttpResponse<TrainingConfig>;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
trainingConfig.PATH = '/models/{domain}/{name}/training-config';
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { filter, map } from 'rxjs/operators';
|
||||||
|
import { StrictHttpResponse } from '../../strict-http-response';
|
||||||
|
import { RequestBuilder } from '../../request-builder';
|
||||||
|
|
||||||
|
import { Domain } from '../../models/domain';
|
||||||
|
|
||||||
|
export interface VersionChecks$Params {
|
||||||
|
domain: Domain;
|
||||||
|
name: string;
|
||||||
|
version: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function versionChecks(http: HttpClient, rootUrl: string, params: VersionChecks$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||||
|
[key: string]: any;
|
||||||
|
}>> {
|
||||||
|
const rb = new RequestBuilder(rootUrl, versionChecks.PATH, 'get');
|
||||||
|
if (params) {
|
||||||
|
rb.path('domain', params.domain, {});
|
||||||
|
rb.path('name', params.name, {});
|
||||||
|
rb.path('version', params.version, {});
|
||||||
|
}
|
||||||
|
|
||||||
|
return http.request(
|
||||||
|
rb.build({ responseType: 'json', accept: 'application/json', context })
|
||||||
|
).pipe(
|
||||||
|
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
|
||||||
|
map((r: HttpResponse<any>) => {
|
||||||
|
return r as StrictHttpResponse<{
|
||||||
|
[key: string]: any;
|
||||||
|
}>;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
versionChecks.PATH = '/models/{domain}/{name}/versions/{version}/checks';
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { filter, map } from 'rxjs/operators';
|
||||||
|
import { StrictHttpResponse } from '../../strict-http-response';
|
||||||
|
import { RequestBuilder } from '../../request-builder';
|
||||||
|
|
||||||
|
import { PreviewStatus } from '../../models/preview-status';
|
||||||
|
|
||||||
|
export interface PreviewStatus$Params {
|
||||||
|
run_id: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function previewStatus(http: HttpClient, rootUrl: string, params: PreviewStatus$Params, context?: HttpContext): Observable<StrictHttpResponse<PreviewStatus>> {
|
||||||
|
const rb = new RequestBuilder(rootUrl, previewStatus.PATH, 'get');
|
||||||
|
if (params) {
|
||||||
|
rb.path('run_id', params.run_id, {});
|
||||||
|
}
|
||||||
|
|
||||||
|
return http.request(
|
||||||
|
rb.build({ responseType: 'json', accept: 'application/json', context })
|
||||||
|
).pipe(
|
||||||
|
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
|
||||||
|
map((r: HttpResponse<any>) => {
|
||||||
|
return r as StrictHttpResponse<PreviewStatus>;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
previewStatus.PATH = '/tea/preview/{run_id}';
|
||||||
@@ -7,17 +7,18 @@ import { filter, map } from 'rxjs/operators';
|
|||||||
import { StrictHttpResponse } from '../../strict-http-response';
|
import { StrictHttpResponse } from '../../strict-http-response';
|
||||||
import { RequestBuilder } from '../../request-builder';
|
import { RequestBuilder } from '../../request-builder';
|
||||||
|
|
||||||
|
import { BodyStartPreview } from '../../models/body-start-preview';
|
||||||
|
|
||||||
export interface TerminateRun$Params {
|
export interface StartPreview$Params {
|
||||||
run_id: string;
|
body: BodyStartPreview
|
||||||
}
|
}
|
||||||
|
|
||||||
export function terminateRun(http: HttpClient, rootUrl: string, params: TerminateRun$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
export function startPreview(http: HttpClient, rootUrl: string, params: StartPreview$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||||
[key: string]: string;
|
[key: string]: string;
|
||||||
}>> {
|
}>> {
|
||||||
const rb = new RequestBuilder(rootUrl, terminateRun.PATH, 'post');
|
const rb = new RequestBuilder(rootUrl, startPreview.PATH, 'post');
|
||||||
if (params) {
|
if (params) {
|
||||||
rb.path('run_id', params.run_id, {});
|
rb.body(params.body, 'multipart/form-data');
|
||||||
}
|
}
|
||||||
|
|
||||||
return http.request(
|
return http.request(
|
||||||
@@ -32,4 +33,4 @@ export function terminateRun(http: HttpClient, rootUrl: string, params: Terminat
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
terminateRun.PATH = '/runs/{run_id}/terminate';
|
startPreview.PATH = '/tea/preview';
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { filter, map } from 'rxjs/operators';
|
||||||
|
import { StrictHttpResponse } from '../../strict-http-response';
|
||||||
|
import { RequestBuilder } from '../../request-builder';
|
||||||
|
|
||||||
|
import { Cancel } from '../../models/cancel';
|
||||||
|
|
||||||
|
export interface CancelRun$Params {
|
||||||
|
run_id: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function cancelRun(http: HttpClient, rootUrl: string, params: CancelRun$Params, context?: HttpContext): Observable<StrictHttpResponse<Cancel>> {
|
||||||
|
const rb = new RequestBuilder(rootUrl, cancelRun.PATH, 'post');
|
||||||
|
if (params) {
|
||||||
|
rb.path('run_id', params.run_id, {});
|
||||||
|
}
|
||||||
|
|
||||||
|
return http.request(
|
||||||
|
rb.build({ responseType: 'json', accept: 'application/json', context })
|
||||||
|
).pipe(
|
||||||
|
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
|
||||||
|
map((r: HttpResponse<any>) => {
|
||||||
|
return r as StrictHttpResponse<Cancel>;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
cancelRun.PATH = '/runs/{run_id}/cancel';
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { filter, map } from 'rxjs/operators';
|
||||||
|
import { StrictHttpResponse } from '../../strict-http-response';
|
||||||
|
import { RequestBuilder } from '../../request-builder';
|
||||||
|
|
||||||
|
import { Domain } from '../../models/domain';
|
||||||
|
import { RunSummary } from '../../models/run-summary';
|
||||||
|
|
||||||
|
export interface RunHistory$Params {
|
||||||
|
job?: (string | null);
|
||||||
|
domain?: (Domain | null);
|
||||||
|
limit?: number;
|
||||||
|
before?: (string | null);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function runHistory(http: HttpClient, rootUrl: string, params?: RunHistory$Params, context?: HttpContext): Observable<StrictHttpResponse<Array<RunSummary>>> {
|
||||||
|
const rb = new RequestBuilder(rootUrl, runHistory.PATH, 'get');
|
||||||
|
if (params) {
|
||||||
|
rb.query('job', params.job, {});
|
||||||
|
rb.query('domain', params.domain, {});
|
||||||
|
rb.query('limit', params.limit, {});
|
||||||
|
rb.query('before', params.before, {});
|
||||||
|
}
|
||||||
|
|
||||||
|
return http.request(
|
||||||
|
rb.build({ responseType: 'json', accept: 'application/json', context })
|
||||||
|
).pipe(
|
||||||
|
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
|
||||||
|
map((r: HttpResponse<any>) => {
|
||||||
|
return r as StrictHttpResponse<Array<RunSummary>>;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
runHistory.PATH = '/runs';
|
||||||
@@ -7,17 +7,18 @@ import { filter, map } from 'rxjs/operators';
|
|||||||
import { StrictHttpResponse } from '../../strict-http-response';
|
import { StrictHttpResponse } from '../../strict-http-response';
|
||||||
import { RequestBuilder } from '../../request-builder';
|
import { RequestBuilder } from '../../request-builder';
|
||||||
|
|
||||||
|
import { Run } from '../../models/run';
|
||||||
|
|
||||||
export interface RunStatus$Params {
|
export interface RunStatus$Params {
|
||||||
run_id: string;
|
run_id: string;
|
||||||
|
outputs?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function runStatus(http: HttpClient, rootUrl: string, params: RunStatus$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
export function runStatus(http: HttpClient, rootUrl: string, params: RunStatus$Params, context?: HttpContext): Observable<StrictHttpResponse<Run>> {
|
||||||
[key: string]: string;
|
|
||||||
}>> {
|
|
||||||
const rb = new RequestBuilder(rootUrl, runStatus.PATH, 'get');
|
const rb = new RequestBuilder(rootUrl, runStatus.PATH, 'get');
|
||||||
if (params) {
|
if (params) {
|
||||||
rb.path('run_id', params.run_id, {});
|
rb.path('run_id', params.run_id, {});
|
||||||
|
rb.query('outputs', params.outputs, {});
|
||||||
}
|
}
|
||||||
|
|
||||||
return http.request(
|
return http.request(
|
||||||
@@ -25,9 +26,7 @@ export function runStatus(http: HttpClient, rootUrl: string, params: RunStatus$P
|
|||||||
).pipe(
|
).pipe(
|
||||||
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
|
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
|
||||||
map((r: HttpResponse<any>) => {
|
map((r: HttpResponse<any>) => {
|
||||||
return r as StrictHttpResponse<{
|
return r as StrictHttpResponse<Run>;
|
||||||
[key: string]: string;
|
|
||||||
}>;
|
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+32
-14
@@ -9,8 +9,10 @@ export type { Domains$Params as Domains$Params } from './fn/operations/domains';
|
|||||||
export { domains as domains } from './fn/operations/domains';
|
export { domains as domains } from './fn/operations/domains';
|
||||||
export type { Health$Params as Health$Params } from './fn/operations/health';
|
export type { Health$Params as Health$Params } from './fn/operations/health';
|
||||||
export { health as health } from './fn/operations/health';
|
export { health as health } from './fn/operations/health';
|
||||||
export type { ConceptMaps$Params as ConceptMaps$Params } from './fn/ingest/concept-maps';
|
export type { ExecutionHealth$Params as ExecutionHealth$Params } from './fn/execution/execution-health';
|
||||||
export { conceptMaps as conceptMaps } from './fn/ingest/concept-maps';
|
export { executionHealth as executionHealth } from './fn/execution/execution-health';
|
||||||
|
export type { ExecutionOptions$Params as ExecutionOptions$Params } from './fn/execution/execution-options';
|
||||||
|
export { executionOptions as executionOptions } from './fn/execution/execution-options';
|
||||||
export type { GetConceptMap$Params as GetConceptMap$Params } from './fn/ingest/get-concept-map';
|
export type { GetConceptMap$Params as GetConceptMap$Params } from './fn/ingest/get-concept-map';
|
||||||
export { getConceptMap as getConceptMap } from './fn/ingest/get-concept-map';
|
export { getConceptMap as getConceptMap } from './fn/ingest/get-concept-map';
|
||||||
export type { SaveConceptMap$Params as SaveConceptMap$Params } from './fn/ingest/save-concept-map';
|
export type { SaveConceptMap$Params as SaveConceptMap$Params } from './fn/ingest/save-concept-map';
|
||||||
@@ -33,8 +35,6 @@ export type { OauthStart$Params as OauthStart$Params } from './fn/ingest/oauth-s
|
|||||||
export { oauthStart as oauthStart } from './fn/ingest/oauth-start';
|
export { oauthStart as oauthStart } from './fn/ingest/oauth-start';
|
||||||
export type { SourcePreview$Params as SourcePreview$Params } from './fn/ingest/source-preview';
|
export type { SourcePreview$Params as SourcePreview$Params } from './fn/ingest/source-preview';
|
||||||
export { sourcePreview as sourcePreview } from './fn/ingest/source-preview';
|
export { sourcePreview as sourcePreview } from './fn/ingest/source-preview';
|
||||||
export type { SourceResources$Params as SourceResources$Params } from './fn/ingest/source-resources';
|
|
||||||
export { sourceResources as sourceResources } from './fn/ingest/source-resources';
|
|
||||||
export type { TestSource$Params as TestSource$Params } from './fn/ingest/test-source';
|
export type { TestSource$Params as TestSource$Params } from './fn/ingest/test-source';
|
||||||
export { testSource as testSource } from './fn/ingest/test-source';
|
export { testSource as testSource } from './fn/ingest/test-source';
|
||||||
export type { SourceTypes$Params as SourceTypes$Params } from './fn/ingest/source-types';
|
export type { SourceTypes$Params as SourceTypes$Params } from './fn/ingest/source-types';
|
||||||
@@ -45,12 +45,24 @@ export type { Models$Params as Models$Params } from './fn/models/models';
|
|||||||
export { models as models } from './fn/models/models';
|
export { models as models } from './fn/models/models';
|
||||||
export type { Analyze$Params as Analyze$Params } from './fn/models/analyze';
|
export type { Analyze$Params as Analyze$Params } from './fn/models/analyze';
|
||||||
export { analyze as analyze } from './fn/models/analyze';
|
export { analyze as analyze } from './fn/models/analyze';
|
||||||
|
export type { ExportModels$Params as ExportModels$Params } from './fn/models/export-models';
|
||||||
|
export { exportModels as exportModels } from './fn/models/export-models';
|
||||||
|
export type { ImportModels$Params as ImportModels$Params } from './fn/models/import-models';
|
||||||
|
export { importModels as importModels } from './fn/models/import-models';
|
||||||
export type { Score$Params as Score$Params } from './fn/models/score';
|
export type { Score$Params as Score$Params } from './fn/models/score';
|
||||||
export { score as score } from './fn/models/score';
|
export { score as score } from './fn/models/score';
|
||||||
export type { Train$Params as Train$Params } from './fn/models/train';
|
export type { Train$Params as Train$Params } from './fn/models/train';
|
||||||
export { train as train } from './fn/models/train';
|
export { train as train } from './fn/models/train';
|
||||||
|
export type { TrainingConfig$Params as TrainingConfig$Params } from './fn/models/training-config';
|
||||||
|
export { trainingConfig as trainingConfig } from './fn/models/training-config';
|
||||||
export type { Versions$Params as Versions$Params } from './fn/models/versions';
|
export type { Versions$Params as Versions$Params } from './fn/models/versions';
|
||||||
export { versions as versions } from './fn/models/versions';
|
export { versions as versions } from './fn/models/versions';
|
||||||
|
export type { VersionChecks$Params as VersionChecks$Params } from './fn/models/version-checks';
|
||||||
|
export { versionChecks as versionChecks } from './fn/models/version-checks';
|
||||||
|
export type { Curve$Params as Curve$Params } from './fn/models/curve';
|
||||||
|
export { curve as curve } from './fn/models/curve';
|
||||||
|
export type { Lineage$Params as Lineage$Params } from './fn/models/lineage';
|
||||||
|
export { lineage as lineage } from './fn/models/lineage';
|
||||||
export type { Promote$Params as Promote$Params } from './fn/models/promote';
|
export type { Promote$Params as Promote$Params } from './fn/models/promote';
|
||||||
export { promote as promote } from './fn/models/promote';
|
export { promote as promote } from './fn/models/promote';
|
||||||
export type { AddClinicalValidation$Params as AddClinicalValidation$Params } from './fn/models/add-clinical-validation';
|
export type { AddClinicalValidation$Params as AddClinicalValidation$Params } from './fn/models/add-clinical-validation';
|
||||||
@@ -59,6 +71,8 @@ export type { ReadReport$Json$Params as ReadReport$Json$Params } from './fn/mode
|
|||||||
export { readReport$Json as readReport$Json } from './fn/models/read-report-json';
|
export { readReport$Json as readReport$Json } from './fn/models/read-report-json';
|
||||||
export type { ReadReport$Any$Params as ReadReport$Any$Params } from './fn/models/read-report-any';
|
export type { ReadReport$Any$Params as ReadReport$Any$Params } from './fn/models/read-report-any';
|
||||||
export { readReport$Any as readReport$Any } from './fn/models/read-report-any';
|
export { readReport$Any as readReport$Any } from './fn/models/read-report-any';
|
||||||
|
export type { Retire$Params as Retire$Params } from './fn/models/retire';
|
||||||
|
export { retire as retire } from './fn/models/retire';
|
||||||
export type { Conflicts$Params as Conflicts$Params } from './fn/review/conflicts';
|
export type { Conflicts$Params as Conflicts$Params } from './fn/review/conflicts';
|
||||||
export { conflicts as conflicts } from './fn/review/conflicts';
|
export { conflicts as conflicts } from './fn/review/conflicts';
|
||||||
export type { Correct$Params as Correct$Params } from './fn/review/correct';
|
export type { Correct$Params as Correct$Params } from './fn/review/correct';
|
||||||
@@ -73,26 +87,28 @@ export type { Reject$Params as Reject$Params } from './fn/review/reject';
|
|||||||
export { reject as reject } from './fn/review/reject';
|
export { reject as reject } from './fn/review/reject';
|
||||||
export type { Unrecognised$Params as Unrecognised$Params } from './fn/review/unrecognised';
|
export type { Unrecognised$Params as Unrecognised$Params } from './fn/review/unrecognised';
|
||||||
export { unrecognised as unrecognised } from './fn/review/unrecognised';
|
export { unrecognised as unrecognised } from './fn/review/unrecognised';
|
||||||
|
export type { RunHistory$Params as RunHistory$Params } from './fn/runs/run-history';
|
||||||
|
export { runHistory as runHistory } from './fn/runs/run-history';
|
||||||
export type { RunStatus$Params as RunStatus$Params } from './fn/runs/run-status';
|
export type { RunStatus$Params as RunStatus$Params } from './fn/runs/run-status';
|
||||||
export { runStatus as runStatus } from './fn/runs/run-status';
|
export { runStatus as runStatus } from './fn/runs/run-status';
|
||||||
export type { TerminateRun$Params as TerminateRun$Params } from './fn/runs/terminate-run';
|
export type { CancelRun$Params as CancelRun$Params } from './fn/runs/cancel-run';
|
||||||
export { terminateRun as terminateRun } from './fn/runs/terminate-run';
|
export { cancelRun as cancelRun } from './fn/runs/cancel-run';
|
||||||
export type { Studies$Params as Studies$Params } from './fn/eeg/studies';
|
export type { Studies$Params as Studies$Params } from './fn/eeg/studies';
|
||||||
export { studies as studies } from './fn/eeg/studies';
|
export { studies as studies } from './fn/eeg/studies';
|
||||||
|
export type { AnalyzeEegs$Params as AnalyzeEegs$Params } from './fn/eeg/analyze-eegs';
|
||||||
|
export { analyzeEegs as analyzeEegs } from './fn/eeg/analyze-eegs';
|
||||||
|
export type { EegStudiesSummary$Params as EegStudiesSummary$Params } from './fn/eeg/eeg-studies-summary';
|
||||||
|
export { eegStudiesSummary as eegStudiesSummary } from './fn/eeg/eeg-studies-summary';
|
||||||
export type { Study$Params as Study$Params } from './fn/eeg/study';
|
export type { Study$Params as Study$Params } from './fn/eeg/study';
|
||||||
export { study as study } from './fn/eeg/study';
|
export { study as study } from './fn/eeg/study';
|
||||||
|
export type { StartPreview$Params as StartPreview$Params } from './fn/preview/start-preview';
|
||||||
|
export { startPreview as startPreview } from './fn/preview/start-preview';
|
||||||
|
export type { PreviewStatus$Params as PreviewStatus$Params } from './fn/preview/preview-status';
|
||||||
|
export { previewStatus as previewStatus } from './fn/preview/preview-status';
|
||||||
export type { UsersCurrentUser$Params as UsersCurrentUser$Params } from './fn/users/users-current-user';
|
export type { UsersCurrentUser$Params as UsersCurrentUser$Params } from './fn/users/users-current-user';
|
||||||
export { usersCurrentUser as usersCurrentUser } from './fn/users/users-current-user';
|
export { usersCurrentUser as usersCurrentUser } from './fn/users/users-current-user';
|
||||||
export type { UsersPatchCurrentUser$Params as UsersPatchCurrentUser$Params } from './fn/users/users-patch-current-user';
|
|
||||||
export { usersPatchCurrentUser as usersPatchCurrentUser } from './fn/users/users-patch-current-user';
|
|
||||||
export type { RegisterRegister$Params as RegisterRegister$Params } from './fn/users/register-register';
|
export type { RegisterRegister$Params as RegisterRegister$Params } from './fn/users/register-register';
|
||||||
export { registerRegister as registerRegister } from './fn/users/register-register';
|
export { registerRegister as registerRegister } from './fn/users/register-register';
|
||||||
export type { UsersUser$Params as UsersUser$Params } from './fn/users/users-user';
|
|
||||||
export { usersUser as usersUser } from './fn/users/users-user';
|
|
||||||
export type { UsersDeleteUser$Params as UsersDeleteUser$Params } from './fn/users/users-delete-user';
|
|
||||||
export { usersDeleteUser as usersDeleteUser } from './fn/users/users-delete-user';
|
|
||||||
export type { UsersPatchUser$Params as UsersPatchUser$Params } from './fn/users/users-patch-user';
|
|
||||||
export { usersPatchUser as usersPatchUser } from './fn/users/users-patch-user';
|
|
||||||
export type { PostBundle$Params as PostBundle$Params } from './fn/fhir/post-bundle';
|
export type { PostBundle$Params as PostBundle$Params } from './fn/fhir/post-bundle';
|
||||||
export { postBundle as postBundle } from './fn/fhir/post-bundle';
|
export { postBundle as postBundle } from './fn/fhir/post-bundle';
|
||||||
export type { SearchCondition$Params as SearchCondition$Params } from './fn/fhir/search-condition';
|
export type { SearchCondition$Params as SearchCondition$Params } from './fn/fhir/search-condition';
|
||||||
@@ -111,6 +127,8 @@ export type { SearchObservation$Params as SearchObservation$Params } from './fn/
|
|||||||
export { searchObservation as searchObservation } from './fn/fhir/search-observation';
|
export { searchObservation as searchObservation } from './fn/fhir/search-observation';
|
||||||
export type { SearchPatient$Params as SearchPatient$Params } from './fn/fhir/search-patient';
|
export type { SearchPatient$Params as SearchPatient$Params } from './fn/fhir/search-patient';
|
||||||
export { searchPatient as searchPatient } from './fn/fhir/search-patient';
|
export { searchPatient as searchPatient } from './fn/fhir/search-patient';
|
||||||
|
export type { EegSummary$Params as EegSummary$Params } from './fn/fhir/eeg-summary';
|
||||||
|
export { eegSummary as eegSummary } from './fn/fhir/eeg-summary';
|
||||||
export type { ReadPatient$Params as ReadPatient$Params } from './fn/fhir/read-patient';
|
export type { ReadPatient$Params as ReadPatient$Params } from './fn/fhir/read-patient';
|
||||||
export { readPatient as readPatient } from './fn/fhir/read-patient';
|
export { readPatient as readPatient } from './fn/fhir/read-patient';
|
||||||
export type { SearchProcedure$Params as SearchProcedure$Params } from './fn/fhir/search-procedure';
|
export type { SearchProcedure$Params as SearchProcedure$Params } from './fn/fhir/search-procedure';
|
||||||
|
|||||||
+26
-3
@@ -2,21 +2,30 @@
|
|||||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
export type { Analysis } from './models/analysis';
|
export type { Analysis } from './models/analysis';
|
||||||
|
export type { Analyze } from './models/analyze';
|
||||||
|
export type { AnalyzeRequest } from './models/analyze-request';
|
||||||
export type { Answers } from './models/answers';
|
export type { Answers } from './models/answers';
|
||||||
export type { BodyAddClinicalValidation } from './models/body-add-clinical-validation';
|
export type { BodyAddClinicalValidation } from './models/body-add-clinical-validation';
|
||||||
|
export type { BodyImportModels } from './models/body-import-models';
|
||||||
|
export type { BodyStartPreview } from './models/body-start-preview';
|
||||||
export type { BodyUpload } from './models/body-upload';
|
export type { BodyUpload } from './models/body-upload';
|
||||||
export type { Browsed } from './models/browsed';
|
export type { Browsed } from './models/browsed';
|
||||||
|
export type { Cancel } from './models/cancel';
|
||||||
export type { Catalog } from './models/catalog';
|
export type { Catalog } from './models/catalog';
|
||||||
export type { Condition } from './models/condition';
|
export type { Condition } from './models/condition';
|
||||||
export type { Correction } from './models/correction';
|
export type { Correction } from './models/correction';
|
||||||
export type { Domain } from './models/domain';
|
export type { Domain } from './models/domain';
|
||||||
|
export type { Edf } from './models/edf';
|
||||||
export type { Entry } from './models/entry';
|
export type { Entry } from './models/entry';
|
||||||
export type { ErrorModel } from './models/error-model';
|
export type { ErrorModel } from './models/error-model';
|
||||||
|
export type { Execution } from './models/execution';
|
||||||
export type { Extract } from './models/extract';
|
export type { Extract } from './models/extract';
|
||||||
export type { Fhir } from './models/fhir';
|
export type { Fhir } from './models/fhir';
|
||||||
export type { FieldSpec } from './models/field-spec';
|
export type { FieldSpec } from './models/field-spec';
|
||||||
|
export type { FolderTrainingSource } from './models/folder-training-source';
|
||||||
export type { Group } from './models/group';
|
export type { Group } from './models/group';
|
||||||
export type { Guided } from './models/guided';
|
export type { Guided } from './models/guided';
|
||||||
|
export type { Health } from './models/health';
|
||||||
export type { HttpValidationError } from './models/http-validation-error';
|
export type { HttpValidationError } from './models/http-validation-error';
|
||||||
export type { Join } from './models/join';
|
export type { Join } from './models/join';
|
||||||
export type { Link } from './models/link';
|
export type { Link } from './models/link';
|
||||||
@@ -26,28 +35,42 @@ export type { Map } from './models/map';
|
|||||||
export type { Metric } from './models/metric';
|
export type { Metric } from './models/metric';
|
||||||
export type { Model } from './models/model';
|
export type { Model } from './models/model';
|
||||||
export type { Option } from './models/option';
|
export type { Option } from './models/option';
|
||||||
|
export type { Options } from './models/options';
|
||||||
export type { PersonDecision } from './models/person-decision';
|
export type { PersonDecision } from './models/person-decision';
|
||||||
export type { Pipeline } from './models/pipeline';
|
export type { Pipeline } from './models/pipeline';
|
||||||
export type { Position } from './models/position';
|
export type { Position } from './models/position';
|
||||||
|
export type { PreviewAdos2 } from './models/preview-ados-2';
|
||||||
|
export type { PreviewEeg } from './models/preview-eeg';
|
||||||
|
export type { PreviewMetric } from './models/preview-metric';
|
||||||
|
export type { PreviewResult } from './models/preview-result';
|
||||||
|
export type { PreviewStatus } from './models/preview-status';
|
||||||
|
export type { Progress } from './models/progress';
|
||||||
export type { Provider } from './models/provider';
|
export type { Provider } from './models/provider';
|
||||||
export type { Read } from './models/read';
|
export type { Read } from './models/read';
|
||||||
export type { Rejection } from './models/rejection';
|
export type { Rejection } from './models/rejection';
|
||||||
export type { Relation } from './models/relation';
|
|
||||||
export type { Route } from './models/route';
|
export type { Route } from './models/route';
|
||||||
|
export type { Run } from './models/run';
|
||||||
export type { RunRequest } from './models/run-request';
|
export type { RunRequest } from './models/run-request';
|
||||||
|
export type { RunSummary } from './models/run-summary';
|
||||||
export type { SavedPipeline } from './models/saved-pipeline';
|
export type { SavedPipeline } from './models/saved-pipeline';
|
||||||
|
export type { Scope } from './models/scope';
|
||||||
|
export type { Score } from './models/score';
|
||||||
export type { SignIn } from './models/sign-in';
|
export type { SignIn } from './models/sign-in';
|
||||||
export type { Site } from './models/site';
|
export type { Site } from './models/site';
|
||||||
|
export type { SiteTrainingSource } from './models/site-training-source';
|
||||||
export type { Source } from './models/source';
|
export type { Source } from './models/source';
|
||||||
export type { SourceRef } from './models/source-ref';
|
|
||||||
export type { SourceType } from './models/source-type';
|
export type { SourceType } from './models/source-type';
|
||||||
|
export type { Step } from './models/step';
|
||||||
export type { Study } from './models/study';
|
export type { Study } from './models/study';
|
||||||
export type { Target } from './models/target';
|
export type { Target } from './models/target';
|
||||||
|
export type { Tasks } from './models/tasks';
|
||||||
export type { Tested } from './models/tested';
|
export type { Tested } from './models/tested';
|
||||||
export type { Training } from './models/training';
|
export type { Training } from './models/training';
|
||||||
|
export type { TrainingConfig } from './models/training-config';
|
||||||
|
export type { TrainingSource } from './models/training-source';
|
||||||
export type { Uploaded } from './models/uploaded';
|
export type { Uploaded } from './models/uploaded';
|
||||||
export type { UserCreate } from './models/user-create';
|
export type { UserCreate } from './models/user-create';
|
||||||
export type { UserRead } from './models/user-read';
|
export type { UserRead } from './models/user-read';
|
||||||
export type { UserUpdate } from './models/user-update';
|
|
||||||
export type { ValidationError } from './models/validation-error';
|
export type { ValidationError } from './models/validation-error';
|
||||||
export type { Version } from './models/version';
|
export type { Version } from './models/version';
|
||||||
|
export type { Worker } from './models/worker';
|
||||||
|
|||||||
@@ -2,12 +2,16 @@
|
|||||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
import { Metric } from '../models/metric';
|
import { Metric } from '../models/metric';
|
||||||
import { Relation } from '../models/relation';
|
|
||||||
export interface Analysis {
|
export interface Analysis {
|
||||||
age_months: (number | null);
|
age_months: (number | null);
|
||||||
|
checks: Array<{
|
||||||
|
[key: string]: any;
|
||||||
|
}>;
|
||||||
id: string;
|
id: string;
|
||||||
level: (string | null);
|
level: (string | null);
|
||||||
metrics: Array<Metric>;
|
metrics: Array<Metric>;
|
||||||
relation?: Array<Relation>;
|
regions: Array<{
|
||||||
|
[key: string]: any;
|
||||||
|
}>;
|
||||||
valid: (boolean | null);
|
valid: (boolean | null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
import { Execution } from '../models/execution';
|
||||||
|
import { Scope } from '../models/scope';
|
||||||
|
export interface AnalyzeRequest {
|
||||||
|
execution?: (Execution | null);
|
||||||
|
scope?: Scope;
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
import { Execution } from '../models/execution';
|
||||||
|
export interface Analyze {
|
||||||
|
execution?: (Execution | null);
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
export interface BodyImportModels {
|
||||||
|
file: string;
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
export interface BodyStartPreview {
|
||||||
|
ados2?: (Blob | null);
|
||||||
|
birth_date?: (string | null);
|
||||||
|
edf: Blob;
|
||||||
|
pipeline?: string;
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
export interface Cancel {
|
||||||
|
id: string;
|
||||||
|
state: 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelling' | 'cancelled';
|
||||||
|
status: string;
|
||||||
|
}
|
||||||
@@ -3,14 +3,8 @@
|
|||||||
|
|
||||||
export interface Condition {
|
export interface Condition {
|
||||||
|
|
||||||
/**
|
|
||||||
* Por ejemplo «text», el texto leído del documento.
|
|
||||||
*/
|
|
||||||
column: string;
|
column: string;
|
||||||
op: 'equals' | 'contains' | 'matches' | 'present';
|
op: 'equals' | 'contains' | 'matches' | 'present';
|
||||||
|
|
||||||
/**
|
|
||||||
* Lo que se busca; por ejemplo «citología».
|
|
||||||
*/
|
|
||||||
value?: string;
|
value?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,6 @@
|
|||||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* One field of one record as a reviewer read it in the source document: an identity
|
|
||||||
* field (a mistyped record number) or a study's (a stage the scan made unreadable).
|
|
||||||
*/
|
|
||||||
export interface Correction {
|
export interface Correction {
|
||||||
entity?: 'identity' | 'cervical_cytology' | 'cervical_biopsy' | 'mammography' | 'breast_biopsy' | 'breast_treatment' | 'breast_recurrence' | 'clinical_note' | 'death' | 'mchat' | 'ados2' | 'eeg';
|
entity?: 'identity' | 'cervical_cytology' | 'cervical_biopsy' | 'mammography' | 'breast_biopsy' | 'breast_treatment' | 'breast_recurrence' | 'clinical_note' | 'death' | 'mchat' | 'ados2' | 'eeg';
|
||||||
field: string;
|
field: string;
|
||||||
|
|||||||
@@ -3,9 +3,6 @@
|
|||||||
|
|
||||||
import { Domain } from './domain';
|
import { Domain } from './domain';
|
||||||
|
|
||||||
/**
|
|
||||||
* Each possible value of `Domain`
|
|
||||||
*/
|
|
||||||
export const DOMAIN: Domain[] = [
|
export const DOMAIN: Domain[] = [
|
||||||
'cacu',
|
'cacu',
|
||||||
'cama',
|
'cama',
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
import { Position } from '../models/position';
|
||||||
|
|
||||||
|
export interface Edf {
|
||||||
|
column: string;
|
||||||
|
id: string;
|
||||||
|
inputs?: Array<string>;
|
||||||
|
kind?: 'edf';
|
||||||
|
|
||||||
|
label?: string;
|
||||||
|
position?: (Position | null);
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
|
||||||
|
export interface Execution {
|
||||||
|
mode?: ('sync' | 'local' | 'remote' | null);
|
||||||
|
scheduler?: (string | null);
|
||||||
|
}
|
||||||
@@ -3,50 +3,27 @@
|
|||||||
|
|
||||||
import { Position } from '../models/position';
|
import { Position } from '../models/position';
|
||||||
|
|
||||||
/**
|
|
||||||
* Platform fields read from text, each kept with the text it was read from.
|
|
||||||
*
|
|
||||||
* `auto` asks the LLM when one is configured and answering, else applies `patterns`;
|
|
||||||
* with neither, the row is held. Patterns are regexes with one group, per field (the
|
|
||||||
* LLM can propose them from sample documents); their values go through the ConceptMap
|
|
||||||
* and `formats` as in `map`.
|
|
||||||
*/
|
|
||||||
export interface Extract {
|
export interface Extract {
|
||||||
column: (string | Array<string>);
|
column: (string | Array<string>);
|
||||||
|
|
||||||
/**
|
|
||||||
* Dato → columna, sin leer el texto.
|
|
||||||
*/
|
|
||||||
columns?: {
|
columns?: {
|
||||||
[key: string]: string;
|
[key: string]: string;
|
||||||
};
|
};
|
||||||
concept_map?: (string | null);
|
concept_map?: (string | null);
|
||||||
|
|
||||||
/**
|
|
||||||
* Qué estudio se saca del documento.
|
|
||||||
*/
|
|
||||||
entity: 'identity' | 'cervical_cytology' | 'cervical_biopsy' | 'mammography' | 'breast_biopsy' | 'breast_treatment' | 'breast_recurrence' | 'clinical_note' | 'death' | 'mchat' | 'ados2' | 'eeg';
|
entity: 'identity' | 'cervical_cytology' | 'cervical_biopsy' | 'mammography' | 'breast_biopsy' | 'breast_treatment' | 'breast_recurrence' | 'clinical_note' | 'death' | 'mchat' | 'ados2' | 'eeg';
|
||||||
formats?: {
|
formats?: {
|
||||||
[key: string]: string;
|
[key: string]: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Para el modelo de lenguaje.
|
|
||||||
*/
|
|
||||||
hints?: string;
|
hints?: string;
|
||||||
id: string;
|
id: string;
|
||||||
inputs?: Array<string>;
|
inputs?: Array<string>;
|
||||||
kind?: 'extract';
|
kind?: 'extract';
|
||||||
|
|
||||||
/**
|
|
||||||
* Cómo se ve en el diagrama.
|
|
||||||
*/
|
|
||||||
label?: string;
|
label?: string;
|
||||||
method?: 'auto' | 'llm' | 'patterns';
|
method?: 'auto' | 'llm' | 'patterns';
|
||||||
|
|
||||||
/**
|
|
||||||
* Dato → expresión con un grupo ( ).
|
|
||||||
*/
|
|
||||||
patterns?: {
|
patterns?: {
|
||||||
[key: string]: string;
|
[key: string]: string;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,11 +3,6 @@
|
|||||||
|
|
||||||
import { Position } from '../models/position';
|
import { Position } from '../models/position';
|
||||||
|
|
||||||
/**
|
|
||||||
* FHIR R4 Bundles a standard hospital sent (a column of their JSON) as rows of one
|
|
||||||
* entity: identity, death or a study (core.fhir_in). The sender's own codes go through
|
|
||||||
* its ConceptMap.
|
|
||||||
*/
|
|
||||||
export interface Fhir {
|
export interface Fhir {
|
||||||
column?: string;
|
column?: string;
|
||||||
concept_map?: (string | null);
|
concept_map?: (string | null);
|
||||||
@@ -16,9 +11,6 @@ export interface Fhir {
|
|||||||
inputs?: Array<string>;
|
inputs?: Array<string>;
|
||||||
kind?: 'fhir';
|
kind?: 'fhir';
|
||||||
|
|
||||||
/**
|
|
||||||
* Cómo se ve en el diagrama.
|
|
||||||
*/
|
|
||||||
label?: string;
|
label?: string;
|
||||||
position?: (Position | null);
|
position?: (Position | null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
export interface FolderTrainingSource {
|
||||||
|
|
||||||
|
folder: string;
|
||||||
|
kind: 'folder';
|
||||||
|
line_hz?: 50 | 60;
|
||||||
|
}
|
||||||
@@ -2,10 +2,6 @@
|
|||||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* How the Conectar dialog drew a source: its type (core.sources) and the answers given.
|
|
||||||
* The node's dlt fields are made from them; drawn by hand ("Avanzado"), a node has none.
|
|
||||||
*/
|
|
||||||
export interface Guided {
|
export interface Guided {
|
||||||
answers?: {
|
answers?: {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
export interface Health {
|
||||||
|
dashboard_ok?: (boolean | null);
|
||||||
|
dashboard_url?: (string | null);
|
||||||
|
error?: (string | null);
|
||||||
|
expected_workers?: (number | null);
|
||||||
|
latency_ms?: (number | null);
|
||||||
|
mode: 'sync' | 'local' | 'remote';
|
||||||
|
reachable: boolean;
|
||||||
|
reference?: ({
|
||||||
|
[key: string]: any;
|
||||||
|
} | null);
|
||||||
|
scheduler: (string | null);
|
||||||
|
threads?: (number | null);
|
||||||
|
version_error?: (string | null);
|
||||||
|
versions_ok?: (boolean | null);
|
||||||
|
workers?: (number | null);
|
||||||
|
}
|
||||||
@@ -3,23 +3,14 @@
|
|||||||
|
|
||||||
import { Position } from '../models/position';
|
import { Position } from '../models/position';
|
||||||
|
|
||||||
/**
|
|
||||||
* Two inputs side by side where their columns match.
|
|
||||||
*/
|
|
||||||
export interface Join {
|
export interface Join {
|
||||||
how?: 'inner' | 'left';
|
how?: 'inner' | 'left';
|
||||||
id: string;
|
id: string;
|
||||||
inputs?: Array<string>;
|
inputs?: Array<string>;
|
||||||
kind?: 'join';
|
kind?: 'join';
|
||||||
|
|
||||||
/**
|
|
||||||
* Cómo se ve en el diagrama.
|
|
||||||
*/
|
|
||||||
label?: string;
|
label?: string;
|
||||||
|
|
||||||
/**
|
|
||||||
* Columna de la primera entrada = columna de la segunda.
|
|
||||||
*/
|
|
||||||
on: Array<[string, string]>;
|
on: Array<[string, string]>;
|
||||||
position?: (Position | null);
|
position?: (Position | null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,33 +3,16 @@
|
|||||||
|
|
||||||
import { Position } from '../models/position';
|
import { Position } from '../models/position';
|
||||||
|
|
||||||
/**
|
|
||||||
* Identity rows from every input, grouped into persons (Splink).
|
|
||||||
*
|
|
||||||
* Two records are the same person when any rule holds (Splink's SQL rule syntax, `l.`
|
|
||||||
* and `r.` for the two records); persons are the connected groups. A person whose
|
|
||||||
* records disagree on birth date or sex is held for review as a whole. Pairs Splink
|
|
||||||
* scores above `review` that ended up apart are queued as possible matches.
|
|
||||||
*/
|
|
||||||
export interface Link {
|
export interface Link {
|
||||||
fields?: Array<string>;
|
fields?: Array<string>;
|
||||||
id: string;
|
id: string;
|
||||||
inputs?: Array<string>;
|
inputs?: Array<string>;
|
||||||
kind?: 'link';
|
kind?: 'link';
|
||||||
|
|
||||||
/**
|
|
||||||
* Cómo se ve en el diagrama.
|
|
||||||
*/
|
|
||||||
label?: string;
|
label?: string;
|
||||||
position?: (Position | null);
|
position?: (Position | null);
|
||||||
|
|
||||||
/**
|
|
||||||
* Parecidos por encima de esto los ve un revisor.
|
|
||||||
*/
|
|
||||||
review?: number;
|
review?: number;
|
||||||
|
|
||||||
/**
|
|
||||||
* Vacío: las de siempre (mismo identificador, o misma fecha de nacimiento y nombre).
|
|
||||||
*/
|
|
||||||
rules?: Array<string>;
|
rules?: Array<string>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,6 @@
|
|||||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* What "Probar conexión" shows: a database's tables (the resources of `source`, built
|
|
||||||
* from `args`), or the first rows the type's own node reads (files, records).
|
|
||||||
*/
|
|
||||||
export interface Listing {
|
export interface Listing {
|
||||||
args?: {
|
args?: {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
|
|||||||
@@ -3,27 +3,14 @@
|
|||||||
|
|
||||||
import { Position } from '../models/position';
|
import { Position } from '../models/position';
|
||||||
|
|
||||||
/**
|
|
||||||
* Columns to platform fields, the site's codes translated by its ConceptMap
|
|
||||||
* (core.concept_map), and its date formats.
|
|
||||||
*/
|
|
||||||
export interface Map {
|
export interface Map {
|
||||||
|
|
||||||
/**
|
|
||||||
* La tabla de códigos del sitio.
|
|
||||||
*/
|
|
||||||
concept_map?: (string | null);
|
concept_map?: (string | null);
|
||||||
|
|
||||||
/**
|
|
||||||
* Dato de la plataforma → columna del sitio.
|
|
||||||
*/
|
|
||||||
fields: {
|
fields: {
|
||||||
[key: string]: string;
|
[key: string]: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Por ejemplo %d/%m/%Y.
|
|
||||||
*/
|
|
||||||
formats?: {
|
formats?: {
|
||||||
[key: string]: string;
|
[key: string]: string;
|
||||||
};
|
};
|
||||||
@@ -31,15 +18,9 @@ export interface Map {
|
|||||||
inputs?: Array<string>;
|
inputs?: Array<string>;
|
||||||
kind?: 'map';
|
kind?: 'map';
|
||||||
|
|
||||||
/**
|
|
||||||
* Cómo se ve en el diagrama.
|
|
||||||
*/
|
|
||||||
label?: string;
|
label?: string;
|
||||||
position?: (Position | null);
|
position?: (Position | null);
|
||||||
|
|
||||||
/**
|
|
||||||
* Un dato igual para todas las filas.
|
|
||||||
*/
|
|
||||||
values?: {
|
values?: {
|
||||||
[key: string]: string;
|
[key: string]: string;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,16 +1,10 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
import { Site } from '../models/site';
|
|
||||||
export interface Metric {
|
export interface Metric {
|
||||||
code: string;
|
code: string;
|
||||||
electrodes?: Array<Site>;
|
|
||||||
median?: (number | null);
|
|
||||||
model: (string | null);
|
model: (string | null);
|
||||||
outside: (number | null);
|
outside: (number | null);
|
||||||
p5?: (number | null);
|
|
||||||
p95?: (number | null);
|
|
||||||
value: number;
|
value: number;
|
||||||
z: (number | null);
|
z: (number | null);
|
||||||
zones?: Array<Site>;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
export interface Options {
|
||||||
|
default_mode: 'sync' | 'local' | 'remote';
|
||||||
|
schedulers: Array<string>;
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
import { Edf } from '../models/edf';
|
||||||
import { Extract } from '../models/extract';
|
import { Extract } from '../models/extract';
|
||||||
import { Fhir } from '../models/fhir';
|
import { Fhir } from '../models/fhir';
|
||||||
import { Join } from '../models/join';
|
import { Join } from '../models/join';
|
||||||
@@ -11,5 +12,5 @@ import { Route } from '../models/route';
|
|||||||
import { Source } from '../models/source';
|
import { Source } from '../models/source';
|
||||||
import { Target } from '../models/target';
|
import { Target } from '../models/target';
|
||||||
export interface Pipeline {
|
export interface Pipeline {
|
||||||
nodes: Array<(Source | Read | Route | Map | Extract | Fhir | Join | Link | Target)>;
|
nodes: Array<(Source | Read | Route | Map | Extract | Edf | Fhir | Join | Link | Target)>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
export interface PreviewAdos2 {
|
||||||
|
classification: (string | null);
|
||||||
|
css: (number | null);
|
||||||
|
evaluation_date: (string | null);
|
||||||
|
items: {
|
||||||
|
[key: string]: (number | null);
|
||||||
|
};
|
||||||
|
module: (string | null);
|
||||||
|
read: Array<string>;
|
||||||
|
titles: {
|
||||||
|
[key: string]: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
import { PreviewMetric } from '../models/preview-metric';
|
||||||
|
export interface PreviewEeg {
|
||||||
|
age_months: (number | null);
|
||||||
|
bad_channels: (number | null);
|
||||||
|
channels: (number | null);
|
||||||
|
checks: Array<{
|
||||||
|
[key: string]: any;
|
||||||
|
}>;
|
||||||
|
clean_fraction: (number | null);
|
||||||
|
duration_min: (number | null);
|
||||||
|
error: (string | null);
|
||||||
|
level: string;
|
||||||
|
line_noise_db: (number | null);
|
||||||
|
metrics: Array<PreviewMetric>;
|
||||||
|
recorded_on: (string | null);
|
||||||
|
sleep: (boolean | null);
|
||||||
|
valid: (boolean | null);
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
import { Score } from '../models/score';
|
||||||
|
import { Site } from '../models/site';
|
||||||
|
export interface PreviewMetric {
|
||||||
|
code: string;
|
||||||
|
electrodes: {
|
||||||
|
[key: string]: Site;
|
||||||
|
};
|
||||||
|
model: (string | null);
|
||||||
|
score: (Score | null);
|
||||||
|
value: (number | null);
|
||||||
|
zones: {
|
||||||
|
[key: string]: Site;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
import { PreviewAdos2 } from '../models/preview-ados-2';
|
||||||
|
import { PreviewEeg } from '../models/preview-eeg';
|
||||||
|
export interface PreviewResult {
|
||||||
|
ados2: (PreviewAdos2 | null);
|
||||||
|
eeg: PreviewEeg;
|
||||||
|
warnings: Array<string>;
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
import { PreviewResult } from '../models/preview-result';
|
||||||
|
export interface PreviewStatus {
|
||||||
|
result: (PreviewResult | null);
|
||||||
|
state: 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelling' | 'cancelled';
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
import { Tasks } from '../models/tasks';
|
||||||
|
import { Worker } from '../models/worker';
|
||||||
|
|
||||||
|
export interface Progress {
|
||||||
|
done: number;
|
||||||
|
elapsed_s: number;
|
||||||
|
eta_s: (number | null);
|
||||||
|
mode: 'sync' | 'local' | 'remote';
|
||||||
|
phase: string;
|
||||||
|
scheduler: (string | null);
|
||||||
|
tasks?: (Tasks | null);
|
||||||
|
total: number;
|
||||||
|
updated_at: string;
|
||||||
|
workers?: Array<Worker>;
|
||||||
|
}
|
||||||
@@ -2,9 +2,6 @@
|
|||||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A sign-in button's OAuth 2.0 provider (authorization code flow).
|
|
||||||
*/
|
|
||||||
export interface Provider {
|
export interface Provider {
|
||||||
authorize_params?: {
|
authorize_params?: {
|
||||||
[key: string]: string;
|
[key: string]: string;
|
||||||
|
|||||||
@@ -3,22 +3,13 @@
|
|||||||
|
|
||||||
import { Position } from '../models/position';
|
import { Position } from '../models/position';
|
||||||
|
|
||||||
/**
|
|
||||||
* Files in a column (PDF, Word, Excel, scans...) to text (MarkItDown, OCRmyPDF).
|
|
||||||
*/
|
|
||||||
export interface Read {
|
export interface Read {
|
||||||
|
|
||||||
/**
|
|
||||||
* Donde la entrada trae cada documento.
|
|
||||||
*/
|
|
||||||
column: string;
|
column: string;
|
||||||
id: string;
|
id: string;
|
||||||
inputs?: Array<string>;
|
inputs?: Array<string>;
|
||||||
kind?: 'read';
|
kind?: 'read';
|
||||||
|
|
||||||
/**
|
|
||||||
* Cómo se ve en el diagrama.
|
|
||||||
*/
|
|
||||||
label?: string;
|
label?: string;
|
||||||
position?: (Position | null);
|
position?: (Position | null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
/* eslint-disable */
|
|
||||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* One pair of the champion EEG–ADOS-2 association, for this EEG (models.tea.association).
|
|
||||||
*/
|
|
||||||
export interface Relation {
|
|
||||||
biomarker: string;
|
|
||||||
ci_high: (number | null);
|
|
||||||
ci_low: (number | null);
|
|
||||||
event: string;
|
|
||||||
kind: string;
|
|
||||||
metric: string;
|
|
||||||
model: string;
|
|
||||||
n: number;
|
|
||||||
observed?: (number | null);
|
|
||||||
odds_ratio: number;
|
|
||||||
outcome_code: string;
|
|
||||||
probability: number;
|
|
||||||
q: (number | null);
|
|
||||||
reference_probability: number;
|
|
||||||
z: number;
|
|
||||||
zone: string;
|
|
||||||
}
|
|
||||||
@@ -4,24 +4,13 @@
|
|||||||
import { Condition } from '../models/condition';
|
import { Condition } from '../models/condition';
|
||||||
import { Position } from '../models/position';
|
import { Position } from '../models/position';
|
||||||
|
|
||||||
/**
|
|
||||||
* Only the rows where every condition holds (e.g. reports titled "Citología"). An
|
|
||||||
* `otherwise` route takes the rows of its input that none of the other routes on that
|
|
||||||
* input take (documents nobody recognises, for a reviewer), then its own conditions.
|
|
||||||
*/
|
|
||||||
export interface Route {
|
export interface Route {
|
||||||
id: string;
|
id: string;
|
||||||
inputs?: Array<string>;
|
inputs?: Array<string>;
|
||||||
kind?: 'route';
|
kind?: 'route';
|
||||||
|
|
||||||
/**
|
|
||||||
* Cómo se ve en el diagrama.
|
|
||||||
*/
|
|
||||||
label?: string;
|
label?: string;
|
||||||
|
|
||||||
/**
|
|
||||||
* Recoge lo que nadie reconoce, para revisarlo.
|
|
||||||
*/
|
|
||||||
otherwise?: boolean;
|
otherwise?: boolean;
|
||||||
position?: (Position | null);
|
position?: (Position | null);
|
||||||
when?: Array<Condition>;
|
when?: Array<Condition>;
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
export interface RunSummary {
|
||||||
|
domain: (string | null);
|
||||||
|
ended: (number | null);
|
||||||
|
id: string;
|
||||||
|
job: string;
|
||||||
|
started: (number | null);
|
||||||
|
state: 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelling' | 'cancelled';
|
||||||
|
status: string;
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
import { Progress } from '../models/progress';
|
||||||
|
import { Step } from '../models/step';
|
||||||
|
export interface Run {
|
||||||
|
domain: (string | null);
|
||||||
|
ended: (number | null);
|
||||||
|
error: (string | null);
|
||||||
|
id: string;
|
||||||
|
info: Array<string>;
|
||||||
|
job: string;
|
||||||
|
outputs?: ({
|
||||||
|
[key: string]: any;
|
||||||
|
} | null);
|
||||||
|
progress: (Progress | null);
|
||||||
|
started: (number | null);
|
||||||
|
state: 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelling' | 'cancelled';
|
||||||
|
status: string;
|
||||||
|
steps: Array<Step>;
|
||||||
|
warnings: Array<string>;
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
|
||||||
|
export interface Scope {
|
||||||
|
ids?: Array<string>;
|
||||||
|
mode?: 'pending' | 'first_n' | 'ids';
|
||||||
|
n?: (number | null);
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
export interface Score {
|
||||||
|
median: (number | null);
|
||||||
|
outside: (number | null);
|
||||||
|
p5: (number | null);
|
||||||
|
p95: (number | null);
|
||||||
|
z: (number | null);
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
export interface SiteTrainingSource {
|
||||||
|
kind: 'site';
|
||||||
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
import { Score } from '../models/score';
|
||||||
export interface Site {
|
export interface Site {
|
||||||
site: string;
|
score: (Score | null);
|
||||||
value: number;
|
value: (number | null);
|
||||||
z: (number | null);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,15 +4,8 @@
|
|||||||
import { Guided } from '../models/guided';
|
import { Guided } from '../models/guided';
|
||||||
import { Position } from '../models/position';
|
import { Position } from '../models/position';
|
||||||
|
|
||||||
/**
|
|
||||||
* One table, file set or API resource, copied as it is (dlt). Merged on the source's
|
|
||||||
* own primary key or `primary_key`; replaced whole when it has none.
|
|
||||||
*/
|
|
||||||
export interface Source {
|
export interface Source {
|
||||||
|
|
||||||
/**
|
|
||||||
* Los de la fuente dlt.
|
|
||||||
*/
|
|
||||||
args?: {
|
args?: {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
};
|
};
|
||||||
@@ -21,29 +14,14 @@ export interface Source {
|
|||||||
inputs?: Array<string>;
|
inputs?: Array<string>;
|
||||||
kind?: 'source';
|
kind?: 'source';
|
||||||
|
|
||||||
/**
|
|
||||||
* Cómo se ve en el diagrama.
|
|
||||||
*/
|
|
||||||
label?: string;
|
label?: string;
|
||||||
position?: (Position | null);
|
position?: (Position | null);
|
||||||
|
|
||||||
/**
|
|
||||||
* Columnas que identifican una fila.
|
|
||||||
*/
|
|
||||||
primary_key?: Array<string>;
|
primary_key?: Array<string>;
|
||||||
|
|
||||||
/**
|
|
||||||
* Cuál, si la fuente ofrece varios (una tabla).
|
|
||||||
*/
|
|
||||||
resource?: (string | null);
|
resource?: (string | null);
|
||||||
|
|
||||||
/**
|
|
||||||
* Módulo:función de la fuente dlt.
|
|
||||||
*/
|
|
||||||
source: string;
|
source: string;
|
||||||
|
|
||||||
/**
|
|
||||||
* Transformador dlt para los archivos.
|
|
||||||
*/
|
|
||||||
then?: (string | null);
|
then?: (string | null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
export interface Step {
|
||||||
|
ended: (number | null);
|
||||||
|
key: string;
|
||||||
|
started: (number | null);
|
||||||
|
status: string;
|
||||||
|
}
|
||||||
@@ -3,23 +3,13 @@
|
|||||||
|
|
||||||
import { Position } from '../models/position';
|
import { Position } from '../models/position';
|
||||||
|
|
||||||
/**
|
|
||||||
* Rows of platform fields into one platform entity, each row given its person by the
|
|
||||||
* one `link` node among the inputs. Rule breaks are held for review.
|
|
||||||
*/
|
|
||||||
export interface Target {
|
export interface Target {
|
||||||
|
|
||||||
/**
|
|
||||||
* En qué estudio de la plataforma se guarda.
|
|
||||||
*/
|
|
||||||
entity: 'identity' | 'cervical_cytology' | 'cervical_biopsy' | 'mammography' | 'breast_biopsy' | 'breast_treatment' | 'breast_recurrence' | 'clinical_note' | 'death' | 'mchat' | 'ados2' | 'eeg';
|
entity: 'identity' | 'cervical_cytology' | 'cervical_biopsy' | 'mammography' | 'breast_biopsy' | 'breast_treatment' | 'breast_recurrence' | 'clinical_note' | 'death' | 'mchat' | 'ados2' | 'eeg';
|
||||||
id: string;
|
id: string;
|
||||||
inputs?: Array<string>;
|
inputs?: Array<string>;
|
||||||
kind?: 'target';
|
kind?: 'target';
|
||||||
|
|
||||||
/**
|
|
||||||
* Cómo se ve en el diagrama.
|
|
||||||
*/
|
|
||||||
label?: string;
|
label?: string;
|
||||||
position?: (Position | null);
|
position?: (Position | null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
export interface Tasks {
|
||||||
|
erred?: number;
|
||||||
|
memory?: number;
|
||||||
|
processing?: number;
|
||||||
|
queued?: number;
|
||||||
|
waiting?: number;
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
export interface TrainingConfig {
|
||||||
|
defaults: {
|
||||||
|
[key: string]: any;
|
||||||
|
};
|
||||||
|
domain: string;
|
||||||
|
json_schema: {
|
||||||
|
[key: string]: any;
|
||||||
|
};
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
import { FolderTrainingSource } from '../models/folder-training-source';
|
||||||
|
import { SiteTrainingSource } from '../models/site-training-source';
|
||||||
|
export type TrainingSource = (SiteTrainingSource | FolderTrainingSource);
|
||||||
|
|
||||||
@@ -1,7 +1,12 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
import { Execution } from '../models/execution';
|
||||||
|
import { TrainingSource } from '../models/training-source';
|
||||||
export interface Training {
|
export interface Training {
|
||||||
|
|
||||||
as_of?: (string | null);
|
as_of?: (string | null);
|
||||||
|
execution?: (Execution | null);
|
||||||
models?: Array<string>;
|
models?: Array<string>;
|
||||||
|
source?: (TrainingSource | null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,5 +11,6 @@ export interface Version {
|
|||||||
[key: string]: string;
|
[key: string]: string;
|
||||||
};
|
};
|
||||||
reports: Array<string>;
|
reports: Array<string>;
|
||||||
|
status: 'champion' | 'retired' | 'candidate';
|
||||||
version: number;
|
version: number;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||||
|
|
||||||
|
export interface Worker {
|
||||||
|
cpu_pct: number;
|
||||||
|
executing: number;
|
||||||
|
memory_bytes: number;
|
||||||
|
memory_limit: (number | null);
|
||||||
|
name: string;
|
||||||
|
threads: number;
|
||||||
|
}
|
||||||
@@ -3,10 +3,6 @@
|
|||||||
|
|
||||||
import { HttpRequest, HttpParameterCodec, HttpParams, HttpHeaders, HttpContext } from '@angular/common/http';
|
import { HttpRequest, HttpParameterCodec, HttpParams, HttpHeaders, HttpContext } from '@angular/common/http';
|
||||||
|
|
||||||
/**
|
|
||||||
* Custom parameter codec to correctly handle the plus sign in parameter
|
|
||||||
* values. See https://github.com/angular/angular/issues/18261
|
|
||||||
*/
|
|
||||||
class ParameterCodec implements HttpParameterCodec {
|
class ParameterCodec implements HttpParameterCodec {
|
||||||
encodeKey(key: string): string {
|
encodeKey(key: string): string {
|
||||||
return encodeURIComponent(key);
|
return encodeURIComponent(key);
|
||||||
@@ -26,17 +22,11 @@ class ParameterCodec implements HttpParameterCodec {
|
|||||||
}
|
}
|
||||||
const ParameterCodecInstance = new ParameterCodec();
|
const ParameterCodecInstance = new ParameterCodec();
|
||||||
|
|
||||||
/**
|
|
||||||
* Defines the options for appending a parameter
|
|
||||||
*/
|
|
||||||
interface ParameterOptions {
|
interface ParameterOptions {
|
||||||
style?: string;
|
style?: string;
|
||||||
explode?: boolean;
|
explode?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Base class for a parameter
|
|
||||||
*/
|
|
||||||
abstract class Parameter {
|
abstract class Parameter {
|
||||||
constructor(public name: string, public value: any, public options: ParameterOptions, defaultStyle: string, defaultExplode: boolean) {
|
constructor(public name: string, public value: any, public options: ParameterOptions, defaultStyle: string, defaultExplode: boolean) {
|
||||||
this.options = options || {};
|
this.options = options || {};
|
||||||
@@ -74,9 +64,6 @@ abstract class Parameter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* A parameter in the operation path
|
|
||||||
*/
|
|
||||||
class PathParameter extends Parameter {
|
class PathParameter extends Parameter {
|
||||||
constructor(name: string, value: any, options: ParameterOptions) {
|
constructor(name: string, value: any, options: ParameterOptions) {
|
||||||
super(name, value, options, 'simple', false);
|
super(name, value, options, 'simple', false);
|
||||||
@@ -91,24 +78,20 @@ class PathParameter extends Parameter {
|
|||||||
let separator = this.options.explode ? prefix === '' ? ',' : prefix : ',';
|
let separator = this.options.explode ? prefix === '' ? ',' : prefix : ',';
|
||||||
let alreadySerialized = false;
|
let alreadySerialized = false;
|
||||||
if (this.options.style === 'matrix') {
|
if (this.options.style === 'matrix') {
|
||||||
// The parameter name is just used as prefix, except in some cases...
|
|
||||||
prefix = `;${this.name}=`;
|
prefix = `;${this.name}=`;
|
||||||
if (this.options.explode && typeof value === 'object') {
|
if (this.options.explode && typeof value === 'object') {
|
||||||
prefix = ';';
|
prefix = ';';
|
||||||
if (value instanceof Array) {
|
if (value instanceof Array) {
|
||||||
// For arrays we have to repeat the name for each element
|
|
||||||
value = value.map(v => `${this.name}=${this.serializeValue(v, ';')}`);
|
value = value.map(v => `${this.name}=${this.serializeValue(v, ';')}`);
|
||||||
value = value.join(';');
|
value = value.join(';');
|
||||||
alreadySerialized = true;
|
alreadySerialized = true;
|
||||||
} else {
|
} else {
|
||||||
// For objects we have to put each the key / value pairs
|
|
||||||
value = this.serializeValue(value, ';');
|
value = this.serializeValue(value, ';');
|
||||||
alreadySerialized = true
|
alreadySerialized = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
value = prefix + (alreadySerialized ? value : this.serializeValue(value, separator));
|
value = prefix + (alreadySerialized ? value : this.serializeValue(value, separator));
|
||||||
// Replace both the plain variable and the corresponding variant taking in the prefix and explode into account
|
|
||||||
path = path.replace(`{${this.name}}`, value);
|
path = path.replace(`{${this.name}}`, value);
|
||||||
path = path.replace(`{${prefix}${this.name}${this.options.explode ? '*' : ''}}`, value);
|
path = path.replace(`{${prefix}${this.name}${this.options.explode ? '*' : ''}}`, value);
|
||||||
return path;
|
return path;
|
||||||
@@ -124,9 +107,6 @@ class PathParameter extends Parameter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* A parameter in the query
|
|
||||||
*/
|
|
||||||
class QueryParameter extends Parameter {
|
class QueryParameter extends Parameter {
|
||||||
constructor(name: string, value: any, options: ParameterOptions) {
|
constructor(name: string, value: any, options: ParameterOptions) {
|
||||||
super(name, value, options, 'form', true);
|
super(name, value, options, 'form', true);
|
||||||
@@ -134,7 +114,6 @@ class QueryParameter extends Parameter {
|
|||||||
|
|
||||||
append(params: HttpParams): HttpParams {
|
append(params: HttpParams): HttpParams {
|
||||||
if (this.value instanceof Array) {
|
if (this.value instanceof Array) {
|
||||||
// Array serialization
|
|
||||||
if (this.options.explode) {
|
if (this.options.explode) {
|
||||||
for (const v of this.value) {
|
for (const v of this.value) {
|
||||||
params = params.append(this.name, this.serializeValue(v));
|
params = params.append(this.name, this.serializeValue(v));
|
||||||
@@ -146,9 +125,7 @@ class QueryParameter extends Parameter {
|
|||||||
return params.append(this.name, this.serializeValue(this.value, separator));
|
return params.append(this.name, this.serializeValue(this.value, separator));
|
||||||
}
|
}
|
||||||
} else if (this.value !== null && typeof this.value === 'object') {
|
} else if (this.value !== null && typeof this.value === 'object') {
|
||||||
// Object serialization
|
|
||||||
if (this.options.style === 'deepObject') {
|
if (this.options.style === 'deepObject') {
|
||||||
// Append a parameter for each key, in the form `name[key]`
|
|
||||||
for (const key of Object.keys(this.value)) {
|
for (const key of Object.keys(this.value)) {
|
||||||
const propVal = this.value[key];
|
const propVal = this.value[key];
|
||||||
if (propVal !== null && propVal !== undefined) {
|
if (propVal !== null && propVal !== undefined) {
|
||||||
@@ -156,7 +133,6 @@ class QueryParameter extends Parameter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (this.options.explode) {
|
} else if (this.options.explode) {
|
||||||
// Append a parameter for each key without using the parameter name
|
|
||||||
for (const key of Object.keys(this.value)) {
|
for (const key of Object.keys(this.value)) {
|
||||||
const propVal = this.value[key];
|
const propVal = this.value[key];
|
||||||
if (propVal !== null && propVal !== undefined) {
|
if (propVal !== null && propVal !== undefined) {
|
||||||
@@ -164,7 +140,6 @@ class QueryParameter extends Parameter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Append a single parameter whose values are a comma-separated list of key,value,key,value...
|
|
||||||
const array: any[] = [];
|
const array: any[] = [];
|
||||||
for (const key of Object.keys(this.value)) {
|
for (const key of Object.keys(this.value)) {
|
||||||
const propVal = this.value[key];
|
const propVal = this.value[key];
|
||||||
@@ -176,16 +151,12 @@ class QueryParameter extends Parameter {
|
|||||||
params = params.append(this.name, this.serializeValue(array));
|
params = params.append(this.name, this.serializeValue(array));
|
||||||
}
|
}
|
||||||
} else if (this.value !== null && this.value !== undefined) {
|
} else if (this.value !== null && this.value !== undefined) {
|
||||||
// Plain value
|
|
||||||
params = params.append(this.name, this.serializeValue(this.value));
|
params = params.append(this.name, this.serializeValue(this.value));
|
||||||
}
|
}
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* A parameter in the HTTP request header
|
|
||||||
*/
|
|
||||||
class HeaderParameter extends Parameter {
|
class HeaderParameter extends Parameter {
|
||||||
constructor(name: string, value: any, options: ParameterOptions) {
|
constructor(name: string, value: any, options: ParameterOptions) {
|
||||||
super(name, value, options, 'simple', false);
|
super(name, value, options, 'simple', false);
|
||||||
@@ -205,9 +176,6 @@ class HeaderParameter extends Parameter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper to build http requests from parameters
|
|
||||||
*/
|
|
||||||
export class RequestBuilder {
|
export class RequestBuilder {
|
||||||
|
|
||||||
private _path = new Map<string, PathParameter>();
|
private _path = new Map<string, PathParameter>();
|
||||||
@@ -222,30 +190,18 @@ export class RequestBuilder {
|
|||||||
public method: string) {
|
public method: string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets a path parameter
|
|
||||||
*/
|
|
||||||
path(name: string, value: any, options?: ParameterOptions): void {
|
path(name: string, value: any, options?: ParameterOptions): void {
|
||||||
this._path.set(name, new PathParameter(name, value, options || {}));
|
this._path.set(name, new PathParameter(name, value, options || {}));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets a query parameter
|
|
||||||
*/
|
|
||||||
query(name: string, value: any, options?: ParameterOptions): void {
|
query(name: string, value: any, options?: ParameterOptions): void {
|
||||||
this._query.set(name, new QueryParameter(name, value, options || {}));
|
this._query.set(name, new QueryParameter(name, value, options || {}));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets a header parameter
|
|
||||||
*/
|
|
||||||
header(name: string, value: any, options?: ParameterOptions): void {
|
header(name: string, value: any, options?: ParameterOptions): void {
|
||||||
this._header.set(name, new HeaderParameter(name, value, options || {}));
|
this._header.set(name, new HeaderParameter(name, value, options || {}));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the body content, along with the content type
|
|
||||||
*/
|
|
||||||
body(value: any, contentType = 'application/json'): void {
|
body(value: any, contentType = 'application/json'): void {
|
||||||
if (value instanceof Blob) {
|
if (value instanceof Blob) {
|
||||||
this._bodyContentType = value.type;
|
this._bodyContentType = value.type;
|
||||||
@@ -253,7 +209,6 @@ export class RequestBuilder {
|
|||||||
this._bodyContentType = contentType;
|
this._bodyContentType = contentType;
|
||||||
}
|
}
|
||||||
if (this._bodyContentType === 'application/x-www-form-urlencoded' && value !== null && typeof value === 'object') {
|
if (this._bodyContentType === 'application/x-www-form-urlencoded' && value !== null && typeof value === 'object') {
|
||||||
// Handle URL-encoded data
|
|
||||||
const pairs: Array<[string, string]> = [];
|
const pairs: Array<[string, string]> = [];
|
||||||
for (const key of Object.keys(value)) {
|
for (const key of Object.keys(value)) {
|
||||||
let val = value[key];
|
let val = value[key];
|
||||||
@@ -269,7 +224,6 @@ export class RequestBuilder {
|
|||||||
}
|
}
|
||||||
this._bodyContent = pairs.map(p => `${encodeURIComponent(p[0])}=${encodeURIComponent(p[1])}`).join('&');
|
this._bodyContent = pairs.map(p => `${encodeURIComponent(p[0])}=${encodeURIComponent(p[1])}`).join('&');
|
||||||
} else if (this._bodyContentType === 'multipart/form-data') {
|
} else if (this._bodyContentType === 'multipart/form-data') {
|
||||||
// Handle multipart form data
|
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
if (value !== null && value !== undefined) {
|
if (value !== null && value !== undefined) {
|
||||||
for (const key of Object.keys(value)) {
|
for (const key of Object.keys(value)) {
|
||||||
@@ -291,7 +245,6 @@ export class RequestBuilder {
|
|||||||
}
|
}
|
||||||
this._bodyContent = formData;
|
this._bodyContent = formData;
|
||||||
} else {
|
} else {
|
||||||
// The body is the plain content
|
|
||||||
this._bodyContent = value;
|
this._bodyContent = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -309,33 +262,24 @@ export class RequestBuilder {
|
|||||||
return String(value);
|
return String(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Builds the request with the current set parameters
|
|
||||||
*/
|
|
||||||
build<T = any>(options?: {
|
build<T = any>(options?: {
|
||||||
/** Which content types to accept */
|
|
||||||
accept?: string;
|
accept?: string;
|
||||||
|
|
||||||
/** The expected response type */
|
|
||||||
responseType?: 'json' | 'text' | 'blob' | 'arraybuffer';
|
responseType?: 'json' | 'text' | 'blob' | 'arraybuffer';
|
||||||
|
|
||||||
/** Whether to report progress on uploads / downloads */
|
|
||||||
reportProgress?: boolean;
|
reportProgress?: boolean;
|
||||||
|
|
||||||
/** Allow passing HttpContext for HttpClient */
|
|
||||||
context?: HttpContext;
|
context?: HttpContext;
|
||||||
}): HttpRequest<T> {
|
}): HttpRequest<T> {
|
||||||
|
|
||||||
options = options || {};
|
options = options || {};
|
||||||
|
|
||||||
// Path parameters
|
|
||||||
let path = this.operationPath;
|
let path = this.operationPath;
|
||||||
for (const pathParam of this._path.values()) {
|
for (const pathParam of this._path.values()) {
|
||||||
path = pathParam.append(path);
|
path = pathParam.append(path);
|
||||||
}
|
}
|
||||||
const url = this.rootUrl + path;
|
const url = this.rootUrl + path;
|
||||||
|
|
||||||
// Query parameters
|
|
||||||
let httpParams = new HttpParams({
|
let httpParams = new HttpParams({
|
||||||
encoder: ParameterCodecInstance
|
encoder: ParameterCodecInstance
|
||||||
});
|
});
|
||||||
@@ -343,7 +287,6 @@ export class RequestBuilder {
|
|||||||
httpParams = queryParam.append(httpParams);
|
httpParams = queryParam.append(httpParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Header parameters
|
|
||||||
let httpHeaders = new HttpHeaders();
|
let httpHeaders = new HttpHeaders();
|
||||||
if (options.accept) {
|
if (options.accept) {
|
||||||
httpHeaders = httpHeaders.append('Accept', options.accept);
|
httpHeaders = httpHeaders.append('Accept', options.accept);
|
||||||
@@ -352,12 +295,10 @@ export class RequestBuilder {
|
|||||||
httpHeaders = headerParam.append(httpHeaders);
|
httpHeaders = headerParam.append(httpHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request content headers
|
|
||||||
if (this._bodyContentType && !(this._bodyContent instanceof FormData)) {
|
if (this._bodyContentType && !(this._bodyContent instanceof FormData)) {
|
||||||
httpHeaders = httpHeaders.set('Content-Type', this._bodyContentType);
|
httpHeaders = httpHeaders.set('Content-Type', this._bodyContentType);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Perform the request
|
|
||||||
return new HttpRequest<T>(this.method.toUpperCase(), url, this._bodyContent, {
|
return new HttpRequest<T>(this.method.toUpperCase(), url, this._bodyContent, {
|
||||||
params: httpParams,
|
params: httpParams,
|
||||||
headers: httpHeaders,
|
headers: httpHeaders,
|
||||||
|
|||||||
@@ -3,9 +3,6 @@
|
|||||||
|
|
||||||
import { HttpResponse } from '@angular/common/http';
|
import { HttpResponse } from '@angular/common/http';
|
||||||
|
|
||||||
/**
|
|
||||||
* Constrains the http response to not have the body defined as `T | null`, but `T` only.
|
|
||||||
*/
|
|
||||||
export type StrictHttpResponse<T> = HttpResponse<T> & {
|
export type StrictHttpResponse<T> = HttpResponse<T> & {
|
||||||
readonly body: T;
|
readonly body: T;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ export const appConfig: ApplicationConfig = {
|
|||||||
provideRouter(routes, withComponentInputBinding()),
|
provideRouter(routes, withComponentInputBinding()),
|
||||||
provideHttpClient(),
|
provideHttpClient(),
|
||||||
provideApiConfiguration('/api'),
|
provideApiConfiguration('/api'),
|
||||||
// Icons are the Material Symbols font served with the app.
|
|
||||||
provideAppInitializer(() => {
|
provideAppInitializer(() => {
|
||||||
inject(MatIconRegistry).setDefaultFontSetClass('material-symbols-outlined');
|
inject(MatIconRegistry).setDefaultFontSetClass('material-symbols-outlined');
|
||||||
}),
|
}),
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user