From 07212a20834542ff856cb71dda7aae95a70b822b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Trevi=C3=B1o?= Date: Fri, 27 Nov 2026 01:45:16 -0600 Subject: [PATCH] Client for study-field corrections and multi-column extract --- e2e/pages.spec.ts | 2 +- openapi.json | 41 ++++++++++++++++++++++++-------- src/app/api/models/correction.ts | 8 ++++++- src/app/api/models/extract.ts | 2 +- 4 files changed, 40 insertions(+), 13 deletions(-) diff --git a/e2e/pages.spec.ts b/e2e/pages.spec.ts index f4953c6..6e54e0a 100644 --- a/e2e/pages.spec.ts +++ b/e2e/pages.spec.ts @@ -90,7 +90,7 @@ test('conectar: open the hospital pipeline, preview a source, run it to success' expect(problems).toEqual([]); }); -test('revision: what the messy site holds, and a decision through the page', async ({ page }) => { +test('revision: what the hospital source holds, and a decision through the page', async ({ page }) => { const problems = watch(page); await page.goto('/revision'); await page.getByRole('tab', { name: 'Personas' }).click(); diff --git a/openapi.json b/openapi.json index bca8f76..ca0cacd 100644 --- a/openapi.json +++ b/openapi.json @@ -116,16 +116,27 @@ "type": "object" }, "Correction": { + "description": "One field of one record as a reviewer read it in the source document: an identity\nfield (a mistyped record number) or a study's (a stage the scan made unreadable).", "properties": { - "field": { + "entity": { + "default": "identity", "enum": [ - "record_number", - "full_name", - "curp", - "nss", - "birth_date", - "sex" + "identity", + "cervical_cytology", + "cervical_biopsy", + "mammography", + "breast_biopsy", + "breast_treatment", + "clinical_note", + "death", + "mchat", + "ados2", + "eeg" ], + "title": "Entity", + "type": "string" + }, + "field": { "title": "Field", "type": "string" }, @@ -160,8 +171,18 @@ "description": "Platform fields read from text, each kept with the text it was read from.\n\n`auto` asks the LLM when one is configured and answering, else applies `patterns`;\nwith neither, the row is held. Patterns are regexes with one group, per field (the\nLLM can propose them from sample documents); their values go through the ConceptMap\nand `formats` as in `map`.", "properties": { "column": { - "title": "Column", - "type": "string" + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "title": "Column" }, "concept_map": { "anyOf": [ @@ -2442,7 +2463,7 @@ }, "/review/corrections": { "post": { - "description": "A corrected identity field of one record (e.g. a mistyped record number); linking\nuses it on the next run. Fixing the source too is still worth it.", + "description": "A corrected field of one record; the next run uses it (linking for identity fields,\nthe study's target for the others). Fixing the source too is still worth it.", "operationId": "correct", "requestBody": { "content": { diff --git a/src/app/api/models/correction.ts b/src/app/api/models/correction.ts index 4385654..47929df 100644 --- a/src/app/api/models/correction.ts +++ b/src/app/api/models/correction.ts @@ -1,8 +1,14 @@ /* eslint-disable */ /* Code generated by ng-openapi-gen DO NOT EDIT. */ + +/** + * One field of one record as a reviewer read it in the source document: an identity + * field (a mistyped record number) or a study's (a stage the scan made unreadable). + */ export interface Correction { - field: 'record_number' | 'full_name' | 'curp' | 'nss' | 'birth_date' | 'sex'; + entity?: 'identity' | 'cervical_cytology' | 'cervical_biopsy' | 'mammography' | 'breast_biopsy' | 'breast_treatment' | 'clinical_note' | 'death' | 'mchat' | 'ados2' | 'eeg'; + field: string; record: string; value: string; } diff --git a/src/app/api/models/extract.ts b/src/app/api/models/extract.ts index ec257b7..f3253f8 100644 --- a/src/app/api/models/extract.ts +++ b/src/app/api/models/extract.ts @@ -12,7 +12,7 @@ import { Position } from '../models/position'; * and `formats` as in `map`. */ export interface Extract { - column: string; + column: (string | Array); concept_map?: (string | null); entity: 'identity' | 'cervical_cytology' | 'cervical_biopsy' | 'mammography' | 'breast_biopsy' | 'breast_treatment' | 'clinical_note' | 'death' | 'mchat' | 'ados2' | 'eeg'; formats?: {