Compare commits

...

4 Commits

Author SHA1 Message Date
Roberto Treviño Cervantes 234c45c10a ISSSTELEON pointer: fold repeated catalog-matching captions 2026-11-11 09:16:05 -06:00
Roberto Treviño Cervantes a3b848ef6f Submodule pointer: ISSSTELEON at its merged staging 2026-11-11 07:40:53 -06:00
Roberto Treviño Cervantes f84f497cf9 import files in columns 2026-11-11 07:40:37 -06:00
Roberto Treviño Cervantes 8e30ac5aea Merge dev into staging 2026-11-11 07:40:37 -06:00
2 changed files with 19 additions and 2 deletions
+18 -1
View File
@@ -20,11 +20,28 @@ Package `Extraction/extraction/`:
terms in `nlp/vocabulary.py` (extend there, no code changes).
- `records.py` — `DocumentExtractor` and `RecordMerger` (same patient across
pages/files, most confident value wins, confident disagreements become
`FieldConflict`).
`FieldConflict`). `ExtractedRecord.discovered` also carries every caption
no known `FieldSpec` claimed (`nlp/discovery.py::discover_captions`).
- `readers/text.py` — `TextReader`, the fallback in `FALLBACK_READERS`:
content that's neither a PDF nor an image, read as plain text (one page,
one line per newline) as long as it decodes as one, instead of being
rejected as an unsupported format.
- WebApi side: `connectors/document.py` + `schemas/field_specs.py` (field
specs derived from the target schema). Each row carries `documento` (the
record's pages as one PDF), mappable to a file column. Corrections from
the UI travel as `overrides`. Results cached per worker for repeated calls.
A `document` source's `payload` may carry `sql` (a connection, `table` or
`query`, `column`, `key_column`) instead of `files`: one document per
row, the named column read as its bytes (a `varbinary(max)` PDF) or, via
`TextReader`, as plain text — the same connector and extraction either way.
- `schemas/catalog_matching.py` + `services/catalog_commit_service.py`:
a discovered caption is fuzzy-matched (`rapidfuzz`) against the project's
catalog (`core/catalogos/<proyecto>.toml`); a close enough etiqueta reuses
that `resultado_id`, otherwise one is minted
(`indicadores_kit.registry.catalogos.add_resultado`) and synced. Written
straight into `procedimiento`/`observacion` (no staging row for these),
tagged with the sentinel `fuente_tabla` `catalogo_abierto` so it reads
apart from every staging-derived row.
- WebApp: `DocumentReviewDialog` (records, value, confidence, method,
source line and page, conflicts, image thumbnails, editable values).
- Limits: NLP is rule-based (no trained model); images are located and