Compare commits

...

3 Commits

Author SHA1 Message Date
Roberto Treviño 053679c817 Connecting a database no longer freezes the page: the columns field keeps one empty list 2026-11-30 05:17:14 -06:00
Roberto Treviño ffa732df12 The page test follows the pages as they are 2026-11-30 02:14:16 -06:00
Roberto Treviño 786b199203 The generated API client matches the API 2026-11-29 21:15:12 -06:00
5 changed files with 199 additions and 16 deletions
+4 -5
View File
@@ -59,10 +59,10 @@ test("indicators: the KPIs are the API's MeasureReports, every tab and the patie
await expect(page.locator('app-tab-indicadores app-plot').first()).toBeVisible(); await expect(page.locator('app-tab-indicadores app-plot').first()).toBeVisible();
await page.getByRole('tab', { name: 'Trazabilidad' }).click(); await page.getByRole('tab', { name: 'Trazabilidad' }).click();
await expect(page.locator('app-tab-trazabilidad mat-card')).toHaveCount(14); await expect(page.locator('app-tab-trazabilidad section.panel')).toHaveCount(9);
await page.getByRole('tab', { name: 'Datos y definiciones' }).click(); await page.getByRole('tab', { name: 'Datos y definiciones' }).click();
await expect(page.locator('app-tab-definiciones tbody tr')).toHaveCount(14); await expect(page.locator('app-tab-definiciones details')).toHaveCount(14);
const list = page.waitForResponse((r) => r.url().includes('/fhir/Patient?')); const list = page.waitForResponse((r) => r.url().includes('/fhir/Patient?'));
await page.getByRole('tab', { name: 'Análisis de riesgos' }).click(); await page.getByRole('tab', { name: 'Análisis de riesgos' }).click();
@@ -73,7 +73,7 @@ test("indicators: the KPIs are the API's MeasureReports, every tab and the patie
await expect(rows).toHaveCount(Math.min(20, bundle.total)); await expect(rows).toHaveCount(Math.min(20, bundle.total));
await expect(rows.first().locator('a').first()).toHaveText(first); await expect(rows.first().locator('a').first()).toHaveText(first);
await page.getByRole('button', { name: 'Siguiente' }).click(); await page.getByRole('button', { name: 'Siguiente' }).click();
await expect(page.getByText(`21–`)).toBeVisible(); await expect(page.getByText('Página 2 de')).toBeVisible();
await page.getByRole('button', { name: 'Anterior' }).click(); await page.getByRole('button', { name: 'Anterior' }).click();
await rows.first().locator('a').first().click(); await rows.first().locator('a').first().click();
@@ -103,13 +103,12 @@ test('conectar: open the hospital pipeline, preview a source, run it to success'
await page.getByText('cacu', { exact: true }).click(); await page.getByText('cacu', { exact: true }).click();
await expect(page.locator('vflow')).toBeVisible(); await expect(page.locator('vflow')).toBeVisible();
// a node's caption: its kind, then its name // a node's caption: its kind, then its name
await page.locator('.node-caption', { hasText: 'Pacientes' }).click(); await page.locator('.node-caption', { hasText: 'Fuente de datosPacientes' }).click();
// drawn from a fixture, read back as a guided SQLite source: the dialog edits it // drawn from a fixture, read back as a guided SQLite source: the dialog edits it
await expect(page.getByRole('button', { name: 'Editar conexión' })).toBeVisible(); await expect(page.getByRole('button', { name: 'Editar conexión' })).toBeVisible();
await page.getByRole('button', { name: 'Vista previa' }).click(); await page.getByRole('button', { name: 'Vista previa' }).click();
await expect(page.locator('.preview tr[mat-row]').first()).toBeVisible(); await expect(page.locator('.preview tr[mat-row]').first()).toBeVisible();
// A map node shows the site's codes in platform terms (its ConceptMap), editable as rows. // A map node shows the site's codes in platform terms (its ConceptMap), editable as rows.
await page;
await page await page
.locator('.node-caption', { hasText: 'Traducir códigos' }) .locator('.node-caption', { hasText: 'Traducir códigos' })
.filter({ has: page.locator('.name', { hasText: /^Citología$/ }) }) .filter({ has: page.locator('.name', { hasText: /^Citología$/ }) })
+189 -7
View File
@@ -422,6 +422,7 @@
}, },
"default": {}, "default": {},
"description": "Dato \u2192 columna, sin leer el texto.", "description": "Dato \u2192 columna, sin leer el texto.",
"keys": "field",
"title": "Datos tomados de columnas", "title": "Datos tomados de columnas",
"type": "object" "type": "object"
}, },
@@ -455,13 +456,70 @@
"eeg" "eeg"
], ],
"title": "Estudio", "title": "Estudio",
"type": "string" "type": "string",
"widget": {
"formlyConfig": {
"props": {
"options": [
{
"label": "Identidad de la persona",
"value": "identity"
},
{
"label": "Citolog\u00eda cervical",
"value": "cervical_cytology"
},
{
"label": "Biopsia cervical",
"value": "cervical_biopsy"
},
{
"label": "Mastograf\u00eda",
"value": "mammography"
},
{
"label": "Biopsia de mama",
"value": "breast_biopsy"
},
{
"label": "Tratamiento de c\u00e1ncer de mama",
"value": "breast_treatment"
},
{
"label": "Recurrencia de c\u00e1ncer de mama",
"value": "breast_recurrence"
},
{
"label": "Nota m\u00e9dica",
"value": "clinical_note"
},
{
"label": "Defunci\u00f3n",
"value": "death"
},
{
"label": "M-CHAT-R/F",
"value": "mchat"
},
{
"label": "ADOS-2",
"value": "ados2"
},
{
"label": "Electroencefalograma",
"value": "eeg"
}
]
}
}
}
}, },
"formats": { "formats": {
"additionalProperties": { "additionalProperties": {
"type": "string" "type": "string"
}, },
"default": {}, "default": {},
"keys": "field",
"title": "Formatos de fecha", "title": "Formatos de fecha",
"type": "object" "type": "object"
}, },
@@ -535,6 +593,7 @@
}, },
"default": {}, "default": {},
"description": "Dato \u2192 expresi\u00f3n con un grupo ( ).", "description": "Dato \u2192 expresi\u00f3n con un grupo ( ).",
"keys": "field",
"title": "Patrones", "title": "Patrones",
"type": "object" "type": "object"
}, },
@@ -595,7 +654,63 @@
"eeg" "eeg"
], ],
"title": "Estudio", "title": "Estudio",
"type": "string" "type": "string",
"widget": {
"formlyConfig": {
"props": {
"options": [
{
"label": "Identidad de la persona",
"value": "identity"
},
{
"label": "Citolog\u00eda cervical",
"value": "cervical_cytology"
},
{
"label": "Biopsia cervical",
"value": "cervical_biopsy"
},
{
"label": "Mastograf\u00eda",
"value": "mammography"
},
{
"label": "Biopsia de mama",
"value": "breast_biopsy"
},
{
"label": "Tratamiento de c\u00e1ncer de mama",
"value": "breast_treatment"
},
{
"label": "Recurrencia de c\u00e1ncer de mama",
"value": "breast_recurrence"
},
{
"label": "Nota m\u00e9dica",
"value": "clinical_note"
},
{
"label": "Defunci\u00f3n",
"value": "death"
},
{
"label": "M-CHAT-R/F",
"value": "mchat"
},
{
"label": "ADOS-2",
"value": "ados2"
},
{
"label": "Electroencefalograma",
"value": "eeg"
}
]
}
}
}
}, },
"id": { "id": {
"maxLength": 40, "maxLength": 40,
@@ -705,7 +820,8 @@
"url", "url",
"oauth", "oauth",
"table", "table",
"format" "format",
"columns"
], ],
"title": "Type", "title": "Type",
"type": "string" "type": "string"
@@ -828,7 +944,7 @@
"type": "string" "type": "string"
}, },
"on": { "on": {
"description": "Pares [columna izquierda, derecha].", "description": "Columna de la primera entrada = columna de la segunda.",
"items": { "items": {
"maxItems": 2, "maxItems": 2,
"minItems": 2, "minItems": 2,
@@ -1003,6 +1119,7 @@
"type": "string" "type": "string"
}, },
"description": "Dato de la plataforma \u2192 columna del sitio.", "description": "Dato de la plataforma \u2192 columna del sitio.",
"keys": "field",
"title": "Campos", "title": "Campos",
"type": "object" "type": "object"
}, },
@@ -1012,6 +1129,7 @@
}, },
"default": {}, "default": {},
"description": "Por ejemplo %d/%m/%Y.", "description": "Por ejemplo %d/%m/%Y.",
"keys": "field",
"title": "Formatos de fecha", "title": "Formatos de fecha",
"type": "object" "type": "object"
}, },
@@ -1059,6 +1177,7 @@
}, },
"default": {}, "default": {},
"description": "Un dato igual para todas las filas.", "description": "Un dato igual para todas las filas.",
"keys": "field",
"title": "Valores fijos", "title": "Valores fijos",
"type": "object" "type": "object"
} }
@@ -1710,12 +1829,14 @@
"properties": { "properties": {
"args": { "args": {
"additionalProperties": true, "additionalProperties": true,
"advanced": true,
"default": {}, "default": {},
"description": "Los de la fuente dlt.", "description": "Los de la fuente dlt.",
"title": "Argumentos (JSON)", "title": "Argumentos",
"type": "object" "type": "object"
}, },
"guided": { "guided": {
"advanced": true,
"anyOf": [ "anyOf": [
{ {
"$ref": "#/components/schemas/Guided" "$ref": "#/components/schemas/Guided"
@@ -1723,7 +1844,8 @@
{ {
"type": "null" "type": "null"
} }
] ],
"title": "Asistente"
}, },
"id": { "id": {
"maxLength": 40, "maxLength": 40,
@@ -1764,6 +1886,7 @@
] ]
}, },
"primary_key": { "primary_key": {
"advanced": true,
"default": [], "default": [],
"description": "Columnas que identifican una fila.", "description": "Columnas que identifican una fila.",
"items": { "items": {
@@ -1773,6 +1896,7 @@
"type": "array" "type": "array"
}, },
"resource": { "resource": {
"advanced": true,
"anyOf": [ "anyOf": [
{ {
"type": "string" "type": "string"
@@ -1785,12 +1909,14 @@
"title": "Recurso" "title": "Recurso"
}, },
"source": { "source": {
"advanced": true,
"description": "M\u00f3dulo:funci\u00f3n de la fuente dlt.", "description": "M\u00f3dulo:funci\u00f3n de la fuente dlt.",
"pattern": "^[A-Za-z_][\\w.]*:[A-Za-z_]\\w*$", "pattern": "^[A-Za-z_][\\w.]*:[A-Za-z_]\\w*$",
"title": "Fuente dlt", "title": "Fuente dlt",
"type": "string" "type": "string"
}, },
"then": { "then": {
"advanced": true,
"anyOf": [ "anyOf": [
{ {
"pattern": "^[A-Za-z_][\\w.]*:[A-Za-z_]\\w*$", "pattern": "^[A-Za-z_][\\w.]*:[A-Za-z_]\\w*$",
@@ -2004,7 +2130,63 @@
"eeg" "eeg"
], ],
"title": "Estudio", "title": "Estudio",
"type": "string" "type": "string",
"widget": {
"formlyConfig": {
"props": {
"options": [
{
"label": "Identidad de la persona",
"value": "identity"
},
{
"label": "Citolog\u00eda cervical",
"value": "cervical_cytology"
},
{
"label": "Biopsia cervical",
"value": "cervical_biopsy"
},
{
"label": "Mastograf\u00eda",
"value": "mammography"
},
{
"label": "Biopsia de mama",
"value": "breast_biopsy"
},
{
"label": "Tratamiento de c\u00e1ncer de mama",
"value": "breast_treatment"
},
{
"label": "Recurrencia de c\u00e1ncer de mama",
"value": "breast_recurrence"
},
{
"label": "Nota m\u00e9dica",
"value": "clinical_note"
},
{
"label": "Defunci\u00f3n",
"value": "death"
},
{
"label": "M-CHAT-R/F",
"value": "mchat"
},
{
"label": "ADOS-2",
"value": "ados2"
},
{
"label": "Electroencefalograma",
"value": "eeg"
}
]
}
}
}
}, },
"id": { "id": {
"maxLength": 40, "maxLength": 40,
+1 -1
View File
@@ -11,5 +11,5 @@ export interface FieldSpec {
placeholder?: string; placeholder?: string;
provider?: (string | null); provider?: (string | null);
required?: boolean; required?: boolean;
type?: 'text' | 'number' | 'password' | 'select' | 'folder' | 'server_file' | 'upload' | 'url' | 'oauth' | 'table' | 'format'; type?: 'text' | 'number' | 'password' | 'select' | 'folder' | 'server_file' | 'upload' | 'url' | 'oauth' | 'table' | 'format' | 'columns';
} }
+1 -1
View File
@@ -18,7 +18,7 @@ export interface Join {
label?: string; label?: string;
/** /**
* Pares [columna izquierda, derecha]. * Columna de la primera entrada = columna de la segunda.
*/ */
on: Array<[string, string]>; on: Array<[string, string]>;
position?: (Position | null); position?: (Position | null);
+4 -2
View File
@@ -33,6 +33,8 @@ export interface SourceDialogData {
guided?: Guided | null; guided?: Guided | null;
label?: string; label?: string;
} }
const NONE: string[] = [];
/** What it gives back: the dialog's answers (the node's dlt fields are made from them). */ /** What it gives back: the dialog's answers (the node's dlt fields are made from them). */
export interface SourceDialogResult { export interface SourceDialogResult {
guided: Guided; guided: Guided;
@@ -203,17 +205,17 @@ export class SourceDialog {
} }
} }
/** The tables a database listed, for its table field. */
/** A list answer (the columns picked), as a list. */ /** A list answer (the columns picked), as a list. */
protected listed(name: string): string[] { protected listed(name: string): string[] {
const v = this.value(name); const v = this.value(name);
return Array.isArray(v) ? (v as string[]) : []; return Array.isArray(v) ? (v as string[]) : NONE; // a new list each time renders forever
} }
/** The columns to pick from: the first rows', and those already picked. */ /** The columns to pick from: the first rows', and those already picked. */
protected columnOptions(name: string): string[] { protected columnOptions(name: string): string[] {
return [...new Set([...this.columns(), ...this.listed(name)])]; return [...new Set([...this.columns(), ...this.listed(name)])];
} }
/** The tables a database listed, for its table field. */
protected tables(): string[] { protected tables(): string[] {
return this.tableList(); return this.tableList();
} }