From 5ce225df5aa0a1d570718b4b346694e45fa41670 Mon Sep 17 00:00:00 2001 From: alberto Date: Sat, 28 Nov 2026 10:30:49 -0600 Subject: [PATCH] Client for the edf pipeline node; the canvas shows a kind it has no form for by its raw name and leaves it out of the palette --- openapi.json | 57 ++++++++++++++++++++++++++++++++++ src/app/api/models.ts | 1 + src/app/api/models/edf.ts | 28 +++++++++++++++++ src/app/api/models/pipeline.ts | 3 +- src/app/conectar/conectar.ts | 13 ++++++-- 5 files changed, 98 insertions(+), 4 deletions(-) create mode 100644 src/app/api/models/edf.ts diff --git a/openapi.json b/openapi.json index a61df2d..b96fc04 100644 --- a/openapi.json +++ b/openapi.json @@ -236,6 +236,59 @@ "title": "Domain", "type": "string" }, + "Edf": { + "additionalProperties": false, + "description": "EDF files (a column of file hashes) to the facts their header holds: patient code, sex,\nbirth date, recording date, record code, duration and channel count, as `edf_*` columns.\nAn unreadable file keeps its row with `edf_error` set.\n\nUse a filesystem source (`dlt.sources.filesystem:filesystem`) with the uploads folder as\n`bucket_url`, `file_glob: \"*.edf\"`, and `then: \"persistance.readers:read_bytes\"`. Read its\n`content` column with this node. Map `edf_patient_code`, `edf_birth_date`, and `edf_sex` to\nidentity's `record_number`, `birth_date`, and `sex`, using the site's formats and ConceptMap.\n\nThe patient code must match the hospital's record number including its prefix. Feed the\nidentity map into the pipeline's link node alongside the hospital identity source. Map\n`edf_study_date` to `study_date` (format `%Y-%m-%d`), `edf_record_code` to `lab_record_id`,\nand `content` to `edf`, then feed that map and the link into a target with entity `eeg`.", + "properties": { + "column": { + "title": "Column", + "type": "string" + }, + "id": { + "maxLength": 40, + "pattern": "^[a-z][a-z0-9_]*$", + "title": "Id", + "type": "string" + }, + "inputs": { + "default": [], + "items": { + "maxLength": 40, + "pattern": "^[a-z][a-z0-9_]*$", + "type": "string" + }, + "title": "Inputs", + "type": "array" + }, + "kind": { + "const": "edf", + "default": "edf", + "title": "Kind", + "type": "string" + }, + "label": { + "default": "", + "title": "Label", + "type": "string" + }, + "position": { + "anyOf": [ + { + "$ref": "#/components/schemas/Position" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "column" + ], + "title": "Edf", + "type": "object" + }, "Execution": { "additionalProperties": false, "description": "What a request or a job config carries: None means the deployment's default.", @@ -986,6 +1039,7 @@ "items": { "discriminator": { "mapping": { + "edf": "#/components/schemas/Edf", "extract": "#/components/schemas/Extract", "fhir": "#/components/schemas/Fhir", "join": "#/components/schemas/Join", @@ -1014,6 +1068,9 @@ { "$ref": "#/components/schemas/Extract" }, + { + "$ref": "#/components/schemas/Edf" + }, { "$ref": "#/components/schemas/Fhir" }, diff --git a/src/app/api/models.ts b/src/app/api/models.ts index d9513dc..cc14430 100644 --- a/src/app/api/models.ts +++ b/src/app/api/models.ts @@ -10,6 +10,7 @@ export type { Cancel } from './models/cancel'; export type { Condition } from './models/condition'; export type { Correction } from './models/correction'; export type { Domain } from './models/domain'; +export type { Edf } from './models/edf'; export type { Execution } from './models/execution'; export type { Extract } from './models/extract'; export type { Fhir } from './models/fhir'; diff --git a/src/app/api/models/edf.ts b/src/app/api/models/edf.ts new file mode 100644 index 0000000..ea3ec5a --- /dev/null +++ b/src/app/api/models/edf.ts @@ -0,0 +1,28 @@ +/* eslint-disable */ +/* Code generated by ng-openapi-gen DO NOT EDIT. */ + +import { Position } from '../models/position'; + +/** + * EDF files (a column of file hashes) to the facts their header holds: patient code, sex, + * birth date, recording date, record code, duration and channel count, as `edf_*` columns. + * An unreadable file keeps its row with `edf_error` set. + * + * Use a filesystem source (`dlt.sources.filesystem:filesystem`) with the uploads folder as + * `bucket_url`, `file_glob: "*.edf"`, and `then: "persistance.readers:read_bytes"`. Read its + * `content` column with this node. Map `edf_patient_code`, `edf_birth_date`, and `edf_sex` to + * identity's `record_number`, `birth_date`, and `sex`, using the site's formats and ConceptMap. + * + * The patient code must match the hospital's record number including its prefix. Feed the + * identity map into the pipeline's link node alongside the hospital identity source. Map + * `edf_study_date` to `study_date` (format `%Y-%m-%d`), `edf_record_code` to `lab_record_id`, + * and `content` to `edf`, then feed that map and the link into a target with entity `eeg`. + */ +export interface Edf { + column: string; + id: string; + inputs?: Array; + kind?: 'edf'; + label?: string; + position?: (Position | null); +} diff --git a/src/app/api/models/pipeline.ts b/src/app/api/models/pipeline.ts index 239cca0..450d812 100644 --- a/src/app/api/models/pipeline.ts +++ b/src/app/api/models/pipeline.ts @@ -1,6 +1,7 @@ /* eslint-disable */ /* Code generated by ng-openapi-gen DO NOT EDIT. */ +import { Edf } from '../models/edf'; import { Extract } from '../models/extract'; import { Fhir } from '../models/fhir'; import { Join } from '../models/join'; @@ -11,5 +12,5 @@ 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 | Fhir | Join | Link | Target)>; + nodes: Array<(Source | Read | Route | Map | Extract | Edf | Fhir | Join | Link | Target)>; } diff --git a/src/app/conectar/conectar.ts b/src/app/conectar/conectar.ts index 912e5ed..ed57dbf 100644 --- a/src/app/conectar/conectar.ts +++ b/src/app/conectar/conectar.ts @@ -47,7 +47,9 @@ function canvasNode(id: string, point: { x: number; y: number }, label: string): }; } -export const KINDS: Record = { +/** The kinds the palette offers. A kind the canvas has no form for yet (`edf`, Phase 5) is left + * out of the palette and shown by its raw name when a saved pipeline has one. */ +export const KINDS: Partial> = { source: 'Fuente', read: 'Leer', route: 'Filtrar', @@ -312,7 +314,7 @@ export class Conectar { return 'concept_map' in d ? (d.concept_map ?? undefined) : undefined; } protected kindLabel(kind: Doc['kind']): string { - return KINDS[kind ?? 'source']; + return kindName(kind); } protected cell(value: unknown): string { return typeof value === 'object' && value !== null @@ -322,7 +324,12 @@ export class Conectar { } function text(d: Doc): string { - return `${KINDS[d.kind ?? 'source']} · ${d.label || d.id}`; + return `${kindName(d.kind)} · ${d.label || d.id}`; +} + +function kindName(kind: Doc['kind']): string { + const k = kind ?? 'source'; + return KINDS[k] ?? k; } /** Each node's distance from the sources: its column when it has no saved position. */