Compare commits
29 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9639423a32 | |||
| 1fe88dfb45 | |||
| 9cc67c0ef2 | |||
| 1eda9eea29 | |||
| 2cf3a5a40d | |||
| 30946823c4 | |||
| d946228319 | |||
| 8cb3c97b80 | |||
| 1fc23bd0bd | |||
| 11337679dc | |||
| 4685a91a7c | |||
| 69afcc7fdb | |||
| 9fcc65d84f | |||
| c4faa7d9f6 | |||
| 98d0614d80 | |||
| 35e1bc33d3 | |||
| f96fe97ed6 | |||
| fe9442237b | |||
| 61cdf5b72e | |||
| 37c4eacf84 | |||
| 41be0c343f | |||
| ecf2778f1a | |||
| 9c012e9bb4 | |||
| 91832cc6ff | |||
| ea91b31b17 | |||
| ae5e4c5db5 | |||
| b1c4b78f32 | |||
| a66205b725 | |||
| 3605d23fc0 |
+4
-3
@@ -1,3 +1,4 @@
|
||||
node_modules
|
||||
dist
|
||||
.angular
|
||||
node_modules/
|
||||
dist/
|
||||
.angular/
|
||||
.git/
|
||||
|
||||
+5
-3
@@ -43,6 +43,8 @@ __screenshots__/
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# Playwright
|
||||
/test-results/
|
||||
/playwright-report/
|
||||
# Temporary UX reports and one-off static checks
|
||||
/UX-*-informe.md
|
||||
/scripts/ux06b-resources.test.mjs
|
||||
/scripts/ux06c-presentation.test.mjs
|
||||
/scripts/ux06d-presentation.test.mjs
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
src/app/api/
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
{
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846
|
||||
"recommendations": ["angular.ng-template"]
|
||||
}
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
{
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "ng serve",
|
||||
"type": "chrome",
|
||||
"request": "launch",
|
||||
"preLaunchTask": "npm: start",
|
||||
"url": "http://localhost:4200/"
|
||||
},
|
||||
{
|
||||
"name": "ng test",
|
||||
"type": "chrome",
|
||||
"request": "launch",
|
||||
"preLaunchTask": "npm: test",
|
||||
"url": "http://localhost:9876/debug.html"
|
||||
}
|
||||
]
|
||||
}
|
||||
Vendored
+42
@@ -0,0 +1,42 @@
|
||||
{
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"type": "npm",
|
||||
"script": "start",
|
||||
"isBackground": true,
|
||||
"problemMatcher": {
|
||||
"owner": "typescript",
|
||||
"pattern": "$tsc",
|
||||
"background": {
|
||||
"activeOnStart": true,
|
||||
"beginsPattern": {
|
||||
"regexp": "Changes detected"
|
||||
},
|
||||
"endsPattern": {
|
||||
"regexp": "bundle generation (complete|failed)"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "npm",
|
||||
"script": "test",
|
||||
"isBackground": true,
|
||||
"problemMatcher": {
|
||||
"owner": "typescript",
|
||||
"pattern": "$tsc",
|
||||
"background": {
|
||||
"activeOnStart": true,
|
||||
"beginsPattern": {
|
||||
"regexp": "Changes detected"
|
||||
},
|
||||
"endsPattern": {
|
||||
"regexp": "bundle generation (complete|failed)"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+9
-9
@@ -1,10 +1,10 @@
|
||||
FROM node:24-alpine AS build
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
COPY . .
|
||||
RUN npx ng build
|
||||
FROM node:22-slim
|
||||
|
||||
FROM nginx:1.29-alpine
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY --from=build /app/dist/webapp/browser /usr/share/nginx/html
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json* ./
|
||||
RUN npm install
|
||||
|
||||
COPY . .
|
||||
|
||||
EXPOSE 4200
|
||||
CMD ["npx", "ng", "serve", "--host", "0.0.0.0", "--port", "4200"]
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
# WebApp
|
||||
|
||||
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 22.1.8.
|
||||
|
||||
## Development server
|
||||
|
||||
To start a local development server, run:
|
||||
|
||||
```bash
|
||||
ng serve
|
||||
```
|
||||
|
||||
Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files.
|
||||
|
||||
## Code scaffolding
|
||||
|
||||
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
||||
|
||||
```bash
|
||||
ng generate component component-name
|
||||
```
|
||||
|
||||
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
||||
|
||||
```bash
|
||||
ng generate --help
|
||||
```
|
||||
|
||||
## Building
|
||||
|
||||
To build the project run:
|
||||
|
||||
```bash
|
||||
ng build
|
||||
```
|
||||
|
||||
This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed.
|
||||
|
||||
## Running unit tests
|
||||
|
||||
To execute unit tests with the [Vitest](https://vitest.dev/) test runner, use the following command:
|
||||
|
||||
```bash
|
||||
ng test
|
||||
```
|
||||
|
||||
## Running end-to-end tests
|
||||
|
||||
For end-to-end (e2e) testing, run:
|
||||
|
||||
```bash
|
||||
ng e2e
|
||||
```
|
||||
|
||||
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
||||
|
||||
## Additional Resources
|
||||
|
||||
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
||||
+7
-15
@@ -2,11 +2,12 @@
|
||||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||
"version": 1,
|
||||
"cli": {
|
||||
"packageManager": "npm"
|
||||
"packageManager": "npm",
|
||||
"analytics": false
|
||||
},
|
||||
"newProjectRoot": "projects",
|
||||
"projects": {
|
||||
"webapp": {
|
||||
"WebApp": {
|
||||
"projectType": "application",
|
||||
"schematics": {
|
||||
"@schematics/angular:component": {
|
||||
@@ -30,17 +31,7 @@
|
||||
}
|
||||
],
|
||||
"styles": [
|
||||
"@fontsource/roboto/300.css",
|
||||
"@fontsource/roboto/400.css",
|
||||
"@fontsource/roboto/500.css",
|
||||
"@fontsource/roboto/700.css",
|
||||
"@fontsource/rajdhani/500.css",
|
||||
"@fontsource/rajdhani/600.css",
|
||||
"material-symbols/outlined.css",
|
||||
"src/styles.scss"
|
||||
],
|
||||
"allowedCommonJsDependencies": [
|
||||
"plotly.js-cartesian-dist-min"
|
||||
]
|
||||
},
|
||||
"configurations": {
|
||||
@@ -48,7 +39,7 @@
|
||||
"budgets": [
|
||||
{
|
||||
"type": "initial",
|
||||
"maximumWarning": "600kB",
|
||||
"maximumWarning": "500kB",
|
||||
"maximumError": "1MB"
|
||||
},
|
||||
{
|
||||
@@ -69,12 +60,13 @@
|
||||
},
|
||||
"serve": {
|
||||
"builder": "@angular/build:dev-server",
|
||||
"options": { "proxyConfig": "proxy.conf.json" },
|
||||
"configurations": {
|
||||
"production": {
|
||||
"buildTarget": "webapp:build:production"
|
||||
"buildTarget": "WebApp:build:production"
|
||||
},
|
||||
"development": {
|
||||
"buildTarget": "webapp:build:development"
|
||||
"buildTarget": "WebApp:build:development"
|
||||
}
|
||||
},
|
||||
"defaultConfiguration": "development"
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
import { expect, Page, test } from '@playwright/test';
|
||||
|
||||
/** Every page loads from the API with no failed request and no console error. */
|
||||
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;
|
||||
}
|
||||
|
||||
test("indicators: the KPIs are the API's MeasureReports, every tab and the patient view load", async ({
|
||||
page,
|
||||
}) => {
|
||||
const problems = watch(page);
|
||||
const report = page.waitForResponse(
|
||||
(r) =>
|
||||
r.url().includes('MeasureReport') &&
|
||||
r.url().includes('measure=cacu-eu7') &&
|
||||
!r.url().includes('%2C'),
|
||||
);
|
||||
await page.goto('/indicadores/cacu');
|
||||
const eu7 = await (await report).json();
|
||||
const count = eu7.entry[0].resource.group[0].population.find(
|
||||
(p: any) => p.code.coding[0].code === 'initial-population',
|
||||
).count;
|
||||
await expect(page.locator('[data-measure="CACU_EU7"] .kpi-value')).toHaveText(String(count));
|
||||
await expect(page.locator('app-tab-indicadores app-plot').first()).toBeVisible();
|
||||
|
||||
await page.getByRole('tab', { name: 'Trazabilidad' }).click();
|
||||
await expect(page.locator('app-tab-trazabilidad mat-card')).toHaveCount(14);
|
||||
|
||||
await page.getByRole('tab', { name: 'Datos y definiciones' }).click();
|
||||
await expect(page.locator('app-tab-definiciones tbody tr')).toHaveCount(14);
|
||||
|
||||
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 first = bundle.entry.find((e: any) => e.search.mode === 'match').resource.id;
|
||||
const rows = page.locator('table.worklist tbody tr');
|
||||
await expect(rows).toHaveCount(Math.min(20, bundle.total));
|
||||
await expect(rows.first().locator('a.id')).toHaveText(first.slice(0, 10));
|
||||
await page.getByRole('button', { name: 'Siguiente' }).click();
|
||||
await expect(page.getByText(`21–`)).toBeVisible();
|
||||
|
||||
await page.getByRole('button', { name: 'Anterior' }).click();
|
||||
await rows.first().locator('a.id').click();
|
||||
await expect(page.getByText('Historial médico')).toBeVisible();
|
||||
await expect(page.getByText('Pruebas y resultados')).toBeVisible();
|
||||
await expect(
|
||||
page.locator('app-paciente table').nth(1).locator('tbody tr').first(),
|
||||
).not.toContainText('Sin estudios');
|
||||
|
||||
await page.goto('/indicadores/cama');
|
||||
await expect(page.getByText('todavía no tiene indicadores')).toBeVisible();
|
||||
expect(problems).toEqual([]);
|
||||
});
|
||||
|
||||
test('conectar: open the hospital pipeline, preview a source, run it to success', async ({
|
||||
page,
|
||||
}) => {
|
||||
const problems = watch(page);
|
||||
await page.goto('/conectar');
|
||||
await page.getByText('cacu', { exact: true }).click();
|
||||
await expect(page.locator('vflow')).toBeVisible();
|
||||
await page.getByText('Fuente · Patients').click();
|
||||
await expect(page.locator('formly-form')).toBeVisible();
|
||||
await page.getByRole('button', { name: 'Vista previa' }).click();
|
||||
await expect(page.locator('.preview tr[mat-row]').first()).toBeVisible();
|
||||
await page.getByRole('button', { name: 'Ejecutar' }).click();
|
||||
await expect(page.getByText('SUCCESS')).toBeVisible({ timeout: 10 * 60_000 });
|
||||
expect(problems).toEqual([]);
|
||||
});
|
||||
|
||||
test('revision: what the messy site holds, and a decision through the page', async ({ page }) => {
|
||||
const problems = watch(page);
|
||||
await page.goto('/revision');
|
||||
await page.getByRole('tab', { name: 'Personas' }).click();
|
||||
await page.locator('mat-form-field', { hasText: 'Canalización' }).click();
|
||||
await page.getByRole('option', { name: 'site', exact: true }).click();
|
||||
await expect(page.getByText(/Posibles pacientes duplicadas \([1-9]/)).toBeVisible();
|
||||
await page.getByRole('button', { name: 'Distintas' }).first().click();
|
||||
await expect(page.getByText('Decisión registrada.')).toBeVisible();
|
||||
expect(problems).toEqual([]);
|
||||
});
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"$schema": "node_modules/ng-openapi-gen/ng-openapi-gen-schema.json",
|
||||
"input": "openapi.json",
|
||||
"output": "src/app/api",
|
||||
"ignoreUnusedModels": false
|
||||
}
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
server {
|
||||
listen 80;
|
||||
root /usr/share/nginx/html;
|
||||
location /api/ {
|
||||
proxy_pass http://api:8000/;
|
||||
proxy_read_timeout 30s;
|
||||
}
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
-3163
File diff suppressed because it is too large
Load Diff
Generated
+2698
-2364
File diff suppressed because it is too large
Load Diff
+17
-34
@@ -1,52 +1,35 @@
|
||||
{
|
||||
"name": "webapp",
|
||||
"name": "web-app",
|
||||
"version": "0.0.0",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"start": "ng serve --proxy-config proxy.conf.json",
|
||||
"start": "ng serve",
|
||||
"build": "ng build",
|
||||
"watch": "ng build --watch --configuration development",
|
||||
"test": "ng test",
|
||||
"api": "ng-openapi-gen -c ng-openapi-gen.json"
|
||||
"test": "ng test"
|
||||
},
|
||||
"private": true,
|
||||
"packageManager": "npm@11.20.0",
|
||||
"packageManager": "npm@11.17.0",
|
||||
"dependencies": {
|
||||
"@angular/cdk": "^22.3.0",
|
||||
"@angular/common": "^22.3.0",
|
||||
"@angular/compiler": "^22.3.0",
|
||||
"@angular/core": "^22.3.0",
|
||||
"@angular/forms": "^22.3.0",
|
||||
"@angular/material": "^22.3.0",
|
||||
"@angular/platform-browser": "^22.3.0",
|
||||
"@angular/router": "^22.3.0",
|
||||
"@fontsource/rajdhani": "5.3.0",
|
||||
"@fontsource/roboto": "5.3.0",
|
||||
"@ngx-formly/core": "11.2.0",
|
||||
"@ngx-formly/material": "11.2.0",
|
||||
"d3-drag": "3.0.0",
|
||||
"d3-selection": "3.0.0",
|
||||
"d3-zoom": "3.0.0",
|
||||
"material-symbols": "0.48.3",
|
||||
"ngx-vflow": "2.7.0",
|
||||
"@angular/cdk": "^22.1.7",
|
||||
"@angular/common": "^22.1.0",
|
||||
"@angular/compiler": "^22.1.0",
|
||||
"@angular/core": "^22.1.0",
|
||||
"@angular/forms": "^22.1.0",
|
||||
"@angular/material": "^22.1.7",
|
||||
"@angular/platform-browser": "^22.1.0",
|
||||
"@angular/router": "^22.1.0",
|
||||
"plotly.js-cartesian-dist-min": "4.1.2",
|
||||
"rxjs": "~7.8.0",
|
||||
"tslib": "^2.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular/build": "^22.3.0",
|
||||
"@angular/cli": "^22.3.0",
|
||||
"@angular/compiler-cli": "^22.3.0",
|
||||
"@playwright/test": "1.64.1",
|
||||
"@types/d3-drag": "3.0.7",
|
||||
"@types/d3-selection": "3.0.13",
|
||||
"@types/d3-zoom": "3.0.9",
|
||||
"@types/fhir": "0.0.44",
|
||||
"@types/plotly.js": "3.0.15",
|
||||
"jsdom": "^31.0.0",
|
||||
"ng-openapi-gen": "^1.1.0",
|
||||
"@angular/build": "^22.1.8",
|
||||
"@angular/cli": "^22.1.8",
|
||||
"@angular/compiler-cli": "^22.1.0",
|
||||
"jsdom": "^28.0.0",
|
||||
"prettier": "^3.8.1",
|
||||
"typescript": "~6.0.2",
|
||||
"vitest": "^5.0.0"
|
||||
"vitest": "^4.0.8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
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({
|
||||
testDir: 'e2e',
|
||||
timeout: 15 * 60_000,
|
||||
expect: { timeout: 60_000 },
|
||||
workers: 1,
|
||||
reporter: 'list',
|
||||
use: {
|
||||
baseURL: 'http://127.0.0.1:4310',
|
||||
viewport: { width: 1440, height: 1000 },
|
||||
actionTimeout: 60_000, // a stuck step fails, not the whole run
|
||||
},
|
||||
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',
|
||||
env: { NG_CLI_ANALYTICS: 'false' },
|
||||
url: 'http://127.0.0.1:4310',
|
||||
timeout: 180_000,
|
||||
reuseExistingServer: false,
|
||||
},
|
||||
});
|
||||
+6
-1
@@ -1 +1,6 @@
|
||||
{ "/api": { "target": "http://127.0.0.1:5711", "pathRewrite": { "^/api": "" } } }
|
||||
{
|
||||
"/tea/**": { "target": "http://127.0.0.1:5000", "secure": false },
|
||||
"/cacu/**": { "target": "http://127.0.0.1:5000", "secure": false },
|
||||
"/cama/**": { "target": "http://127.0.0.1:5000", "secure": false },
|
||||
"/health": { "target": "http://127.0.0.1:5000", "secure": false }
|
||||
}
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
// `/api` to the API the e2e run started (API_URL).
|
||||
export default { '/api': { target: process.env.API_URL, pathRewrite: { '^/api': '' } } };
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 717 B After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
@@ -1,137 +0,0 @@
|
||||
// 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 '@angular/material' as mat;
|
||||
|
||||
// Note: Color palettes are generated from primary: #a8c243, tertiary: #5f9ea0
|
||||
$_palettes: (
|
||||
primary: (
|
||||
0: #000000,
|
||||
10: #171e00,
|
||||
20: #2a3400,
|
||||
25: #344000,
|
||||
30: #3e4c00,
|
||||
35: #495900,
|
||||
40: #546500,
|
||||
50: #6a8000,
|
||||
60: #829a1c,
|
||||
70: #9cb638,
|
||||
80: #b7d251,
|
||||
90: #d3ef6a,
|
||||
95: #e1fd77,
|
||||
98: #f5ffc6,
|
||||
99: #faffe3,
|
||||
100: #ffffff,
|
||||
),
|
||||
secondary: (
|
||||
0: #000000,
|
||||
10: #171e00,
|
||||
20: #2b3407,
|
||||
25: #363f12,
|
||||
30: #414b1c,
|
||||
35: #4d5727,
|
||||
40: #596332,
|
||||
50: #717c48,
|
||||
60: #8b965f,
|
||||
70: #a5b177,
|
||||
80: #c1cc90,
|
||||
90: #dde9aa,
|
||||
95: #ebf7b7,
|
||||
98: #f5ffc6,
|
||||
99: #faffe3,
|
||||
100: #ffffff,
|
||||
),
|
||||
tertiary: (
|
||||
0: #000000,
|
||||
10: #002021,
|
||||
20: #003738,
|
||||
25: #004345,
|
||||
30: #004f51,
|
||||
35: #145b5e,
|
||||
40: #25686a,
|
||||
50: #418183,
|
||||
60: #5c9b9d,
|
||||
70: #77b6b8,
|
||||
80: #92d2d3,
|
||||
90: #aeeef0,
|
||||
95: #bcfcfe,
|
||||
98: #e3ffff,
|
||||
99: #f1ffff,
|
||||
100: #ffffff,
|
||||
),
|
||||
neutral: (
|
||||
0: #000000,
|
||||
10: #1b1c14,
|
||||
20: #303128,
|
||||
25: #3b3c32,
|
||||
30: #46483d,
|
||||
35: #525348,
|
||||
40: #5e5f54,
|
||||
50: #77786c,
|
||||
60: #919285,
|
||||
70: #acac9f,
|
||||
80: #c7c7b9,
|
||||
90: #e4e3d5,
|
||||
95: #f2f2e3,
|
||||
98: #fbfaeb,
|
||||
99: #fdfdf5,
|
||||
100: #ffffff,
|
||||
4: #0d0f07,
|
||||
6: #13140c,
|
||||
12: #1f2017,
|
||||
17: #292b21,
|
||||
22: #34362c,
|
||||
24: #393a30,
|
||||
87: #dbdbcd,
|
||||
92: #e9e9da,
|
||||
94: #efefe0,
|
||||
96: #f5f4e6,
|
||||
),
|
||||
neutral-variant: (
|
||||
0: #000000,
|
||||
10: #1a1d0f,
|
||||
20: #2f3222,
|
||||
25: #3a3d2d,
|
||||
30: #454837,
|
||||
35: #515442,
|
||||
40: #5d604e,
|
||||
50: #767965,
|
||||
60: #90927e,
|
||||
70: #aaad98,
|
||||
80: #c6c8b2,
|
||||
90: #e2e4cd,
|
||||
95: #f1f3db,
|
||||
98: #f9fbe3,
|
||||
99: #fcfdf1,
|
||||
100: #ffffff,
|
||||
),
|
||||
error: (
|
||||
0: #000000,
|
||||
10: #410002,
|
||||
20: #690005,
|
||||
25: #7e0007,
|
||||
30: #93000a,
|
||||
35: #a80710,
|
||||
40: #ba1a1a,
|
||||
50: #de3730,
|
||||
60: #ff5449,
|
||||
70: #ff897d,
|
||||
80: #ffb4ab,
|
||||
90: #ffdad6,
|
||||
95: #ffedea,
|
||||
98: #fff8f7,
|
||||
99: #fffbff,
|
||||
100: #ffffff,
|
||||
),
|
||||
);
|
||||
|
||||
$_rest: (
|
||||
secondary: map.get($_palettes, secondary),
|
||||
neutral: map.get($_palettes, neutral),
|
||||
neutral-variant: map.get($_palettes, neutral-variant),
|
||||
error: map.get($_palettes, error),
|
||||
);
|
||||
|
||||
$primary-palette: map.merge(map.get($_palettes, primary), $_rest);
|
||||
$tertiary-palette: map.merge(map.get($_palettes, tertiary), $_rest);
|
||||
@@ -1,27 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
/**
|
||||
* Provides the ApiConfiguration configuration object with a given root URL.
|
||||
*/
|
||||
export function provideApiConfiguration(rootUrl: string) {
|
||||
var config = new ApiConfiguration();
|
||||
config.rootUrl = rootUrl;
|
||||
return {
|
||||
provide: ApiConfiguration,
|
||||
useValue: config
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Global configuration
|
||||
*/
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class ApiConfiguration {
|
||||
rootUrl: string = '';
|
||||
}
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
|
||||
import { Observable, firstValueFrom } from 'rxjs';
|
||||
import { filter, map } from 'rxjs/operators';
|
||||
import { ApiConfiguration } from './api-configuration';
|
||||
import { StrictHttpResponse } from './strict-http-response';
|
||||
|
||||
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>>;
|
||||
|
||||
/**
|
||||
* Helper service to call API functions directly
|
||||
*/
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class Api {
|
||||
constructor(
|
||||
private config: ApiConfiguration,
|
||||
private http: HttpClient
|
||||
) {
|
||||
}
|
||||
|
||||
private _rootUrl?: string;
|
||||
|
||||
/**
|
||||
* Returns the root url for API operations. If not set directly here,
|
||||
* will fallback to `ApiConfiguration.rootUrl`.
|
||||
*/
|
||||
get rootUrl(): string {
|
||||
return this._rootUrl || this.config.rootUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the root URL for API operations
|
||||
*/
|
||||
set rootUrl(rootUrl: string) {
|
||||
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: 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> {
|
||||
const resp = this.invoke$Response(fn, params, context);
|
||||
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: 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>> {
|
||||
const obs = fn(this.http, this.rootUrl, params, context)
|
||||
.pipe(
|
||||
filter(r => r instanceof HttpResponse),
|
||||
map(r => r as StrictHttpResponse<R>));
|
||||
return firstValueFrom(obs);
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
/* 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 Metadata$Params {
|
||||
domain: Domain;
|
||||
}
|
||||
|
||||
export function metadata(http: HttpClient, rootUrl: string, params: Metadata$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||
}>> {
|
||||
const rb = new RequestBuilder(rootUrl, metadata.PATH, 'get');
|
||||
if (params) {
|
||||
rb.path('domain', params.domain, {});
|
||||
}
|
||||
|
||||
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<{
|
||||
}>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
metadata.PATH = '/{domain}/fhir/metadata';
|
||||
@@ -1,36 +0,0 @@
|
||||
/* 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 ReadMeasure$Params {
|
||||
domain: Domain;
|
||||
id: string;
|
||||
}
|
||||
|
||||
export function readMeasure(http: HttpClient, rootUrl: string, params: ReadMeasure$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||
}>> {
|
||||
const rb = new RequestBuilder(rootUrl, readMeasure.PATH, 'get');
|
||||
if (params) {
|
||||
rb.path('domain', params.domain, {});
|
||||
rb.path('id', params.id, {});
|
||||
}
|
||||
|
||||
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<{
|
||||
}>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
readMeasure.PATH = '/{domain}/fhir/Measure/{id}';
|
||||
@@ -1,36 +0,0 @@
|
||||
/* 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 ReadPatient$Params {
|
||||
domain: Domain;
|
||||
id: string;
|
||||
}
|
||||
|
||||
export function readPatient(http: HttpClient, rootUrl: string, params: ReadPatient$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||
}>> {
|
||||
const rb = new RequestBuilder(rootUrl, readPatient.PATH, 'get');
|
||||
if (params) {
|
||||
rb.path('domain', params.domain, {});
|
||||
rb.path('id', params.id, {});
|
||||
}
|
||||
|
||||
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<{
|
||||
}>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
readPatient.PATH = '/{domain}/fhir/Patient/{id}';
|
||||
@@ -1,44 +0,0 @@
|
||||
/* 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 SearchCondition$Params {
|
||||
domain: Domain;
|
||||
|
||||
/**
|
||||
* Patient/<id>, comma-separated
|
||||
*/
|
||||
subject?: (string | null);
|
||||
'_count'?: (number | null);
|
||||
'_offset'?: number;
|
||||
}
|
||||
|
||||
export function searchCondition(http: HttpClient, rootUrl: string, params: SearchCondition$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||
}>> {
|
||||
const rb = new RequestBuilder(rootUrl, searchCondition.PATH, 'get');
|
||||
if (params) {
|
||||
rb.path('domain', params.domain, {});
|
||||
rb.query('subject', params.subject, {});
|
||||
rb.query('_count', params['_count'], {});
|
||||
rb.query('_offset', params['_offset'], {});
|
||||
}
|
||||
|
||||
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<{
|
||||
}>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
searchCondition.PATH = '/{domain}/fhir/Condition';
|
||||
@@ -1,44 +0,0 @@
|
||||
/* 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 SearchDiagnosticReport$Params {
|
||||
domain: Domain;
|
||||
|
||||
/**
|
||||
* Patient/<id>, comma-separated
|
||||
*/
|
||||
subject?: (string | null);
|
||||
'_count'?: (number | null);
|
||||
'_offset'?: number;
|
||||
}
|
||||
|
||||
export function searchDiagnosticReport(http: HttpClient, rootUrl: string, params: SearchDiagnosticReport$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||
}>> {
|
||||
const rb = new RequestBuilder(rootUrl, searchDiagnosticReport.PATH, 'get');
|
||||
if (params) {
|
||||
rb.path('domain', params.domain, {});
|
||||
rb.query('subject', params.subject, {});
|
||||
rb.query('_count', params['_count'], {});
|
||||
rb.query('_offset', params['_offset'], {});
|
||||
}
|
||||
|
||||
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<{
|
||||
}>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
searchDiagnosticReport.PATH = '/{domain}/fhir/DiagnosticReport';
|
||||
@@ -1,62 +0,0 @@
|
||||
/* 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 SearchMeasureReport$Params {
|
||||
domain: Domain;
|
||||
|
||||
/**
|
||||
* the Measure's id or canonical URL
|
||||
*/
|
||||
measure: string;
|
||||
|
||||
/**
|
||||
* semesters (2025-S1) or months (2025-03), comma-separated
|
||||
*/
|
||||
'reporting-period': string;
|
||||
|
||||
/**
|
||||
* count only what was known by then
|
||||
*/
|
||||
'as-of'?: (string | null);
|
||||
|
||||
/**
|
||||
* durations count to this day
|
||||
*/
|
||||
'event-cutoff'?: (string | null);
|
||||
'_count'?: (number | null);
|
||||
'_offset'?: number;
|
||||
}
|
||||
|
||||
export function searchMeasureReport(http: HttpClient, rootUrl: string, params: SearchMeasureReport$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||
}>> {
|
||||
const rb = new RequestBuilder(rootUrl, searchMeasureReport.PATH, 'get');
|
||||
if (params) {
|
||||
rb.path('domain', params.domain, {});
|
||||
rb.query('measure', params.measure, {});
|
||||
rb.query('reporting-period', params['reporting-period'], {});
|
||||
rb.query('as-of', params['as-of'], {});
|
||||
rb.query('event-cutoff', params['event-cutoff'], {});
|
||||
rb.query('_count', params['_count'], {});
|
||||
rb.query('_offset', params['_offset'], {});
|
||||
}
|
||||
|
||||
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<{
|
||||
}>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
searchMeasureReport.PATH = '/{domain}/fhir/MeasureReport';
|
||||
@@ -1,38 +0,0 @@
|
||||
/* 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 SearchMeasure$Params {
|
||||
domain: Domain;
|
||||
'_count'?: (number | null);
|
||||
'_offset'?: number;
|
||||
}
|
||||
|
||||
export function searchMeasure(http: HttpClient, rootUrl: string, params: SearchMeasure$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||
}>> {
|
||||
const rb = new RequestBuilder(rootUrl, searchMeasure.PATH, 'get');
|
||||
if (params) {
|
||||
rb.path('domain', params.domain, {});
|
||||
rb.query('_count', params['_count'], {});
|
||||
rb.query('_offset', params['_offset'], {});
|
||||
}
|
||||
|
||||
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<{
|
||||
}>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
searchMeasure.PATH = '/{domain}/fhir/Measure';
|
||||
@@ -1,44 +0,0 @@
|
||||
/* 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 SearchObservation$Params {
|
||||
domain: Domain;
|
||||
|
||||
/**
|
||||
* Patient/<id>, comma-separated
|
||||
*/
|
||||
subject?: (string | null);
|
||||
'_count'?: (number | null);
|
||||
'_offset'?: number;
|
||||
}
|
||||
|
||||
export function searchObservation(http: HttpClient, rootUrl: string, params: SearchObservation$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||
}>> {
|
||||
const rb = new RequestBuilder(rootUrl, searchObservation.PATH, 'get');
|
||||
if (params) {
|
||||
rb.path('domain', params.domain, {});
|
||||
rb.query('subject', params.subject, {});
|
||||
rb.query('_count', params['_count'], {});
|
||||
rb.query('_offset', params['_offset'], {});
|
||||
}
|
||||
|
||||
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<{
|
||||
}>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
searchObservation.PATH = '/{domain}/fhir/Observation';
|
||||
@@ -1,78 +0,0 @@
|
||||
/* 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 SearchPatient$Params {
|
||||
domain: Domain;
|
||||
'_id'?: (string | null);
|
||||
|
||||
/**
|
||||
* months: whoever had a cytology sampled within them up to the cut-off
|
||||
*/
|
||||
'follow-up-window'?: (number | null);
|
||||
|
||||
/**
|
||||
* default: the last day with data
|
||||
*/
|
||||
'follow-up-cutoff'?: (string | null);
|
||||
'follow-up-status'?: (string | null);
|
||||
|
||||
/**
|
||||
* one of ('-recent', '-risk-cin2', '-risk-cancer'); the list only
|
||||
*/
|
||||
'_sort'?: string;
|
||||
|
||||
/**
|
||||
* years
|
||||
*/
|
||||
'risk-horizon'?: number;
|
||||
|
||||
/**
|
||||
* any of ('DiagnosticReport:subject', 'RiskAssessment:subject', 'Observation:subject')
|
||||
*/
|
||||
'_revinclude'?: Array<string>;
|
||||
|
||||
/**
|
||||
* DiagnosticReport:result
|
||||
*/
|
||||
'_include:iterate'?: Array<string>;
|
||||
'_count'?: (number | null);
|
||||
'_offset'?: number;
|
||||
}
|
||||
|
||||
export function searchPatient(http: HttpClient, rootUrl: string, params: SearchPatient$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||
}>> {
|
||||
const rb = new RequestBuilder(rootUrl, searchPatient.PATH, 'get');
|
||||
if (params) {
|
||||
rb.path('domain', params.domain, {});
|
||||
rb.query('_id', params['_id'], {});
|
||||
rb.query('follow-up-window', params['follow-up-window'], {});
|
||||
rb.query('follow-up-cutoff', params['follow-up-cutoff'], {});
|
||||
rb.query('follow-up-status', params['follow-up-status'], {});
|
||||
rb.query('_sort', params['_sort'], {});
|
||||
rb.query('risk-horizon', params['risk-horizon'], {});
|
||||
rb.query('_revinclude', params['_revinclude'], {});
|
||||
rb.query('_include:iterate', params['_include:iterate'], {});
|
||||
rb.query('_count', params['_count'], {});
|
||||
rb.query('_offset', params['_offset'], {});
|
||||
}
|
||||
|
||||
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<{
|
||||
}>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
searchPatient.PATH = '/{domain}/fhir/Patient';
|
||||
@@ -1,44 +0,0 @@
|
||||
/* 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 SearchProcedure$Params {
|
||||
domain: Domain;
|
||||
|
||||
/**
|
||||
* Patient/<id>, comma-separated
|
||||
*/
|
||||
subject?: (string | null);
|
||||
'_count'?: (number | null);
|
||||
'_offset'?: number;
|
||||
}
|
||||
|
||||
export function searchProcedure(http: HttpClient, rootUrl: string, params: SearchProcedure$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||
}>> {
|
||||
const rb = new RequestBuilder(rootUrl, searchProcedure.PATH, 'get');
|
||||
if (params) {
|
||||
rb.path('domain', params.domain, {});
|
||||
rb.query('subject', params.subject, {});
|
||||
rb.query('_count', params['_count'], {});
|
||||
rb.query('_offset', params['_offset'], {});
|
||||
}
|
||||
|
||||
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<{
|
||||
}>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
searchProcedure.PATH = '/{domain}/fhir/Procedure';
|
||||
@@ -1,44 +0,0 @@
|
||||
/* 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 SearchRiskAssessment$Params {
|
||||
domain: Domain;
|
||||
|
||||
/**
|
||||
* Patient/<id>, comma-separated
|
||||
*/
|
||||
subject?: (string | null);
|
||||
'_count'?: (number | null);
|
||||
'_offset'?: number;
|
||||
}
|
||||
|
||||
export function searchRiskAssessment(http: HttpClient, rootUrl: string, params: SearchRiskAssessment$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||
}>> {
|
||||
const rb = new RequestBuilder(rootUrl, searchRiskAssessment.PATH, 'get');
|
||||
if (params) {
|
||||
rb.path('domain', params.domain, {});
|
||||
rb.query('subject', params.subject, {});
|
||||
rb.query('_count', params['_count'], {});
|
||||
rb.query('_offset', params['_offset'], {});
|
||||
}
|
||||
|
||||
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<{
|
||||
}>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
searchRiskAssessment.PATH = '/{domain}/fhir/RiskAssessment';
|
||||
@@ -1,39 +0,0 @@
|
||||
/* 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 NodeRows$Params {
|
||||
pipeline_id: string;
|
||||
node_id: string;
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export function nodeRows(http: HttpClient, rootUrl: string, params: NodeRows$Params, context?: HttpContext): Observable<StrictHttpResponse<Array<{
|
||||
[key: string]: any;
|
||||
}>>> {
|
||||
const rb = new RequestBuilder(rootUrl, nodeRows.PATH, 'get');
|
||||
if (params) {
|
||||
rb.path('pipeline_id', params.pipeline_id, {});
|
||||
rb.path('node_id', params.node_id, {});
|
||||
rb.query('limit', params.limit, {});
|
||||
}
|
||||
|
||||
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;
|
||||
}>>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
nodeRows.PATH = '/ingest/pipelines/{pipeline_id}/nodes/{node_id}/rows';
|
||||
@@ -1,34 +0,0 @@
|
||||
/* 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 { SavedPipeline } from '../../models/saved-pipeline';
|
||||
|
||||
export interface Pipeline$Params {
|
||||
pipeline_id: string;
|
||||
version?: (number | null);
|
||||
}
|
||||
|
||||
export function pipeline(http: HttpClient, rootUrl: string, params: Pipeline$Params, context?: HttpContext): Observable<StrictHttpResponse<SavedPipeline>> {
|
||||
const rb = new RequestBuilder(rootUrl, pipeline.PATH, 'get');
|
||||
if (params) {
|
||||
rb.path('pipeline_id', params.pipeline_id, {});
|
||||
rb.query('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<SavedPipeline>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
pipeline.PATH = '/ingest/pipelines/{pipeline_id}';
|
||||
@@ -1,33 +0,0 @@
|
||||
/* 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 Pipelines$Params {
|
||||
}
|
||||
|
||||
export function pipelines(http: HttpClient, rootUrl: string, params?: Pipelines$Params, context?: HttpContext): Observable<StrictHttpResponse<Array<{
|
||||
[key: string]: any;
|
||||
}>>> {
|
||||
const rb = new RequestBuilder(rootUrl, pipelines.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<Array<{
|
||||
[key: string]: any;
|
||||
}>>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
pipelines.PATH = '/ingest/pipelines';
|
||||
@@ -1,38 +0,0 @@
|
||||
/* 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 { Pipeline } from '../../models/pipeline';
|
||||
|
||||
export interface SavePipeline$Params {
|
||||
pipeline_id: string;
|
||||
body: Pipeline
|
||||
}
|
||||
|
||||
export function savePipeline(http: HttpClient, rootUrl: string, params: SavePipeline$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||
[key: string]: number;
|
||||
}>> {
|
||||
const rb = new RequestBuilder(rootUrl, savePipeline.PATH, 'put');
|
||||
if (params) {
|
||||
rb.path('pipeline_id', params.pipeline_id, {});
|
||||
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]: number;
|
||||
}>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
savePipeline.PATH = '/ingest/pipelines/{pipeline_id}';
|
||||
@@ -1,33 +0,0 @@
|
||||
/* 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 Schema$Params {
|
||||
}
|
||||
|
||||
export function schema(http: HttpClient, rootUrl: string, params?: Schema$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||
[key: string]: any;
|
||||
}>> {
|
||||
const rb = new RequestBuilder(rootUrl, schema.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]: any;
|
||||
}>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
schema.PATH = '/ingest/schema';
|
||||
@@ -1,38 +0,0 @@
|
||||
/* 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 { Source } from '../../models/source';
|
||||
|
||||
export interface SourcePreview$Params {
|
||||
limit?: number;
|
||||
body: Source
|
||||
}
|
||||
|
||||
export function sourcePreview(http: HttpClient, rootUrl: string, params: SourcePreview$Params, context?: HttpContext): Observable<StrictHttpResponse<Array<{
|
||||
[key: string]: any;
|
||||
}>>> {
|
||||
const rb = new RequestBuilder(rootUrl, sourcePreview.PATH, 'post');
|
||||
if (params) {
|
||||
rb.query('limit', params.limit, {});
|
||||
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<Array<{
|
||||
[key: string]: any;
|
||||
}>>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
sourcePreview.PATH = '/ingest/sources/preview';
|
||||
@@ -1,32 +0,0 @@
|
||||
/* 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 { SourceRef } from '../../models/source-ref';
|
||||
|
||||
export interface SourceResources$Params {
|
||||
body: SourceRef
|
||||
}
|
||||
|
||||
export function sourceResources(http: HttpClient, rootUrl: string, params: SourceResources$Params, context?: HttpContext): Observable<StrictHttpResponse<Array<string>>> {
|
||||
const rb = new RequestBuilder(rootUrl, sourceResources.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<Array<string>>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
sourceResources.PATH = '/ingest/sources/resources';
|
||||
@@ -1,38 +0,0 @@
|
||||
/* 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 { RunRequest } from '../../models/run-request';
|
||||
|
||||
export interface StartRun$Params {
|
||||
pipeline_id: string;
|
||||
body: RunRequest
|
||||
}
|
||||
|
||||
export function startRun(http: HttpClient, rootUrl: string, params: StartRun$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||
[key: string]: string;
|
||||
}>> {
|
||||
const rb = new RequestBuilder(rootUrl, startRun.PATH, 'post');
|
||||
if (params) {
|
||||
rb.path('pipeline_id', params.pipeline_id, {});
|
||||
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;
|
||||
}>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
startRun.PATH = '/ingest/pipelines/{pipeline_id}/runs';
|
||||
@@ -1,36 +0,0 @@
|
||||
/* 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 { BodyUpload } from '../../models/body-upload';
|
||||
|
||||
export interface Upload$Params {
|
||||
body: BodyUpload
|
||||
}
|
||||
|
||||
export function upload(http: HttpClient, rootUrl: string, params: Upload$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||
[key: string]: string;
|
||||
}>> {
|
||||
const rb = new RequestBuilder(rootUrl, upload.PATH, 'post');
|
||||
if (params) {
|
||||
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;
|
||||
}>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
upload.PATH = '/ingest/uploads';
|
||||
@@ -1,43 +0,0 @@
|
||||
/* 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 { BodyAddClinicalValidation } from '../../models/body-add-clinical-validation';
|
||||
import { Domain } from '../../models/domain';
|
||||
|
||||
export interface AddClinicalValidation$Params {
|
||||
domain: Domain;
|
||||
name: string;
|
||||
version: number;
|
||||
body: BodyAddClinicalValidation
|
||||
}
|
||||
|
||||
export function addClinicalValidation(http: HttpClient, rootUrl: string, params: AddClinicalValidation$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||
[key: string]: any;
|
||||
}>> {
|
||||
const rb = new RequestBuilder(rootUrl, addClinicalValidation.PATH, 'post');
|
||||
if (params) {
|
||||
rb.path('domain', params.domain, {});
|
||||
rb.path('name', params.name, {});
|
||||
rb.path('version', params.version, {});
|
||||
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]: any;
|
||||
}>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
addClinicalValidation.PATH = '/models/{domain}/{name}/versions/{version}/reports/clinical_validation';
|
||||
@@ -1,32 +0,0 @@
|
||||
/* 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 Models$Params {
|
||||
domain: Domain;
|
||||
}
|
||||
|
||||
export function models(http: HttpClient, rootUrl: string, params: Models$Params, context?: HttpContext): Observable<StrictHttpResponse<Array<string>>> {
|
||||
const rb = new RequestBuilder(rootUrl, models.PATH, 'get');
|
||||
if (params) {
|
||||
rb.path('domain', params.domain, {});
|
||||
}
|
||||
|
||||
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<string>>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
models.PATH = '/models/{domain}';
|
||||
@@ -1,40 +0,0 @@
|
||||
/* 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 Promote$Params {
|
||||
domain: Domain;
|
||||
name: string;
|
||||
version: number;
|
||||
}
|
||||
|
||||
export function promote(http: HttpClient, rootUrl: string, params: Promote$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||
[key: string]: any;
|
||||
}>> {
|
||||
const rb = new RequestBuilder(rootUrl, promote.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]: any;
|
||||
}>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
promote.PATH = '/models/{domain}/{name}/versions/{version}/promote';
|
||||
@@ -1,36 +0,0 @@
|
||||
/* 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 Score$Params {
|
||||
domain: Domain;
|
||||
}
|
||||
|
||||
export function score(http: HttpClient, rootUrl: string, params: Score$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||
[key: string]: string;
|
||||
}>> {
|
||||
const rb = new RequestBuilder(rootUrl, score.PATH, 'post');
|
||||
if (params) {
|
||||
rb.path('domain', params.domain, {});
|
||||
}
|
||||
|
||||
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;
|
||||
}>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
score.PATH = '/models/{domain}/score';
|
||||
@@ -1,39 +0,0 @@
|
||||
/* 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 { Training } from '../../models/training';
|
||||
|
||||
export interface Train$Params {
|
||||
domain: Domain;
|
||||
body: Training
|
||||
}
|
||||
|
||||
export function train(http: HttpClient, rootUrl: string, params: Train$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||
[key: string]: string;
|
||||
}>> {
|
||||
const rb = new RequestBuilder(rootUrl, train.PATH, 'post');
|
||||
if (params) {
|
||||
rb.path('domain', params.domain, {});
|
||||
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;
|
||||
}>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
train.PATH = '/models/{domain}/train';
|
||||
@@ -1,35 +0,0 @@
|
||||
/* 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 { Version } from '../../models/version';
|
||||
|
||||
export interface Versions$Params {
|
||||
domain: Domain;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export function versions(http: HttpClient, rootUrl: string, params: Versions$Params, context?: HttpContext): Observable<StrictHttpResponse<Array<Version>>> {
|
||||
const rb = new RequestBuilder(rootUrl, versions.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<Array<Version>>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
versions.PATH = '/models/{domain}/{name}/versions';
|
||||
@@ -1,30 +0,0 @@
|
||||
/* 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 Domains$Params {
|
||||
}
|
||||
|
||||
export function domains(http: HttpClient, rootUrl: string, params?: Domains$Params, context?: HttpContext): Observable<StrictHttpResponse<Array<Domain>>> {
|
||||
const rb = new RequestBuilder(rootUrl, domains.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<Array<Domain>>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
domains.PATH = '/domains';
|
||||
@@ -1,33 +0,0 @@
|
||||
/* 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 Health$Params {
|
||||
}
|
||||
|
||||
export function health(http: HttpClient, rootUrl: string, params?: Health$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||
[key: string]: string;
|
||||
}>> {
|
||||
const rb = new RequestBuilder(rootUrl, health.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]: string;
|
||||
}>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
health.PATH = '/health';
|
||||
@@ -1,35 +0,0 @@
|
||||
/* 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 Conflicts$Params {
|
||||
entity: 'identity' | 'death' | 'clinical_note' | 'cervical_cytology' | 'cervical_biopsy' | 'mammography' | 'breast_biopsy';
|
||||
}
|
||||
|
||||
export function conflicts(http: HttpClient, rootUrl: string, params: Conflicts$Params, context?: HttpContext): Observable<StrictHttpResponse<Array<{
|
||||
[key: string]: any;
|
||||
}>>> {
|
||||
const rb = new RequestBuilder(rootUrl, conflicts.PATH, 'get');
|
||||
if (params) {
|
||||
rb.query('entity', params.entity, {});
|
||||
}
|
||||
|
||||
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;
|
||||
}>>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
conflicts.PATH = '/review/conflicts';
|
||||
@@ -1,36 +0,0 @@
|
||||
/* 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 { Correction } from '../../models/correction';
|
||||
|
||||
export interface Correct$Params {
|
||||
body: Correction
|
||||
}
|
||||
|
||||
export function correct(http: HttpClient, rootUrl: string, params: Correct$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||
[key: string]: string;
|
||||
}>> {
|
||||
const rb = new RequestBuilder(rootUrl, correct.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;
|
||||
}>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
correct.PATH = '/review/corrections';
|
||||
@@ -1,36 +0,0 @@
|
||||
/* 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 { PersonDecision } from '../../models/person-decision';
|
||||
|
||||
export interface DecidePersons$Params {
|
||||
body: PersonDecision
|
||||
}
|
||||
|
||||
export function decidePersons(http: HttpClient, rootUrl: string, params: DecidePersons$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||
[key: string]: string;
|
||||
}>> {
|
||||
const rb = new RequestBuilder(rootUrl, decidePersons.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;
|
||||
}>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
decidePersons.PATH = '/review/persons';
|
||||
@@ -1,35 +0,0 @@
|
||||
/* 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 Held$Params {
|
||||
entity: 'identity' | 'death' | 'clinical_note' | 'cervical_cytology' | 'cervical_biopsy' | 'mammography' | 'breast_biopsy';
|
||||
}
|
||||
|
||||
export function held(http: HttpClient, rootUrl: string, params: Held$Params, context?: HttpContext): Observable<StrictHttpResponse<Array<{
|
||||
[key: string]: any;
|
||||
}>>> {
|
||||
const rb = new RequestBuilder(rootUrl, held.PATH, 'get');
|
||||
if (params) {
|
||||
rb.query('entity', params.entity, {});
|
||||
}
|
||||
|
||||
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;
|
||||
}>>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
held.PATH = '/review/held';
|
||||
@@ -1,41 +0,0 @@
|
||||
/* 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 Persons$Params {
|
||||
pipeline: string;
|
||||
node: string;
|
||||
}
|
||||
|
||||
export function persons(http: HttpClient, rootUrl: string, params: Persons$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||
[key: string]: Array<{
|
||||
[key: string]: any;
|
||||
}>;
|
||||
}>> {
|
||||
const rb = new RequestBuilder(rootUrl, persons.PATH, 'get');
|
||||
if (params) {
|
||||
rb.query('pipeline', params.pipeline, {});
|
||||
rb.query('node', params.node, {});
|
||||
}
|
||||
|
||||
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]: Array<{
|
||||
[key: string]: any;
|
||||
}>;
|
||||
}>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
persons.PATH = '/review/persons';
|
||||
@@ -1,36 +0,0 @@
|
||||
/* 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 { Rejection } from '../../models/rejection';
|
||||
|
||||
export interface Reject$Params {
|
||||
body: Rejection
|
||||
}
|
||||
|
||||
export function reject(http: HttpClient, rootUrl: string, params: Reject$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||
[key: string]: string;
|
||||
}>> {
|
||||
const rb = new RequestBuilder(rootUrl, reject.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;
|
||||
}>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
reject.PATH = '/review/rejections';
|
||||
@@ -1,35 +0,0 @@
|
||||
/* 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 RunStatus$Params {
|
||||
run_id: string;
|
||||
}
|
||||
|
||||
export function runStatus(http: HttpClient, rootUrl: string, params: RunStatus$Params, context?: HttpContext): Observable<StrictHttpResponse<{
|
||||
[key: string]: string;
|
||||
}>> {
|
||||
const rb = new RequestBuilder(rootUrl, runStatus.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<{
|
||||
[key: string]: string;
|
||||
}>;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
runStatus.PATH = '/runs/{run_id}';
|
||||
@@ -1,73 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||
|
||||
export type { Domains$Params as Domains$Params } from './fn/operations/domains';
|
||||
export { domains as domains } from './fn/operations/domains';
|
||||
export type { Health$Params as Health$Params } from './fn/operations/health';
|
||||
export { health as health } from './fn/operations/health';
|
||||
export type { Pipelines$Params as Pipelines$Params } from './fn/ingest/pipelines';
|
||||
export { pipelines as pipelines } from './fn/ingest/pipelines';
|
||||
export type { Pipeline$Params as Pipeline$Params } from './fn/ingest/pipeline';
|
||||
export { pipeline as pipeline } from './fn/ingest/pipeline';
|
||||
export type { SavePipeline$Params as SavePipeline$Params } from './fn/ingest/save-pipeline';
|
||||
export { savePipeline as savePipeline } from './fn/ingest/save-pipeline';
|
||||
export type { NodeRows$Params as NodeRows$Params } from './fn/ingest/node-rows';
|
||||
export { nodeRows as nodeRows } from './fn/ingest/node-rows';
|
||||
export type { StartRun$Params as StartRun$Params } from './fn/ingest/start-run';
|
||||
export { startRun as startRun } from './fn/ingest/start-run';
|
||||
export type { Schema$Params as Schema$Params } from './fn/ingest/schema';
|
||||
export { schema as schema } from './fn/ingest/schema';
|
||||
export type { SourcePreview$Params as SourcePreview$Params } 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 { Upload$Params as Upload$Params } from './fn/ingest/upload';
|
||||
export { upload as upload } from './fn/ingest/upload';
|
||||
export type { Models$Params as Models$Params } from './fn/models/models';
|
||||
export { models as models } from './fn/models/models';
|
||||
export type { Score$Params as Score$Params } from './fn/models/score';
|
||||
export { score as score } from './fn/models/score';
|
||||
export type { Train$Params as Train$Params } from './fn/models/train';
|
||||
export { train as train } from './fn/models/train';
|
||||
export type { Versions$Params as Versions$Params } from './fn/models/versions';
|
||||
export { versions as versions } from './fn/models/versions';
|
||||
export type { Promote$Params as Promote$Params } 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 { addClinicalValidation as addClinicalValidation } from './fn/models/add-clinical-validation';
|
||||
export type { Conflicts$Params as Conflicts$Params } from './fn/review/conflicts';
|
||||
export { conflicts as conflicts } from './fn/review/conflicts';
|
||||
export type { Correct$Params as Correct$Params } from './fn/review/correct';
|
||||
export { correct as correct } from './fn/review/correct';
|
||||
export type { Held$Params as Held$Params } from './fn/review/held';
|
||||
export { held as held } from './fn/review/held';
|
||||
export type { Persons$Params as Persons$Params } from './fn/review/persons';
|
||||
export { persons as persons } from './fn/review/persons';
|
||||
export type { DecidePersons$Params as DecidePersons$Params } from './fn/review/decide-persons';
|
||||
export { decidePersons as decidePersons } from './fn/review/decide-persons';
|
||||
export type { Reject$Params as Reject$Params } from './fn/review/reject';
|
||||
export { reject as reject } from './fn/review/reject';
|
||||
export type { RunStatus$Params as RunStatus$Params } from './fn/runs/run-status';
|
||||
export { runStatus as runStatus } from './fn/runs/run-status';
|
||||
export type { SearchCondition$Params as SearchCondition$Params } from './fn/fhir/search-condition';
|
||||
export { searchCondition as searchCondition } from './fn/fhir/search-condition';
|
||||
export type { SearchDiagnosticReport$Params as SearchDiagnosticReport$Params } from './fn/fhir/search-diagnostic-report';
|
||||
export { searchDiagnosticReport as searchDiagnosticReport } from './fn/fhir/search-diagnostic-report';
|
||||
export type { SearchMeasure$Params as SearchMeasure$Params } from './fn/fhir/search-measure';
|
||||
export { searchMeasure as searchMeasure } from './fn/fhir/search-measure';
|
||||
export type { ReadMeasure$Params as ReadMeasure$Params } from './fn/fhir/read-measure';
|
||||
export { readMeasure as readMeasure } from './fn/fhir/read-measure';
|
||||
export type { SearchMeasureReport$Params as SearchMeasureReport$Params } from './fn/fhir/search-measure-report';
|
||||
export { searchMeasureReport as searchMeasureReport } from './fn/fhir/search-measure-report';
|
||||
export type { SearchObservation$Params as SearchObservation$Params } 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 { searchPatient as searchPatient } from './fn/fhir/search-patient';
|
||||
export type { ReadPatient$Params as ReadPatient$Params } 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 { searchProcedure as searchProcedure } from './fn/fhir/search-procedure';
|
||||
export type { SearchRiskAssessment$Params as SearchRiskAssessment$Params } from './fn/fhir/search-risk-assessment';
|
||||
export { searchRiskAssessment as searchRiskAssessment } from './fn/fhir/search-risk-assessment';
|
||||
export type { Metadata$Params as Metadata$Params } from './fn/fhir/metadata';
|
||||
export { metadata as metadata } from './fn/fhir/metadata';
|
||||
@@ -1,27 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||
|
||||
export type { BodyAddClinicalValidation } from './models/body-add-clinical-validation';
|
||||
export type { BodyUpload } from './models/body-upload';
|
||||
export type { Condition } from './models/condition';
|
||||
export type { Correction } from './models/correction';
|
||||
export type { Domain } from './models/domain';
|
||||
export type { Extract } from './models/extract';
|
||||
export type { HttpValidationError } from './models/http-validation-error';
|
||||
export type { Join } from './models/join';
|
||||
export type { Link } from './models/link';
|
||||
export type { Map } from './models/map';
|
||||
export type { PersonDecision } from './models/person-decision';
|
||||
export type { Pipeline } from './models/pipeline';
|
||||
export type { Position } from './models/position';
|
||||
export type { Read } from './models/read';
|
||||
export type { Rejection } from './models/rejection';
|
||||
export type { Route } from './models/route';
|
||||
export type { RunRequest } from './models/run-request';
|
||||
export type { SavedPipeline } from './models/saved-pipeline';
|
||||
export type { Source } from './models/source';
|
||||
export type { SourceRef } from './models/source-ref';
|
||||
export type { Target } from './models/target';
|
||||
export type { Training } from './models/training';
|
||||
export type { ValidationError } from './models/validation-error';
|
||||
export type { Version } from './models/version';
|
||||
@@ -1,6 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||
|
||||
export interface BodyAddClinicalValidation {
|
||||
file: string;
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||
|
||||
export interface BodyUpload {
|
||||
file: string;
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||
|
||||
export interface Condition {
|
||||
column: string;
|
||||
op: 'equals' | 'contains' | 'matches' | 'present';
|
||||
value?: string;
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||
|
||||
export interface Correction {
|
||||
field: 'record_number' | 'full_name' | 'curp' | 'nss' | 'birth_date' | 'sex' | 'postal_code';
|
||||
record: string;
|
||||
value: string;
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||
|
||||
import { Domain } from './domain';
|
||||
|
||||
/**
|
||||
* Each possible value of `Domain`
|
||||
*/
|
||||
export const DOMAIN: Domain[] = [
|
||||
'cacu',
|
||||
'cama',
|
||||
'tea'
|
||||
];
|
||||
@@ -1,5 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||
|
||||
export type Domain = 'cacu' | 'cama' | 'tea';
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||
|
||||
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 `values` and
|
||||
* `formats` as in `map`.
|
||||
*/
|
||||
export interface Extract {
|
||||
column: string;
|
||||
entity: 'identity' | 'death' | 'clinical_note' | 'cervical_cytology' | 'cervical_biopsy' | 'mammography' | 'breast_biopsy';
|
||||
formats?: {
|
||||
[key: string]: string;
|
||||
};
|
||||
hints?: string;
|
||||
id: string;
|
||||
inputs?: Array<string>;
|
||||
kind?: 'extract';
|
||||
label?: string;
|
||||
method?: 'auto' | 'llm' | 'patterns';
|
||||
patterns?: {
|
||||
[key: string]: string;
|
||||
};
|
||||
position?: (Position | null);
|
||||
values?: {
|
||||
[key: string]: {
|
||||
[key: string]: string;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||
|
||||
import { ValidationError } from '../models/validation-error';
|
||||
export interface HttpValidationError {
|
||||
detail?: Array<ValidationError>;
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||
|
||||
import { Position } from '../models/position';
|
||||
|
||||
/**
|
||||
* Two inputs side by side where their columns match.
|
||||
*/
|
||||
export interface Join {
|
||||
how?: 'inner' | 'left';
|
||||
id: string;
|
||||
inputs?: Array<string>;
|
||||
kind?: 'join';
|
||||
label?: string;
|
||||
on: Array<[string, string]>;
|
||||
position?: (Position | null);
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||
|
||||
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 {
|
||||
fields?: Array<string>;
|
||||
id: string;
|
||||
inputs?: Array<string>;
|
||||
kind?: 'link';
|
||||
label?: string;
|
||||
position?: (Position | null);
|
||||
review?: number;
|
||||
rules?: Array<string>;
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||
|
||||
import { Position } from '../models/position';
|
||||
|
||||
/**
|
||||
* Columns to platform fields, with the site's codes and date formats.
|
||||
*/
|
||||
export interface Map {
|
||||
fields: {
|
||||
[key: string]: string;
|
||||
};
|
||||
formats?: {
|
||||
[key: string]: string;
|
||||
};
|
||||
id: string;
|
||||
inputs?: Array<string>;
|
||||
kind?: 'map';
|
||||
label?: string;
|
||||
position?: (Position | null);
|
||||
values?: {
|
||||
[key: string]: {
|
||||
[key: string]: string;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||
|
||||
export interface PersonDecision {
|
||||
candidate: string;
|
||||
person: string;
|
||||
same: boolean;
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||
|
||||
import { Extract } from '../models/extract';
|
||||
import { Join } from '../models/join';
|
||||
import { Link } from '../models/link';
|
||||
import { Map } from '../models/map';
|
||||
import { Read } from '../models/read';
|
||||
import { Route } from '../models/route';
|
||||
import { Source } from '../models/source';
|
||||
import { Target } from '../models/target';
|
||||
export interface Pipeline {
|
||||
nodes: Array<(Source | Read | Route | Map | Extract | Join | Link | Target)>;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||
|
||||
export interface Position {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||
|
||||
import { Position } from '../models/position';
|
||||
|
||||
/**
|
||||
* Files in a column (PDF, Word, Excel, scans...) to text (MarkItDown, OCRmyPDF).
|
||||
*/
|
||||
export interface Read {
|
||||
column: string;
|
||||
id: string;
|
||||
inputs?: Array<string>;
|
||||
kind?: 'read';
|
||||
label?: string;
|
||||
position?: (Position | null);
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||
|
||||
export interface Rejection {
|
||||
entity: 'identity' | 'death' | 'clinical_note' | 'cervical_cytology' | 'cervical_biopsy' | 'mammography' | 'breast_biopsy';
|
||||
reason: string;
|
||||
record: string;
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||
|
||||
import { Condition } from '../models/condition';
|
||||
import { Position } from '../models/position';
|
||||
|
||||
/**
|
||||
* Only the rows where every condition holds (e.g. reports titled "Citología").
|
||||
*/
|
||||
export interface Route {
|
||||
id: string;
|
||||
inputs?: Array<string>;
|
||||
kind?: 'route';
|
||||
label?: string;
|
||||
position?: (Position | null);
|
||||
when: Array<Condition>;
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||
|
||||
export interface RunRequest {
|
||||
version?: (number | null);
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||
|
||||
import { Pipeline } from '../models/pipeline';
|
||||
export interface SavedPipeline {
|
||||
pipeline: Pipeline;
|
||||
version: number;
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||
|
||||
export interface SourceRef {
|
||||
args?: {
|
||||
[key: string]: any;
|
||||
};
|
||||
source: string;
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||
|
||||
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 {
|
||||
args?: {
|
||||
[key: string]: any;
|
||||
};
|
||||
id: string;
|
||||
inputs?: Array<string>;
|
||||
kind?: 'source';
|
||||
label?: string;
|
||||
position?: (Position | null);
|
||||
primary_key?: Array<string>;
|
||||
resource?: (string | null);
|
||||
source: string;
|
||||
then?: (string | null);
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||
|
||||
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 {
|
||||
entity: 'identity' | 'death' | 'clinical_note' | 'cervical_cytology' | 'cervical_biopsy' | 'mammography' | 'breast_biopsy';
|
||||
id: string;
|
||||
inputs?: Array<string>;
|
||||
kind?: 'target';
|
||||
label?: string;
|
||||
position?: (Position | null);
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||
|
||||
export interface Training {
|
||||
as_of?: (string | null);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||
|
||||
export interface ValidationError {
|
||||
ctx?: {
|
||||
};
|
||||
input?: any;
|
||||
loc: Array<(string | number)>;
|
||||
msg: string;
|
||||
type: string;
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||
|
||||
export interface Version {
|
||||
aliases: Array<string>;
|
||||
created: number;
|
||||
metrics: {
|
||||
[key: string]: number;
|
||||
};
|
||||
params: {
|
||||
[key: string]: string;
|
||||
};
|
||||
reports: Array<string>;
|
||||
version: number;
|
||||
}
|
||||
@@ -1,369 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||
|
||||
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 {
|
||||
encodeKey(key: string): string {
|
||||
return encodeURIComponent(key);
|
||||
}
|
||||
|
||||
encodeValue(value: string): string {
|
||||
return encodeURIComponent(value);
|
||||
}
|
||||
|
||||
decodeKey(key: string): string {
|
||||
return decodeURIComponent(key);
|
||||
}
|
||||
|
||||
decodeValue(value: string): string {
|
||||
return decodeURIComponent(value);
|
||||
}
|
||||
}
|
||||
const ParameterCodecInstance = new ParameterCodec();
|
||||
|
||||
/**
|
||||
* Defines the options for appending a parameter
|
||||
*/
|
||||
interface ParameterOptions {
|
||||
style?: string;
|
||||
explode?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Base class for a parameter
|
||||
*/
|
||||
abstract class Parameter {
|
||||
constructor(public name: string, public value: any, public options: ParameterOptions, defaultStyle: string, defaultExplode: boolean) {
|
||||
this.options = options || {};
|
||||
if (this.options.style === null || this.options.style === undefined) {
|
||||
this.options.style = defaultStyle;
|
||||
}
|
||||
if (this.options.explode === null || this.options.explode === undefined) {
|
||||
this.options.explode = defaultExplode;
|
||||
}
|
||||
}
|
||||
|
||||
serializeValue(value: any, separator = ','): string {
|
||||
if (value === null || value === undefined) {
|
||||
return '';
|
||||
} else if (value instanceof Array) {
|
||||
return value.map(v => this.serializeValue(v).split(separator).join(encodeURIComponent(separator))).join(separator);
|
||||
} else if (typeof value === 'object') {
|
||||
const array: string[] = [];
|
||||
for (const key of Object.keys(value)) {
|
||||
let propVal = value[key];
|
||||
if (propVal !== null && propVal !== undefined) {
|
||||
propVal = this.serializeValue(propVal).split(separator).join(encodeURIComponent(separator));
|
||||
if (this.options.explode) {
|
||||
array.push(`${key}=${propVal}`);
|
||||
} else {
|
||||
array.push(key);
|
||||
array.push(propVal);
|
||||
}
|
||||
}
|
||||
}
|
||||
return array.join(separator);
|
||||
} else {
|
||||
return String(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A parameter in the operation path
|
||||
*/
|
||||
class PathParameter extends Parameter {
|
||||
constructor(name: string, value: any, options: ParameterOptions) {
|
||||
super(name, value, options, 'simple', false);
|
||||
}
|
||||
|
||||
append(path: string): string {
|
||||
let value = this.value;
|
||||
if (value === null || value === undefined) {
|
||||
value = '';
|
||||
}
|
||||
let prefix = this.options.style === 'label' ? '.' : '';
|
||||
let separator = this.options.explode ? prefix === '' ? ',' : prefix : ',';
|
||||
let alreadySerialized = false;
|
||||
if (this.options.style === 'matrix') {
|
||||
// The parameter name is just used as prefix, except in some cases...
|
||||
prefix = `;${this.name}=`;
|
||||
if (this.options.explode && typeof value === 'object') {
|
||||
prefix = ';';
|
||||
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.join(';');
|
||||
alreadySerialized = true;
|
||||
} else {
|
||||
// For objects we have to put each the key / value pairs
|
||||
value = this.serializeValue(value, ';');
|
||||
alreadySerialized = true
|
||||
}
|
||||
}
|
||||
}
|
||||
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(`{${prefix}${this.name}${this.options.explode ? '*' : ''}}`, value);
|
||||
return path;
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
serializeValue(value: any, separator = ','): string {
|
||||
var result = typeof value === 'string' ? encodeURIComponent(value) : super.serializeValue(value, separator);
|
||||
result = result.replace(/%3D/g, '=');
|
||||
result = result.replace(/%3B/g, ';');
|
||||
result = result.replace(/%2C/g, ',');
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A parameter in the query
|
||||
*/
|
||||
class QueryParameter extends Parameter {
|
||||
constructor(name: string, value: any, options: ParameterOptions) {
|
||||
super(name, value, options, 'form', true);
|
||||
}
|
||||
|
||||
append(params: HttpParams): HttpParams {
|
||||
if (this.value instanceof Array) {
|
||||
// Array serialization
|
||||
if (this.options.explode) {
|
||||
for (const v of this.value) {
|
||||
params = params.append(this.name, this.serializeValue(v));
|
||||
}
|
||||
} else {
|
||||
const separator = this.options.style === 'spaceDelimited'
|
||||
? ' ' : this.options.style === 'pipeDelimited'
|
||||
? '|' : ',';
|
||||
return params.append(this.name, this.serializeValue(this.value, separator));
|
||||
}
|
||||
} else if (this.value !== null && typeof this.value === 'object') {
|
||||
// Object serialization
|
||||
if (this.options.style === 'deepObject') {
|
||||
// Append a parameter for each key, in the form `name[key]`
|
||||
for (const key of Object.keys(this.value)) {
|
||||
const propVal = this.value[key];
|
||||
if (propVal !== null && propVal !== undefined) {
|
||||
params = params.append(`${this.name}[${key}]`, this.serializeValue(propVal));
|
||||
}
|
||||
}
|
||||
} else if (this.options.explode) {
|
||||
// Append a parameter for each key without using the parameter name
|
||||
for (const key of Object.keys(this.value)) {
|
||||
const propVal = this.value[key];
|
||||
if (propVal !== null && propVal !== undefined) {
|
||||
params = params.append(key, this.serializeValue(propVal));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Append a single parameter whose values are a comma-separated list of key,value,key,value...
|
||||
const array: any[] = [];
|
||||
for (const key of Object.keys(this.value)) {
|
||||
const propVal = this.value[key];
|
||||
if (propVal !== null && propVal !== undefined) {
|
||||
array.push(key);
|
||||
array.push(propVal);
|
||||
}
|
||||
}
|
||||
params = params.append(this.name, this.serializeValue(array));
|
||||
}
|
||||
} else if (this.value !== null && this.value !== undefined) {
|
||||
// Plain value
|
||||
params = params.append(this.name, this.serializeValue(this.value));
|
||||
}
|
||||
return params;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A parameter in the HTTP request header
|
||||
*/
|
||||
class HeaderParameter extends Parameter {
|
||||
constructor(name: string, value: any, options: ParameterOptions) {
|
||||
super(name, value, options, 'simple', false);
|
||||
}
|
||||
|
||||
append(headers: HttpHeaders): HttpHeaders {
|
||||
if (this.value !== null && this.value !== undefined) {
|
||||
if (this.value instanceof Array) {
|
||||
for (const v of this.value) {
|
||||
headers = headers.append(this.name, this.serializeValue(v));
|
||||
}
|
||||
} else {
|
||||
headers = headers.append(this.name, this.serializeValue(this.value));
|
||||
}
|
||||
}
|
||||
return headers;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper to build http requests from parameters
|
||||
*/
|
||||
export class RequestBuilder {
|
||||
|
||||
private _path = new Map<string, PathParameter>();
|
||||
private _query = new Map<string, QueryParameter>();
|
||||
private _header = new Map<string, HeaderParameter>();
|
||||
_bodyContent: any | null;
|
||||
_bodyContentType?: string;
|
||||
|
||||
constructor(
|
||||
public rootUrl: string,
|
||||
public operationPath: string,
|
||||
public method: string) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a path parameter
|
||||
*/
|
||||
path(name: string, value: any, options?: ParameterOptions): void {
|
||||
this._path.set(name, new PathParameter(name, value, options || {}));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a query parameter
|
||||
*/
|
||||
query(name: string, value: any, options?: ParameterOptions): void {
|
||||
this._query.set(name, new QueryParameter(name, value, options || {}));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a header parameter
|
||||
*/
|
||||
header(name: string, value: any, options?: ParameterOptions): void {
|
||||
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 {
|
||||
if (value instanceof Blob) {
|
||||
this._bodyContentType = value.type;
|
||||
} else {
|
||||
this._bodyContentType = contentType;
|
||||
}
|
||||
if (this._bodyContentType === 'application/x-www-form-urlencoded' && value !== null && typeof value === 'object') {
|
||||
// Handle URL-encoded data
|
||||
const pairs: Array<[string, string]> = [];
|
||||
for (const key of Object.keys(value)) {
|
||||
let val = value[key];
|
||||
if (!(val instanceof Array)) {
|
||||
val = [val];
|
||||
}
|
||||
for (const v of val) {
|
||||
const formValue = this.formDataValue(v);
|
||||
if (formValue !== null) {
|
||||
pairs.push([key, formValue]);
|
||||
}
|
||||
}
|
||||
}
|
||||
this._bodyContent = pairs.map(p => `${encodeURIComponent(p[0])}=${encodeURIComponent(p[1])}`).join('&');
|
||||
} else if (this._bodyContentType === 'multipart/form-data') {
|
||||
// Handle multipart form data
|
||||
const formData = new FormData();
|
||||
if (value !== null && value !== undefined) {
|
||||
for (const key of Object.keys(value)) {
|
||||
const val = value[key];
|
||||
if (val instanceof Array) {
|
||||
for (const v of val) {
|
||||
const toAppend = this.formDataValue(v);
|
||||
if (toAppend !== null) {
|
||||
formData.append(key, toAppend);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
const toAppend = this.formDataValue(val);
|
||||
if (toAppend !== null) {
|
||||
formData.set(key, toAppend);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this._bodyContent = formData;
|
||||
} else {
|
||||
// The body is the plain content
|
||||
this._bodyContent = value;
|
||||
}
|
||||
}
|
||||
|
||||
private formDataValue(value: any): any {
|
||||
if (value === null || value === undefined) {
|
||||
return null;
|
||||
}
|
||||
if (value instanceof Blob) {
|
||||
return value;
|
||||
}
|
||||
if (typeof value === 'object') {
|
||||
return new Blob([JSON.stringify(value)], {type: 'application/json'})
|
||||
}
|
||||
return String(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the request with the current set parameters
|
||||
*/
|
||||
build<T = any>(options?: {
|
||||
/** Which content types to accept */
|
||||
accept?: string;
|
||||
|
||||
/** The expected response type */
|
||||
responseType?: 'json' | 'text' | 'blob' | 'arraybuffer';
|
||||
|
||||
/** Whether to report progress on uploads / downloads */
|
||||
reportProgress?: boolean;
|
||||
|
||||
/** Allow passing HttpContext for HttpClient */
|
||||
context?: HttpContext;
|
||||
}): HttpRequest<T> {
|
||||
|
||||
options = options || {};
|
||||
|
||||
// Path parameters
|
||||
let path = this.operationPath;
|
||||
for (const pathParam of this._path.values()) {
|
||||
path = pathParam.append(path);
|
||||
}
|
||||
const url = this.rootUrl + path;
|
||||
|
||||
// Query parameters
|
||||
let httpParams = new HttpParams({
|
||||
encoder: ParameterCodecInstance
|
||||
});
|
||||
for (const queryParam of this._query.values()) {
|
||||
httpParams = queryParam.append(httpParams);
|
||||
}
|
||||
|
||||
// Header parameters
|
||||
let httpHeaders = new HttpHeaders();
|
||||
if (options.accept) {
|
||||
httpHeaders = httpHeaders.append('Accept', options.accept);
|
||||
}
|
||||
for (const headerParam of this._header.values()) {
|
||||
httpHeaders = headerParam.append(httpHeaders);
|
||||
}
|
||||
|
||||
// Request content headers
|
||||
if (this._bodyContentType && !(this._bodyContent instanceof FormData)) {
|
||||
httpHeaders = httpHeaders.set('Content-Type', this._bodyContentType);
|
||||
}
|
||||
|
||||
// Perform the request
|
||||
return new HttpRequest<T>(this.method.toUpperCase(), url, this._bodyContent, {
|
||||
params: httpParams,
|
||||
headers: httpHeaders,
|
||||
responseType: options.responseType,
|
||||
reportProgress: options.reportProgress,
|
||||
context: options.context
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* Code generated by ng-openapi-gen DO NOT EDIT. */
|
||||
|
||||
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> & {
|
||||
readonly body: T;
|
||||
}
|
||||
+5
-17
@@ -1,24 +1,12 @@
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
import {
|
||||
ApplicationConfig,
|
||||
inject,
|
||||
provideAppInitializer,
|
||||
provideBrowserGlobalErrorListeners,
|
||||
} from '@angular/core';
|
||||
import { MatIconRegistry } from '@angular/material/icon';
|
||||
import { provideRouter, withComponentInputBinding } from '@angular/router';
|
||||
import { provideApiConfiguration } from './api/api-configuration';
|
||||
import { ApplicationConfig, provideBrowserGlobalErrorListeners } from '@angular/core';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { routes } from './app.routes';
|
||||
|
||||
export const appConfig: ApplicationConfig = {
|
||||
providers: [
|
||||
provideBrowserGlobalErrorListeners(),
|
||||
provideRouter(routes, withComponentInputBinding()),
|
||||
provideHttpClient(),
|
||||
provideApiConfiguration('/api'),
|
||||
// Icons are the Material Symbols font served with the app.
|
||||
provideAppInitializer(() => {
|
||||
inject(MatIconRegistry).setDefaultFontSetClass('material-symbols-outlined');
|
||||
}),
|
||||
],
|
||||
provideRouter(routes),
|
||||
provideHttpClient()
|
||||
]
|
||||
};
|
||||
|
||||
+18
-37
@@ -1,39 +1,20 @@
|
||||
<div class="shell">
|
||||
<header class="header">
|
||||
<a class="brand" routerLink="/" aria-label="ISSSTELEON, inicio">
|
||||
<img src="assets/branding/isssteleon-logo.png" alt="ISSSTELEON" />
|
||||
</a>
|
||||
@if (domain(); as current) {
|
||||
<span class="title">Plataforma de Indicadores</span>
|
||||
<button
|
||||
mat-flat-button
|
||||
class="domain"
|
||||
[matMenuTriggerFor]="menu"
|
||||
[disabled]="!others().length"
|
||||
>
|
||||
{{ labels[current] }}
|
||||
<mat-icon iconPositionEnd>expand_more</mat-icon>
|
||||
</button>
|
||||
<mat-menu #menu="matMenu">
|
||||
@for (d of others(); track d) {
|
||||
<a mat-menu-item [routerLink]="['/indicadores', d]">{{ labels[d] }}</a>
|
||||
}
|
||||
</mat-menu>
|
||||
} @else {
|
||||
<span class="title"></span>
|
||||
}
|
||||
<nav class="sections" aria-label="Secciones">
|
||||
<a routerLink="/indicadores/cacu" routerLinkActive="active">Indicadores</a>
|
||||
<a routerLink="/conectar" routerLinkActive="active">Conectar</a>
|
||||
<a routerLink="/revision" routerLinkActive="active">Revisión</a>
|
||||
</nav>
|
||||
</header>
|
||||
<a class="skip-link" href="#contenido-principal">Saltar al contenido principal</a>
|
||||
<header class="institutional-header">
|
||||
<div class="header-content">
|
||||
<img class="institutional-logo" src="images/LogoISSSTELEON.png" alt="ISSSTELEON"
|
||||
width="1125" height="358" />
|
||||
<span class="platform-title">{{ title }}</span>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="main">
|
||||
<router-outlet />
|
||||
</main>
|
||||
<main #mainContent id="contenido-principal" tabindex="-1">
|
||||
<router-outlet />
|
||||
</main>
|
||||
|
||||
<footer class="footer">
|
||||
<img src="assets/branding/isssteleon-logo.png" alt="" />
|
||||
</footer>
|
||||
</div>
|
||||
@if (showBackToTop()) {
|
||||
<button class="back-to-top" type="button" aria-label="Volver al inicio" (click)="backToTop()">
|
||||
<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" width="24" height="24">
|
||||
<path d="M12 19V5m-7 7 7-7 7 7" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
||||
</svg>
|
||||
</button>
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
import { routes } from './app.routes';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { Router, provideRouter } from '@angular/router';
|
||||
import { RouterTestingHarness } from '@angular/router/testing';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { IndicadoresPage } from './features/indicadores/indicadores-page';
|
||||
it('permite acceso directo a /indicadores sin guard ni autenticación', async () => {
|
||||
TestBed.configureTestingModule({ providers: [provideRouter(routes), provideHttpClient(), provideHttpClientTesting()] });
|
||||
const harness = await RouterTestingHarness.create();
|
||||
await harness.navigateByUrl('/indicadores', IndicadoresPage);
|
||||
expect(TestBed.inject(Router).url).toBe('/indicadores/tea');
|
||||
expect(harness.routeNativeElement?.textContent).toContain('Dashboard de indicadores');
|
||||
const http = TestBed.inject(HttpTestingController);
|
||||
http.expectOne('/tea/indicadores').flush([]);
|
||||
http.verify();
|
||||
});
|
||||
|
||||
for (const dominio of ['tea', 'cacu', 'cama']) {
|
||||
it(`navega directamente al dominio ${dominio} y conserva la ruta compartida diferida`, async () => {
|
||||
TestBed.configureTestingModule({ providers: [provideRouter(routes), provideHttpClient(), provideHttpClientTesting()] });
|
||||
const harness = await RouterTestingHarness.create();
|
||||
const page = await harness.navigateByUrl(`/indicadores/${dominio}`, IndicadoresPage);
|
||||
expect(page.dominio).toBe(dominio);
|
||||
const http = TestBed.inject(HttpTestingController);
|
||||
http.expectOne(`/${dominio}/indicadores`).flush([]);
|
||||
expect(harness.routeNativeElement?.querySelectorAll('nav a').length).toBe(3);
|
||||
http.verify();
|
||||
});
|
||||
}
|
||||
it('cancela catálogos pendientes durante navegación rápida entre dominios', async () => {
|
||||
TestBed.configureTestingModule({ providers: [provideRouter(routes), provideHttpClient(), provideHttpClientTesting()] });
|
||||
const harness = await RouterTestingHarness.create();
|
||||
const http = TestBed.inject(HttpTestingController);
|
||||
await harness.navigateByUrl('/indicadores/tea', IndicadoresPage);
|
||||
const tea = http.expectOne('/tea/indicadores');
|
||||
await harness.navigateByUrl('/indicadores/cacu', IndicadoresPage);
|
||||
const cacu = http.expectOne('/cacu/indicadores');
|
||||
const page = await harness.navigateByUrl('/indicadores/cama', IndicadoresPage);
|
||||
expect(tea.cancelled).toBe(true);
|
||||
expect(cacu.cancelled).toBe(true);
|
||||
expect(() => tea.flush([])).toThrow();
|
||||
http.expectOne('/cama/indicadores').flush([]);
|
||||
expect(page.dominio).toBe('cama');
|
||||
expect(page.catalog()).toEqual([]);
|
||||
http.verify();
|
||||
});
|
||||
+4
-12
@@ -1,16 +1,8 @@
|
||||
import { Routes } from '@angular/router';
|
||||
import { DOMINIOS } from './features/indicadores/indicadores.models';
|
||||
|
||||
const loadIndicadores = () => import('./features/indicadores/indicadores-page').then(module => module.IndicadoresPage);
|
||||
export const routes: Routes = [
|
||||
{ path: '', pathMatch: 'full', redirectTo: 'indicadores/cacu' },
|
||||
{
|
||||
path: 'indicadores/:domain',
|
||||
loadComponent: () => import('./indicadores/indicadores').then((m) => m.Indicadores),
|
||||
},
|
||||
{
|
||||
path: 'indicadores/:domain/pacientes/:id',
|
||||
loadComponent: () => import('./paciente/paciente').then((m) => m.Paciente),
|
||||
},
|
||||
{ path: 'conectar', loadComponent: () => import('./conectar/conectar').then((m) => m.Conectar) },
|
||||
{ path: 'revision', loadComponent: () => import('./revision/revision').then((m) => m.Revision) },
|
||||
{ path: '**', redirectTo: 'indicadores/cacu' },
|
||||
{ path: 'indicadores', pathMatch: 'full', redirectTo: 'indicadores/tea' },
|
||||
...DOMINIOS.map(dominio => ({ path: `indicadores/${dominio}`, data: { dominio }, loadComponent: loadIndicadores })),
|
||||
];
|
||||
|
||||
+96
-61
@@ -1,74 +1,109 @@
|
||||
.shell {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 100dvh;
|
||||
}
|
||||
|
||||
.header {
|
||||
align-items: center;
|
||||
background: var(--color-surface);
|
||||
border-bottom: 1px solid var(--color-border);
|
||||
display: flex;
|
||||
gap: var(--space-4);
|
||||
min-height: var(--header-height);
|
||||
padding: 0 clamp(16px, 3.2vw, 48px);
|
||||
}
|
||||
|
||||
.brand img {
|
||||
:host {
|
||||
display: block;
|
||||
width: clamp(132px, 16vw, 200px);
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
.title {
|
||||
flex: 1;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 500;
|
||||
.institutional-header {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 100;
|
||||
background: var(--issste-surface);
|
||||
border-bottom: 3px solid var(--issste-logo-lime);
|
||||
}
|
||||
|
||||
.domain {
|
||||
--mat-button-filled-container-color: var(--color-primary);
|
||||
--mat-button-filled-label-text-color: var(--color-text);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.sections {
|
||||
.header-content {
|
||||
display: flex;
|
||||
gap: var(--space-4);
|
||||
}
|
||||
|
||||
.sections a {
|
||||
color: var(--color-text-secondary);
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.sections a.active {
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.main {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.footer {
|
||||
align-items: center;
|
||||
background: var(--color-text-secondary);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
min-height: 86px;
|
||||
gap: var(--issste-space-4);
|
||||
box-sizing: border-box;
|
||||
min-height: 69px;
|
||||
max-width: 1488px;
|
||||
margin-inline: auto;
|
||||
padding-inline: var(--issste-page-gutter);
|
||||
}
|
||||
|
||||
.footer img {
|
||||
filter: brightness(0) invert(1);
|
||||
width: clamp(155px, 15vw, 185px);
|
||||
.institutional-logo {
|
||||
display: block;
|
||||
flex: 0 0 auto;
|
||||
width: 200px;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.title {
|
||||
display: none;
|
||||
.platform-title {
|
||||
color: var(--issste-text);
|
||||
font-family: var(--issste-font-heading);
|
||||
font-size: 1.5rem;
|
||||
font-weight: 600;
|
||||
line-height: 1.15;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
main {
|
||||
padding: var(--issste-space-4) var(--issste-page-gutter) 5.5rem;
|
||||
scroll-margin-top: var(--issste-header-clearance);
|
||||
}
|
||||
|
||||
.skip-link {
|
||||
position: fixed;
|
||||
top: var(--issste-space-2);
|
||||
left: var(--issste-page-gutter);
|
||||
z-index: 101;
|
||||
transform: translateY(-200%);
|
||||
padding: var(--issste-space-2) var(--issste-space-3);
|
||||
color: var(--issste-surface);
|
||||
background: var(--issste-text);
|
||||
border-radius: var(--issste-radius);
|
||||
}
|
||||
|
||||
.skip-link:focus {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
@media (max-width: 550px) {
|
||||
.header-content {
|
||||
gap: var(--issste-space-2);
|
||||
min-height: 64px;
|
||||
}
|
||||
|
||||
.institutional-logo {
|
||||
width: 145px;
|
||||
}
|
||||
|
||||
.platform-title {
|
||||
font-size: 1.125rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 359px) {
|
||||
.header-content {
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
padding-block: var(--issste-space-2);
|
||||
gap: var(--issste-space-1);
|
||||
}
|
||||
|
||||
.platform-title {
|
||||
flex-basis: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.back-to-top {
|
||||
position: fixed;
|
||||
right: max(var(--issste-page-gutter), env(safe-area-inset-right));
|
||||
bottom: max(var(--issste-space-4), env(safe-area-inset-bottom));
|
||||
z-index: 90;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
padding: 0;
|
||||
border: 1px solid var(--issste-text);
|
||||
border-radius: 50%;
|
||||
background: var(--issste-text);
|
||||
color: var(--issste-surface);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.back-to-top:hover { background: var(--issste-text-secondary); }
|
||||
.back-to-top:focus-visible { outline: 3px solid var(--issste-text); outline-offset: 4px; }
|
||||
|
||||
+112
-6
@@ -1,15 +1,121 @@
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { App } from './app';
|
||||
|
||||
describe('App', () => {
|
||||
it('creates the shell', async () => {
|
||||
describe('App — UX-06B', () => {
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [App],
|
||||
providers: [provideHttpClient(), provideHttpClientTesting(), provideRouter([])],
|
||||
providers: [provideRouter([]), provideHttpClient(), provideHttpClientTesting()],
|
||||
}).compileComponents();
|
||||
expect(TestBed.createComponent(App).componentInstance).toBeTruthy();
|
||||
});
|
||||
|
||||
function render() {
|
||||
const fixture = TestBed.createComponent(App);
|
||||
fixture.detectChanges();
|
||||
return fixture;
|
||||
}
|
||||
|
||||
it('should create the app', () => {
|
||||
expect(render().componentInstance).toBeTruthy();
|
||||
});
|
||||
|
||||
it('renders one institutional header and the platform identification', () => {
|
||||
const element = render().nativeElement as HTMLElement;
|
||||
expect(element.querySelectorAll('header')).toHaveLength(1);
|
||||
expect(element.querySelector('header')?.textContent).toContain('Plataforma de Indicadores');
|
||||
});
|
||||
|
||||
it('uses the authorized static logo with alternative text and intrinsic proportions', () => {
|
||||
const logo = (render().nativeElement as HTMLElement).querySelector('header img');
|
||||
expect(logo?.getAttribute('src')).toBe('images/LogoISSSTELEON.png');
|
||||
expect(logo?.getAttribute('alt')).toBe('ISSSTELEON');
|
||||
expect(logo?.getAttribute('width')).toBe('1125');
|
||||
expect(logo?.getAttribute('height')).toBe('358');
|
||||
});
|
||||
|
||||
it('keeps the routed content inside a main landmark and a keyboard skip target', () => {
|
||||
const element = render().nativeElement as HTMLElement;
|
||||
const main = element.querySelector('main#contenido-principal');
|
||||
expect(main?.querySelector('router-outlet')).toBeTruthy();
|
||||
expect(main?.getAttribute('tabindex')).toBe('-1');
|
||||
expect(element.querySelector('a.skip-link')?.getAttribute('href')).toBe('#contenido-principal');
|
||||
});
|
||||
|
||||
it('does not duplicate domain navigation or introduce shell HTTP requests', () => {
|
||||
const fixture = render();
|
||||
fixture.detectChanges();
|
||||
const element = fixture.nativeElement as HTMLElement;
|
||||
expect(element.querySelector('nav')).toBeNull();
|
||||
expect(element.querySelectorAll('[routerLink]')).toHaveLength(0);
|
||||
TestBed.inject(HttpTestingController).expectNone(() => true);
|
||||
TestBed.inject(HttpTestingController).verify();
|
||||
});
|
||||
});
|
||||
|
||||
describe('App — UX-06D volver al inicio', () => {
|
||||
let scrollY: number;
|
||||
beforeEach(() => {
|
||||
scrollY = 0;
|
||||
vi.spyOn(window, 'scrollY', 'get').mockImplementation(() => scrollY);
|
||||
TestBed.configureTestingModule({ imports: [App], providers: [provideRouter([])] });
|
||||
});
|
||||
afterEach(() => { vi.restoreAllMocks(); vi.unstubAllGlobals(); });
|
||||
function render() {
|
||||
const fixture = TestBed.createComponent(App);
|
||||
fixture.detectChanges();
|
||||
return fixture;
|
||||
}
|
||||
function scroll(fixture: ReturnType<typeof render>, position: number) {
|
||||
scrollY = position;
|
||||
window.dispatchEvent(new Event('scroll'));
|
||||
fixture.detectChanges();
|
||||
}
|
||||
it('oculta al inicio y en el umbral, muestra después y vuelve a ocultar al subir', () => {
|
||||
const fixture = render();
|
||||
expect(fixture.nativeElement.querySelector('.back-to-top')).toBeNull();
|
||||
scroll(fixture, 400);
|
||||
expect(fixture.nativeElement.querySelector('.back-to-top')).toBeNull();
|
||||
scroll(fixture, 401);
|
||||
expect(fixture.nativeElement.querySelector('.back-to-top')).not.toBeNull();
|
||||
scroll(fixture, 0);
|
||||
expect(fixture.nativeElement.querySelector('.back-to-top')).toBeNull();
|
||||
});
|
||||
it('reconoce una posición restaurada al montar el shell', () => {
|
||||
scrollY = 900;
|
||||
expect(render().nativeElement.querySelector('.back-to-top')).not.toBeNull();
|
||||
});
|
||||
it.each([false, true])('activa un botón nativo y respeta movimiento reducido=%s', reduced => {
|
||||
const matchMedia = vi.fn().mockReturnValue({ matches: reduced } as MediaQueryList);
|
||||
vi.stubGlobal('matchMedia', matchMedia);
|
||||
const scrollTo = vi.spyOn(window, 'scrollTo').mockImplementation(() => {});
|
||||
const fixture = render();
|
||||
scroll(fixture, 900);
|
||||
const button = fixture.nativeElement.querySelector('.back-to-top') as HTMLButtonElement;
|
||||
const main = fixture.nativeElement.querySelector('main') as HTMLElement;
|
||||
const focus = vi.spyOn(main, 'focus');
|
||||
expect(button.type).toBe('button');
|
||||
expect(button.tabIndex).toBe(0);
|
||||
expect(button.getAttribute('aria-label')).toBe('Volver al inicio');
|
||||
expect(button.querySelector('svg')?.getAttribute('aria-hidden')).toBe('true');
|
||||
button.click();
|
||||
expect(matchMedia).toHaveBeenCalledWith('(prefers-reduced-motion: reduce)');
|
||||
expect(scrollTo).toHaveBeenCalledWith({ top: 0, behavior: reduced ? 'instant' : 'smooth' });
|
||||
expect(focus).toHaveBeenCalledWith({ preventScroll: true });
|
||||
// Native Enter/Space activation is checked in Chrome, not emulated by jsdom.
|
||||
});
|
||||
it('registra un listener pasivo y elimina exactamente el mismo al destruir', () => {
|
||||
const add = vi.spyOn(window, 'addEventListener');
|
||||
const remove = vi.spyOn(window, 'removeEventListener');
|
||||
const fixture = render();
|
||||
const registration = add.mock.calls.find(call => call[0] === 'scroll')!;
|
||||
expect(registration[2]).toEqual({ passive: true });
|
||||
fixture.destroy();
|
||||
expect(remove).toHaveBeenCalledWith('scroll', registration[1]);
|
||||
scrollY = 900;
|
||||
window.dispatchEvent(new Event('scroll'));
|
||||
expect(fixture.componentInstance.showBackToTop()).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
+27
-45
@@ -1,51 +1,33 @@
|
||||
import { Component, computed, inject, resource } from '@angular/core';
|
||||
import { toSignal } from '@angular/core/rxjs-interop';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
import { NavigationEnd, Router, RouterLink, RouterLinkActive, RouterOutlet } from '@angular/router';
|
||||
import { filter, map } from 'rxjs';
|
||||
import { Api } from './api/api';
|
||||
import { domains } from './api/fn/operations/domains';
|
||||
import { Domain } from './api/models/domain';
|
||||
import { DOCUMENT } from '@angular/common';
|
||||
import { Component, ElementRef, inject, OnDestroy, OnInit, signal, ViewChild } from '@angular/core';
|
||||
import { RouterOutlet } from '@angular/router';
|
||||
|
||||
export const DOMAINS: Record<Domain, string> = {
|
||||
cacu: 'Cáncer cervicouterino',
|
||||
cama: 'Cáncer de mama',
|
||||
tea: 'TEA',
|
||||
};
|
||||
|
||||
/** The shell: header (logo, the domain's title and switcher, or the section), page, footer. */
|
||||
@Component({
|
||||
imports: [RouterOutlet],
|
||||
selector: 'app-root',
|
||||
imports: [
|
||||
RouterOutlet,
|
||||
RouterLink,
|
||||
RouterLinkActive,
|
||||
MatButtonModule,
|
||||
MatIconModule,
|
||||
MatMenuModule,
|
||||
],
|
||||
templateUrl: './app.html',
|
||||
styleUrl: './app.scss',
|
||||
templateUrl: './app.html',
|
||||
})
|
||||
export class App {
|
||||
private readonly api = inject(Api);
|
||||
private readonly router = inject(Router);
|
||||
protected readonly labels = DOMAINS;
|
||||
protected readonly domains = resource({ loader: () => this.api.invoke(domains) });
|
||||
private readonly url = toSignal(
|
||||
this.router.events.pipe(
|
||||
filter((e) => e instanceof NavigationEnd),
|
||||
map((e) => (e as NavigationEnd).urlAfterRedirects),
|
||||
),
|
||||
{ initialValue: '' },
|
||||
);
|
||||
/** The domain of an indicator page, if this is one. */
|
||||
protected readonly domain = computed(
|
||||
() => /^\/indicadores\/(\w+)/.exec(this.url())?.[1] as Domain | undefined,
|
||||
);
|
||||
protected readonly others = computed(() =>
|
||||
(this.domains.value() ?? []).filter((d) => d !== this.domain()),
|
||||
);
|
||||
export class App implements OnInit, OnDestroy {
|
||||
protected readonly title = 'Plataforma de Indicadores';
|
||||
readonly showBackToTop = signal(false);
|
||||
@ViewChild('mainContent') private mainContent?: ElementRef<HTMLElement>;
|
||||
private readonly browserWindow = inject(DOCUMENT).defaultView;
|
||||
private readonly updateScroll = () => this.showBackToTop.set((this.browserWindow?.scrollY ?? 0) > 400);
|
||||
|
||||
ngOnInit() {
|
||||
this.updateScroll();
|
||||
this.browserWindow?.addEventListener('scroll', this.updateScroll, { passive: true });
|
||||
}
|
||||
|
||||
backToTop() {
|
||||
const reducedMotion = this.browserWindow?.matchMedia?.('(prefers-reduced-motion: reduce)').matches;
|
||||
// Keep keyboard focus near the destination when the floating button disappears.
|
||||
this.mainContent?.nativeElement.focus({ preventScroll: true });
|
||||
this.browserWindow?.scrollTo({ top: 0, behavior: reducedMotion ? 'instant' : 'smooth' });
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.browserWindow?.removeEventListener('scroll', this.updateScroll);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,112 +0,0 @@
|
||||
<div class="workspace">
|
||||
<aside class="pipelines">
|
||||
<h2>Canalizaciones</h2>
|
||||
<mat-nav-list dense>
|
||||
@for (p of list.value() ?? []; track p['pipeline_id']) {
|
||||
<a
|
||||
mat-list-item
|
||||
[activated]="p['pipeline_id'] === pipelineId()"
|
||||
(click)="open(p['pipeline_id'])"
|
||||
>
|
||||
<span matListItemTitle>{{ p['pipeline_id'] }}</span>
|
||||
<span matListItemLine>v{{ p['version'] }}</span>
|
||||
</a>
|
||||
}
|
||||
</mat-nav-list>
|
||||
<mat-form-field appearance="outline" subscriptSizing="dynamic" class="new">
|
||||
<mat-label>Nueva canalización</mat-label>
|
||||
<input matInput #name (keydown.enter)="create(name.value)" placeholder="hospital_norte" />
|
||||
</mat-form-field>
|
||||
</aside>
|
||||
|
||||
<section class="canvas-area">
|
||||
<div class="toolbar">
|
||||
<span class="title"
|
||||
>{{ pipelineId() ?? 'Elija o cree una canalización' }}
|
||||
@if (version()) {
|
||||
<span class="muted"> · v{{ version() }}</span>
|
||||
}
|
||||
</span>
|
||||
@if (pipelineId()) {
|
||||
@for (k of kinds; track k[0]) {
|
||||
<button mat-stroked-button (click)="add(k[0])"><mat-icon>add</mat-icon>{{ k[1] }}</button>
|
||||
}
|
||||
<span class="spacer"></span>
|
||||
<button mat-stroked-button (click)="save()">Guardar</button>
|
||||
<button mat-flat-button (click)="start()" [disabled]="running()">Ejecutar</button>
|
||||
}
|
||||
</div>
|
||||
@if (message()) {
|
||||
<p class="message" role="status">{{ message() }}</p>
|
||||
}
|
||||
@if (run(); as r) {
|
||||
<p class="run" role="status">
|
||||
Ejecución <code>{{ r.id.slice(0, 8) }}</code>: <strong>{{ r.status }}</strong> ·
|
||||
<a [href]="dagster()" target="_blank" rel="noopener">ver en Dagster</a>
|
||||
</p>
|
||||
}
|
||||
<div class="canvas">
|
||||
@if (pipelineId()) {
|
||||
<vflow
|
||||
[nodes]="nodes()"
|
||||
[edges]="edges()"
|
||||
[connection]="{ curve: 'smooth-step', marker: { type: 'arrow-closed' } }"
|
||||
(connect)="connect($event)"
|
||||
(nodesChanges)="changed($event)"
|
||||
view="auto"
|
||||
background="#f7f8f6"
|
||||
/>
|
||||
}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@if (doc(); as d) {
|
||||
<aside class="panel">
|
||||
<div class="panel-head">
|
||||
<h2>
|
||||
{{ kindLabel(d.kind) }} · <span class="muted">{{ d.id }}</span>
|
||||
</h2>
|
||||
<button mat-icon-button (click)="remove(d.id)" aria-label="Quitar nodo">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
<mat-form-field appearance="outline" subscriptSizing="dynamic" class="full">
|
||||
<mat-label>Id</mat-label>
|
||||
<input matInput [value]="d.id" (change)="rename($any($event.target).value)" />
|
||||
</mat-form-field>
|
||||
@if (d.inputs?.length) {
|
||||
<div class="inputs">
|
||||
Entradas:
|
||||
@for (i of d.inputs; track i) {
|
||||
<button mat-stroked-button class="chip" (click)="disconnect(d.id, i)">
|
||||
{{ i }} <mat-icon>close</mat-icon>
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
} @else if (d.kind !== 'source') {
|
||||
<p class="muted">Una flecha desde otro nodo le da su entrada.</p>
|
||||
}
|
||||
<formly-form
|
||||
[form]="form"
|
||||
[fields]="fields()"
|
||||
[model]="model"
|
||||
(modelChange)="edited($event)"
|
||||
/>
|
||||
<button mat-stroked-button (click)="show()">Vista previa</button>
|
||||
@if (preview(); as rows) {
|
||||
<div class="preview">
|
||||
<table mat-table [dataSource]="rows">
|
||||
@for (c of columns(); track c) {
|
||||
<ng-container [matColumnDef]="c">
|
||||
<th mat-header-cell *matHeaderCellDef>{{ c }}</th>
|
||||
<td mat-cell *matCellDef="let row">{{ cell(row[c]) }}</td>
|
||||
</ng-container>
|
||||
}
|
||||
<tr mat-header-row *matHeaderRowDef="columns()"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: columns()"></tr>
|
||||
</table>
|
||||
</div>
|
||||
}
|
||||
</aside>
|
||||
}
|
||||
</div>
|
||||
@@ -1,111 +0,0 @@
|
||||
:host {
|
||||
display: block;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.workspace {
|
||||
display: grid;
|
||||
grid-template-columns: 220px 1fr auto;
|
||||
height: calc(100dvh - var(--header-height) - 86px);
|
||||
min-height: 560px;
|
||||
}
|
||||
|
||||
.pipelines,
|
||||
.panel {
|
||||
background: var(--color-surface);
|
||||
border-right: 1px solid var(--color-border);
|
||||
overflow-y: auto;
|
||||
padding: var(--space-3);
|
||||
}
|
||||
|
||||
.panel {
|
||||
border-left: 1px solid var(--color-border);
|
||||
border-right: 0;
|
||||
width: 380px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 1rem;
|
||||
font-weight: 500;
|
||||
margin: 0 0 var(--space-2);
|
||||
}
|
||||
|
||||
.new,
|
||||
.full {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.canvas-area {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
align-items: center;
|
||||
background: var(--color-surface);
|
||||
border-bottom: 1px solid var(--color-border);
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-2);
|
||||
padding: var(--space-2) var(--space-3);
|
||||
}
|
||||
|
||||
.title {
|
||||
font-weight: 500;
|
||||
margin-right: var(--space-3);
|
||||
}
|
||||
|
||||
.spacer {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.message,
|
||||
.run {
|
||||
margin: var(--space-2) var(--space-3) 0;
|
||||
}
|
||||
|
||||
.canvas {
|
||||
flex: 1;
|
||||
min-height: 400px;
|
||||
}
|
||||
|
||||
.panel-head {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.inputs {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-1);
|
||||
margin: var(--space-2) 0;
|
||||
}
|
||||
|
||||
.preview {
|
||||
margin-top: var(--space-3);
|
||||
max-height: 360px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.preview td,
|
||||
.preview th {
|
||||
font-size: 12px;
|
||||
max-width: 220px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.workspace {
|
||||
grid-template-columns: 1fr;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.panel {
|
||||
width: auto;
|
||||
}
|
||||
}
|
||||
@@ -1,344 +0,0 @@
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { Component, computed, inject, resource, signal, WritableSignal } from '@angular/core';
|
||||
import { FormsModule, ReactiveFormsModule, UntypedFormGroup } from '@angular/forms';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { MatListModule } from '@angular/material/list';
|
||||
import { MatTableModule } from '@angular/material/table';
|
||||
import { FormlyFieldConfig, FormlyForm, provideFormlyCore } from '@ngx-formly/core';
|
||||
import { FormlyJsonschema } from '@ngx-formly/core/json-schema';
|
||||
import { withFormlyMaterial } from '@ngx-formly/material';
|
||||
import { Connection, NodeChange, Vflow } from 'ngx-vflow';
|
||||
import { Api } from '../api/api';
|
||||
import { nodeRows } from '../api/fn/ingest/node-rows';
|
||||
import { pipeline as getPipeline } from '../api/fn/ingest/pipeline';
|
||||
import { pipelines } from '../api/fn/ingest/pipelines';
|
||||
import { savePipeline } from '../api/fn/ingest/save-pipeline';
|
||||
import { schema } from '../api/fn/ingest/schema';
|
||||
import { sourcePreview } from '../api/fn/ingest/source-preview';
|
||||
import { startRun } from '../api/fn/ingest/start-run';
|
||||
import { runStatus } from '../api/fn/runs/run-status';
|
||||
import type { Pipeline } from '../api/models/pipeline';
|
||||
import type { Source } from '../api/models/source';
|
||||
import { FORMLY_TYPES, nodeSchema } from './schema-form';
|
||||
|
||||
type Doc = Pipeline['nodes'][number];
|
||||
type Kind = NonNullable<Doc['kind']>;
|
||||
interface CanvasNode {
|
||||
id: string;
|
||||
type: 'default';
|
||||
point: WritableSignal<{ x: number; y: number }>;
|
||||
text: WritableSignal<string>;
|
||||
width: WritableSignal<number>;
|
||||
height: WritableSignal<number>;
|
||||
}
|
||||
|
||||
function canvasNode(id: string, point: { x: number; y: number }, label: string): CanvasNode {
|
||||
return {
|
||||
id,
|
||||
type: 'default',
|
||||
point: signal(point),
|
||||
text: signal(label),
|
||||
width: signal(190),
|
||||
height: signal(56),
|
||||
};
|
||||
}
|
||||
|
||||
export const KINDS: Record<Kind, string> = {
|
||||
source: 'Fuente',
|
||||
read: 'Leer',
|
||||
route: 'Filtrar',
|
||||
map: 'Mapear',
|
||||
extract: 'Extraer',
|
||||
join: 'Unir',
|
||||
link: 'Vincular',
|
||||
target: 'Destino',
|
||||
};
|
||||
const ID = /^[a-z][a-z0-9_]*$/;
|
||||
|
||||
/** /conectar: an operator draws a site's pipeline on a canvas (nodes and the edges between
|
||||
* them), fills each node's form, previews what it gives, saves a version and runs it. */
|
||||
@Component({
|
||||
selector: 'app-conectar',
|
||||
imports: [
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
FormlyForm,
|
||||
MatButtonModule,
|
||||
MatFormFieldModule,
|
||||
MatIconModule,
|
||||
MatInputModule,
|
||||
MatListModule,
|
||||
MatTableModule,
|
||||
Vflow,
|
||||
],
|
||||
// Forms are this page's only: Formly loads with it, not with the app.
|
||||
providers: [provideFormlyCore([...withFormlyMaterial(), FORMLY_TYPES])],
|
||||
templateUrl: './conectar.html',
|
||||
styleUrl: './conectar.scss',
|
||||
})
|
||||
export class Conectar {
|
||||
private readonly api = inject(Api);
|
||||
private readonly jsonschema = inject(FormlyJsonschema);
|
||||
protected readonly kinds = Object.entries(KINDS) as [Kind, string][];
|
||||
|
||||
protected readonly list = resource({ loader: () => this.api.invoke(pipelines) });
|
||||
private readonly schema = resource({ loader: () => this.api.invoke(schema) });
|
||||
|
||||
protected readonly pipelineId = signal<string | undefined>(undefined);
|
||||
protected readonly version = signal<number | undefined>(undefined);
|
||||
/** The drawn pipeline: node configs (positions live on the canvas nodes). */
|
||||
protected readonly docs = signal<Doc[]>([]);
|
||||
protected readonly nodes = signal<CanvasNode[]>([]);
|
||||
protected readonly edges = computed(() =>
|
||||
this.docs().flatMap((d) =>
|
||||
(d.inputs ?? []).map((i) => ({ id: `${i}->${d.id}`, source: i, target: d.id })),
|
||||
),
|
||||
);
|
||||
protected readonly selected = signal<string | undefined>(undefined);
|
||||
protected readonly doc = computed(() => this.docs().find((d) => d.id === this.selected()));
|
||||
protected readonly message = signal('');
|
||||
protected readonly run = signal<{ id: string; status: string } | undefined>(undefined);
|
||||
protected readonly running = computed(() => {
|
||||
const run = this.run();
|
||||
return !!run && !['SUCCESS', 'FAILURE', 'CANCELED'].includes(run.status);
|
||||
});
|
||||
|
||||
protected form = new UntypedFormGroup({});
|
||||
protected model: Record<string, unknown> = {};
|
||||
/** The selected node's form, generated from its kind's JSON Schema. */
|
||||
protected readonly fields = computed<FormlyFieldConfig[]>(() => {
|
||||
const kind = this.doc()?.kind;
|
||||
const pipeline = this.schema.value()?.['pipeline'];
|
||||
if (!kind || !pipeline) return [];
|
||||
return [this.jsonschema.toFieldConfig(nodeSchema(pipeline as never, kind))];
|
||||
});
|
||||
|
||||
protected readonly preview = signal<Record<string, unknown>[] | undefined>(undefined);
|
||||
protected readonly columns = computed(() => Object.keys(this.preview()?.[0] ?? {}));
|
||||
|
||||
async open(id: string): Promise<void> {
|
||||
const saved = await this.api.invoke(getPipeline, { pipeline_id: id });
|
||||
this.pipelineId.set(id);
|
||||
this.version.set(saved.version);
|
||||
this.load(saved.pipeline.nodes);
|
||||
this.message.set('');
|
||||
}
|
||||
|
||||
protected create(id: string): void {
|
||||
if (!ID.test(id)) {
|
||||
this.message.set('El nombre va en minúsculas, sin espacios (a-z, 0-9, _).');
|
||||
return;
|
||||
}
|
||||
this.pipelineId.set(id);
|
||||
this.version.set(undefined);
|
||||
this.load([]);
|
||||
this.message.set('');
|
||||
}
|
||||
|
||||
private load(docs: Doc[]): void {
|
||||
this.docs.set(docs);
|
||||
const depth = depths(docs);
|
||||
const row = new Map<number, number>();
|
||||
this.nodes.set(
|
||||
docs.map((d) => {
|
||||
const level = depth.get(d.id) ?? 0;
|
||||
const n = row.get(level) ?? 0;
|
||||
row.set(level, n + 1);
|
||||
const point = d.position ?? { x: 40 + level * 260, y: 40 + n * 90 };
|
||||
return canvasNode(d.id, point, text(d));
|
||||
}),
|
||||
);
|
||||
this.select(undefined);
|
||||
}
|
||||
|
||||
protected add(kind: Kind): void {
|
||||
let n = 1;
|
||||
while (this.docs().some((d) => d.id === `${kind}_${n}`)) n++;
|
||||
const id = `${kind}_${n}`;
|
||||
const doc = { id, kind, inputs: [] } as unknown as Doc;
|
||||
this.docs.update((ds) => [...ds, doc]);
|
||||
this.nodes.update((ns) => [
|
||||
...ns,
|
||||
canvasNode(id, { x: 60, y: 60 + ns.length * 30 }, text(doc)),
|
||||
]);
|
||||
this.select(id);
|
||||
}
|
||||
|
||||
protected remove(id: string): void {
|
||||
this.docs.update((ds) =>
|
||||
ds
|
||||
.filter((d) => d.id !== id)
|
||||
.map((d) => ({ ...d, inputs: (d.inputs ?? []).filter((i) => i !== id) })),
|
||||
);
|
||||
this.nodes.update((ns) => ns.filter((n) => n.id !== id));
|
||||
this.select(undefined);
|
||||
}
|
||||
|
||||
protected connect({ source, target }: Connection): void {
|
||||
this.update(target, (d) => ({ ...d, inputs: [...new Set([...(d.inputs ?? []), source])] }));
|
||||
}
|
||||
|
||||
protected disconnect(target: string, source: string): void {
|
||||
this.update(target, (d) => ({ ...d, inputs: (d.inputs ?? []).filter((i) => i !== source) }));
|
||||
}
|
||||
|
||||
protected changed(changes: NodeChange[]): void {
|
||||
for (const c of changes) {
|
||||
if (c.type === 'select' && c.selected) this.select(c.id);
|
||||
}
|
||||
}
|
||||
|
||||
protected select(id: string | undefined): void {
|
||||
this.selected.set(id);
|
||||
const doc = (this.docs().find((d) => d.id === id) ?? {}) as Record<string, unknown>;
|
||||
this.model = Object.fromEntries(
|
||||
Object.entries(structuredClone(doc)).filter(
|
||||
([k]) => !['id', 'kind', 'inputs', 'position'].includes(k),
|
||||
),
|
||||
);
|
||||
this.form = new UntypedFormGroup({});
|
||||
this.preview.set(undefined);
|
||||
}
|
||||
|
||||
/** The form's values into the selected node. */
|
||||
protected edited(model: Record<string, unknown>): void {
|
||||
const id = this.selected();
|
||||
if (!id) return;
|
||||
const values = Object.fromEntries(
|
||||
Object.entries(model).filter(([, v]) => v !== undefined && v !== null),
|
||||
);
|
||||
this.update(
|
||||
id,
|
||||
(d) => ({ ...values, id: d.id, kind: d.kind, inputs: d.inputs }) as unknown as Doc,
|
||||
);
|
||||
}
|
||||
|
||||
protected rename(to: string): void {
|
||||
const from = this.selected();
|
||||
if (!from || from === to || !ID.test(to) || this.docs().some((d) => d.id === to)) return;
|
||||
this.docs.update((ds) =>
|
||||
ds.map((d) => ({
|
||||
...d,
|
||||
id: d.id === from ? to : d.id,
|
||||
inputs: (d.inputs ?? []).map((i) => (i === from ? to : i)),
|
||||
})),
|
||||
);
|
||||
this.nodes.update((ns) => ns.map((n) => (n.id === from ? { ...n, id: to } : n)));
|
||||
this.selected.set(to);
|
||||
}
|
||||
|
||||
private update(id: string, change: (d: Doc) => Doc): void {
|
||||
this.docs.update((ds) => ds.map((d) => (d.id === id ? change(d) : d)));
|
||||
const doc = this.docs().find((d) => d.id === id);
|
||||
if (doc)
|
||||
this.nodes()
|
||||
.find((n) => n.id === id)
|
||||
?.text.set(text(doc));
|
||||
}
|
||||
|
||||
/** The drawn pipeline, each node where it sits on the canvas. */
|
||||
private drawn(): Pipeline {
|
||||
const at = new Map(this.nodes().map((n) => [n.id, n.point()]));
|
||||
return { nodes: this.docs().map((d) => ({ ...d, position: at.get(d.id) })) } as Pipeline;
|
||||
}
|
||||
|
||||
protected async save(): Promise<boolean> {
|
||||
const id = this.pipelineId();
|
||||
if (!id) return false;
|
||||
try {
|
||||
const { version } = await this.api.invoke(savePipeline, {
|
||||
pipeline_id: id,
|
||||
body: this.drawn(),
|
||||
});
|
||||
this.version.set(version);
|
||||
this.message.set(`Versión ${version} guardada.`);
|
||||
this.list.reload();
|
||||
return true;
|
||||
} catch (e) {
|
||||
this.message.set(problem(e));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/** Saves, starts the `ingest` job and follows it to its end. */
|
||||
protected async start(): Promise<void> {
|
||||
const id = this.pipelineId();
|
||||
if (!id || !(await this.save())) return;
|
||||
try {
|
||||
const { run_id } = await this.api.invoke(startRun, { pipeline_id: id, body: {} });
|
||||
this.run.set({ id: run_id, status: 'STARTING' });
|
||||
while (this.running()) {
|
||||
await new Promise((r) => setTimeout(r, 2000));
|
||||
this.run.set({
|
||||
id: run_id,
|
||||
status: (await this.api.invoke(runStatus, { run_id }))['status'],
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
this.message.set(problem(e));
|
||||
}
|
||||
}
|
||||
|
||||
/** What the node gives: a source's first rows, or what any other node gave in the last run. */
|
||||
protected async show(): Promise<void> {
|
||||
const doc = this.doc();
|
||||
const id = this.pipelineId();
|
||||
if (!doc || !id) return;
|
||||
try {
|
||||
const rows =
|
||||
doc.kind === 'source'
|
||||
? await this.api.invoke(sourcePreview, { limit: 20, body: doc as Source })
|
||||
: await this.api.invoke(nodeRows, { pipeline_id: id, node_id: doc.id, limit: 50 });
|
||||
this.preview.set(rows);
|
||||
this.message.set(rows.length ? '' : 'Sin filas todavía: ejecute la canalización.');
|
||||
} catch (e) {
|
||||
this.message.set(problem(e));
|
||||
}
|
||||
}
|
||||
|
||||
/** The run in Dagster's own UI (its port beside this app's). */
|
||||
protected readonly dagster = computed(() => {
|
||||
const run = this.run();
|
||||
return run ? `${location.protocol}//${location.hostname}:5712/runs/${run.id}` : '';
|
||||
});
|
||||
protected kindLabel(kind: Doc['kind']): string {
|
||||
return KINDS[kind ?? 'source'];
|
||||
}
|
||||
protected cell(value: unknown): string {
|
||||
return typeof value === 'object' && value !== null
|
||||
? JSON.stringify(value)
|
||||
: String(value ?? '');
|
||||
}
|
||||
}
|
||||
|
||||
function text(d: Doc): string {
|
||||
return `${KINDS[d.kind ?? 'source']} · ${d.label || d.id}`;
|
||||
}
|
||||
|
||||
/** Each node's distance from the sources: its column when it has no saved position. */
|
||||
function depths(docs: Doc[]): Map<string, number> {
|
||||
const by = new Map(docs.map((d) => [d.id, d]));
|
||||
const found = new Map<string, number>();
|
||||
const depth = (id: string, seen: Set<string>): number => {
|
||||
if (found.has(id)) return found.get(id)!;
|
||||
if (seen.has(id)) return 0;
|
||||
seen.add(id);
|
||||
const inputs = by.get(id)?.inputs ?? [];
|
||||
const d = inputs.length ? 1 + Math.max(...inputs.map((i) => depth(i, seen))) : 0;
|
||||
found.set(id, d);
|
||||
return d;
|
||||
};
|
||||
docs.forEach((d) => depth(d.id, new Set()));
|
||||
return found;
|
||||
}
|
||||
|
||||
function problem(e: unknown): string {
|
||||
if (e instanceof HttpErrorResponse) {
|
||||
const detail = e.error?.detail;
|
||||
return typeof detail === 'string' ? detail : JSON.stringify(detail ?? e.message);
|
||||
}
|
||||
return String(e);
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
import { nodeSchema } from './schema-form';
|
||||
|
||||
const PIPELINE = {
|
||||
$defs: {
|
||||
Position: { type: 'object', properties: { x: { type: 'number' } } },
|
||||
Condition: { type: 'object', properties: { column: { type: 'string' } } },
|
||||
Route: {
|
||||
type: 'object',
|
||||
additionalProperties: false,
|
||||
required: ['id', 'when'],
|
||||
properties: {
|
||||
id: { type: 'string' },
|
||||
kind: { const: 'route' },
|
||||
inputs: { type: 'array' },
|
||||
position: { anyOf: [{ $ref: '#/$defs/Position' }, { type: 'null' }] },
|
||||
when: { type: 'array', items: { $ref: '#/$defs/Condition' } },
|
||||
resource: { anyOf: [{ type: 'string' }, { type: 'null' }], title: 'Resource' },
|
||||
values: { type: 'object', additionalProperties: { type: 'string' }, title: 'Values' },
|
||||
},
|
||||
},
|
||||
},
|
||||
} as never;
|
||||
|
||||
describe('node forms from the pipeline schema', () => {
|
||||
const schema = nodeSchema(PIPELINE, 'route') as any;
|
||||
|
||||
it('leaves out what the canvas edits', () => {
|
||||
expect(Object.keys(schema.properties)).toEqual(['when', 'resource', 'values']);
|
||||
expect(schema.required).toEqual(['when']);
|
||||
});
|
||||
|
||||
it('inlines references and drops null from optional values', () => {
|
||||
expect(schema.properties.when.items.properties.column.type).toBe('string');
|
||||
expect(schema.properties.resource.type).toBe('string');
|
||||
});
|
||||
|
||||
it('edits maps as JSON', () => {
|
||||
expect(schema.properties.values.widget.formlyConfig.type).toBe('json');
|
||||
});
|
||||
});
|
||||
@@ -1,166 +0,0 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { ReactiveFormsModule } from '@angular/forms';
|
||||
import {
|
||||
ConfigOption,
|
||||
FieldArrayType,
|
||||
FieldType,
|
||||
FormlyField,
|
||||
FormlyFieldConfig,
|
||||
} from '@ngx-formly/core';
|
||||
import type { JSONSchema7 } from 'json-schema';
|
||||
|
||||
type Schema = JSONSchema7 & { $defs?: Record<string, Schema>; prefixItems?: unknown };
|
||||
|
||||
/** The canvas edits these itself; the form leaves them out. */
|
||||
const CANVAS_FIELDS = ['id', 'kind', 'inputs', 'position'];
|
||||
|
||||
/** A node kind's form schema from the pipeline's JSON Schema (pydantic's): `$ref`s inlined,
|
||||
* optional values as their type, and maps or tuples (which forms don't draw) as JSON. */
|
||||
export function nodeSchema(pipeline: Schema, kind: string): Schema {
|
||||
const defs = pipeline.$defs ?? {};
|
||||
const name = Object.keys(defs).find(
|
||||
(k) => (defs[k].properties?.['kind'] as Schema | undefined)?.const === kind,
|
||||
)!;
|
||||
const node = structuredClone(defs[name]);
|
||||
for (const field of CANVAS_FIELDS) delete node.properties?.[field];
|
||||
node.required = (node.required ?? []).filter((f) => !CANVAS_FIELDS.includes(f));
|
||||
delete node.additionalProperties;
|
||||
return simplify(node, defs);
|
||||
}
|
||||
|
||||
function simplify(schema: Schema, defs: Record<string, Schema>): Schema {
|
||||
if (schema.$ref) {
|
||||
const { $ref, ...rest } = schema;
|
||||
return simplify({ ...structuredClone(defs[$ref.split('/').pop()!]), ...rest }, defs);
|
||||
}
|
||||
const options = schema.anyOf as Schema[] | undefined;
|
||||
if (options) {
|
||||
const kept = options.filter((o) => o.type !== 'null');
|
||||
if (kept.length === 1) {
|
||||
const { anyOf, ...rest } = schema;
|
||||
return simplify({ ...kept[0], ...rest }, defs);
|
||||
}
|
||||
}
|
||||
const isMap = schema.type === 'object' && !schema.properties;
|
||||
const isTuple =
|
||||
schema.type === 'array' &&
|
||||
(schema.prefixItems || (schema.items as Schema | undefined)?.prefixItems);
|
||||
if (isMap || isTuple || (!schema.type && !schema.enum && !schema.const)) {
|
||||
return {
|
||||
title: schema.title,
|
||||
description: schema.description,
|
||||
default: schema.default,
|
||||
widget: { formlyConfig: { type: 'json' } },
|
||||
} as Schema;
|
||||
}
|
||||
const out: Schema = { ...schema };
|
||||
if (schema.properties) {
|
||||
out.properties = Object.fromEntries(
|
||||
Object.entries(schema.properties).map(([k, v]) => [k, simplify(v as Schema, defs)]),
|
||||
);
|
||||
}
|
||||
if (schema.items && !Array.isArray(schema.items))
|
||||
out.items = simplify(schema.items as Schema, defs);
|
||||
return out;
|
||||
}
|
||||
|
||||
/** An object's fields, one after another. */
|
||||
@Component({
|
||||
selector: 'app-formly-object',
|
||||
imports: [FormlyField],
|
||||
template: `
|
||||
@if (props.label) {
|
||||
<div class="legend">{{ props.label }}</div>
|
||||
}
|
||||
@if (props.description) {
|
||||
<p class="hint">{{ props.description }}</p>
|
||||
}
|
||||
@for (f of field.fieldGroup; track $index) {
|
||||
<formly-field [field]="f" />
|
||||
}
|
||||
`,
|
||||
styles:
|
||||
'.legend { font-weight: 500; margin: 8px 0 4px; } .hint { color: var(--color-text-secondary); font-size: 12px; margin: 0 0 8px; }',
|
||||
})
|
||||
export class ObjectType extends FieldType {}
|
||||
|
||||
/** A list: each item with a remove button, and an add button. */
|
||||
@Component({
|
||||
selector: 'app-formly-array',
|
||||
imports: [FormlyField, MatButtonModule, MatIconModule],
|
||||
template: `
|
||||
<div class="legend">{{ props.label }}</div>
|
||||
@for (f of field.fieldGroup; track $index; let i = $index) {
|
||||
<div class="item">
|
||||
<formly-field [field]="f" />
|
||||
<button mat-icon-button type="button" (click)="remove(i)" aria-label="Quitar">
|
||||
<mat-icon>close</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
<button mat-stroked-button type="button" (click)="add()">
|
||||
<mat-icon>add</mat-icon> Agregar
|
||||
</button>
|
||||
`,
|
||||
styles:
|
||||
'.legend { font-weight: 500; margin: 8px 0 4px; } .item { display: flex; align-items: flex-start; gap: 4px; } .item formly-field { flex: 1; }',
|
||||
})
|
||||
export class ArrayType extends FieldArrayType {}
|
||||
|
||||
/** A value forms don't draw (a map, a pair, anything), edited as JSON. */
|
||||
@Component({
|
||||
selector: 'app-formly-json',
|
||||
imports: [MatFormFieldModule, MatInputModule, ReactiveFormsModule],
|
||||
template: `
|
||||
<mat-form-field appearance="outline" class="json">
|
||||
<mat-label>{{ props.label }} (JSON)</mat-label>
|
||||
<textarea
|
||||
matInput
|
||||
rows="4"
|
||||
[value]="text()"
|
||||
(change)="parse($any($event.target).value)"
|
||||
></textarea>
|
||||
@if (error) {
|
||||
<mat-error>{{ error }}</mat-error>
|
||||
}
|
||||
@if (props.description) {
|
||||
<mat-hint>{{ props.description }}</mat-hint>
|
||||
}
|
||||
</mat-form-field>
|
||||
`,
|
||||
styles: '.json { width: 100%; } textarea { font-family: monospace; font-size: 12px; }',
|
||||
})
|
||||
export class JsonType extends FieldType<FormlyFieldConfig> {
|
||||
protected error = '';
|
||||
protected text(): string {
|
||||
return this.formControl.value === undefined
|
||||
? ''
|
||||
: JSON.stringify(this.formControl.value, null, 1);
|
||||
}
|
||||
protected parse(value: string): void {
|
||||
try {
|
||||
this.formControl.setValue(value.trim() ? JSON.parse(value) : undefined);
|
||||
this.formControl.markAsDirty();
|
||||
this.error = '';
|
||||
} catch {
|
||||
this.error = 'No es JSON válido';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const FORMLY_TYPES: ConfigOption = {
|
||||
types: [
|
||||
{ name: 'object', component: ObjectType },
|
||||
{ name: 'array', component: ArrayType },
|
||||
{ name: 'json', component: JsonType },
|
||||
{ name: 'enum', extends: 'select' },
|
||||
{ name: 'string', extends: 'input' },
|
||||
{ name: 'number', extends: 'input', defaultOptions: { props: { type: 'number' } } },
|
||||
{ name: 'integer', extends: 'input', defaultOptions: { props: { type: 'number' } } },
|
||||
{ name: 'boolean', extends: 'checkbox' },
|
||||
],
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
export interface SeguimientoQuery { corte?: string; meses: 1 | 3 | 6 | 12; estatus?: string; page: number; page_size: number; }
|
||||
export interface SeguimientoStatus { codigo: string; etiqueta: string; }
|
||||
export interface SeguimientoPaciente {
|
||||
id_seudonimo: string;
|
||||
grupo_edad: string;
|
||||
estatus: SeguimientoStatus;
|
||||
ultima_citologia: { fecha: string; bethesda: string | null; calidad: string | null } | null;
|
||||
ultimo_vph: { fecha: string; resultado: string; genotipo_16_18: boolean | null } | null;
|
||||
dias_toma_diagnostico: number | null;
|
||||
prioridad: SeguimientoStatus | null;
|
||||
}
|
||||
export interface SeguimientoResponse {
|
||||
simulado: boolean;
|
||||
corte: string;
|
||||
ventana: { meses: 1 | 3 | 6 | 12; desde: string; hasta: string };
|
||||
filtros: { estatus: string | null };
|
||||
estatus_disponibles: SeguimientoStatus[];
|
||||
reglas: { clave: string; valor: unknown; estado: 'provisional' | 'confirmado' }[];
|
||||
paginacion: { page: number; page_size: number; total_items: number; total_pages: number };
|
||||
items: SeguimientoPaciente[];
|
||||
}
|
||||
export function isoDate(value: unknown): value is string {
|
||||
if (typeof value !== 'string' || !/^\d{4}-\d{2}-\d{2}$/.test(value) || value.startsWith('0000')) return false;
|
||||
const date = new Date(value + 'T00:00:00Z');
|
||||
return Number.isFinite(date.getTime()) && date.toISOString().slice(0, 10) === value;
|
||||
}
|
||||
export function latestStudy(item: SeguimientoPaciente): string | null {
|
||||
return [item.ultima_citologia?.fecha, item.ultimo_vph?.fecha].filter(isoDate).sort().at(-1) ?? null;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user