Kit exit: retire indicadores_kit, converge TEA/CaMa work onto dev #11

Merged
roberto merged 33 commits from feature/kit-exit-integration into dev 2026-11-16 21:09:40 -06:00
Owner

Deliverable-tree counterpart of ISSSTELEON/WorkingNarrative#179. Converges the team's branches onto one working branch, with the kit retired: the rebased source-terminology work (dbt semantic layer as FHIR MeasureReports, TEA staging by study, cat_sistema_fuente/cat_mapeo catalog tables), the TEA redesign deltas (TEA order PDF column, Alembic merge revision b9e4d2c71a05, dbt manifest baked into the WebApi image), the indicadores_kit submodule removed, and a compose profile entrenar that trains and promotes the CaCu model.

Deferred: feature/cacu-pim-vigilancia (second CaCu model as a Hamilton dataflow) and three kit CaMa measures; see docs/ledgers/open-items.md in WorkingNarrative.

Opened per the owner's request; merging into dev is left to a person in the Gitea UI.

🤖 Generated with Claude Code

Deliverable-tree counterpart of ISSSTELEON/WorkingNarrative#179. Converges the team's branches onto one working branch, with the kit retired: the rebased source-terminology work (dbt semantic layer as FHIR MeasureReports, TEA staging by study, cat_sistema_fuente/cat_mapeo catalog tables), the TEA redesign deltas (TEA order PDF column, Alembic merge revision b9e4d2c71a05, dbt manifest baked into the WebApi image), the indicadores_kit submodule removed, and a compose profile entrenar that trains and promotes the CaCu model. Deferred: feature/cacu-pim-vigilancia (second CaCu model as a Hamilton dataflow) and three kit CaMa measures; see docs/ledgers/open-items.md in WorkingNarrative. Opened per the owner's request; merging into dev is left to a person in the Gitea UI. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
roberto added 33 commits 2026-11-16 01:20:21 -06:00
How: `cama.toml` declares density and lesion size (mammography), histological type, Nottingham grade, estrogen
and progesterone receptors with their percentages, HER2 and Ki-67 (pathology), and the clinical stage (note),
each with `etiquetas_fuente`, value aliases and `provisional = true`. `cama_linea_de_tiempo.yml` gives each one a
timeline line. The catalog's README documents the keys. Bumps WebApi to the load that reads them.

Implications: the analysis' stratifiers (molecular classification, stage, early or advanced, size) can be derived
in dbt from these lines. A new caption or spelling from the laboratory is one line in the catalog, applied on the
next load. BRCA, recurrence and vital status still have no source.
How: `cama_estratificadores` turns the timeline's lines read from reports into timeline facts: the clinical stage's
group, early or advanced stage, the surrogate molecular subtype from one pathology report, and T by the lesion's
size, by the rules in `vars.cama.estratos`. `cama_cancer_invasor` has one row per biopsy report with an invasive
cancer (`vars.cama.grados_invasor`) and the BI-RADS of the mammogram that led to it. CAMA_BIRADS_CANCER_INVASOR
counts those patients by BI-RADS, stratified by age group, stage, early or advanced, subtype and size. Bumps WebApi
to the stratum read by the event cut-off.

Implications: the analysis' stratifiers exist as data and reach FHIR as stratifiers. Their rules (stage groups,
Ki-67 and progesterone thresholds, T bounds) are provisional placeholders in dbt's vars. BRCA has no source yet.
How: `CatSistemaFuenteBase` (who sends the data, its staging table and validity) and `CatMapeoBase` (a study
code, caption or spelling of a source, mapped to `estudio_id`, `resultado_id` or a `cat_valor`, with its
validity, author and reason), with their constraints in `reglas_de_mapeo` and `vigencia_ordenada`: a known
class and the target it needs, the value's foreign key to `cat_valor`, and one row per form and start date.

Implications: the codes stay in the TOML; how a provider writes them becomes data, edited without a deploy.
Overlapping validities aren't a portable constraint and are checked by the writer and by dbt.
How: cacu f89e1f081998, cama f82b64f43abd and tea 6d772e9a342f, on each chain's head; plain types, check
constraints, foreign keys and a unique key that every engine accepts. Verified upgrade, `alembic check`,
downgrade and upgrade again on SQLite.

Implications: both tables start empty; the catalog step seeds the TOML's own mappings.
How: `SourceMappingRepository` (`source_mapping_repository` in cacu, cama and tea) lists systems and mappings,
adds a missing system, seeds only the forms with no row yet, adds one mapping after running the caller's check
against the stored rows of the same form in the same session, and closes a row's validity once.

Implications: a deploy never changes a stored mapping; the rule that the mapping is a function stays with the
caller, which runs it on every write.
How: `cat_sistema_fuente` and `cat_mapeo` are silver sources in every domain; the generic test
`vigencias_sin_traslape` self-joins the rows of the same form (compared null-safe) and fails on each pair
with a different target and overlapping validity, in portable SQL (`date_literal` for the open end). Its
arguments stay at the test's top level, which dbt-core 1.7 (the MySQL group) reads.

Implications: a mapping written past the application's check (by hand, by a script, by a restore) shows up
in `dbt test`. Checked on the three domains' seeded databases (pass) and with a planted clash (1 failure).
How: WebApi at 73cbf0c (catalog matching and commit on the WebApi's own modules, source_mapping, seeding and validated writes); indicadores_kit at f79e8d2.

Implications: on this branch the five repositories sit on dev's latest; WebApi 510 tests pass, models 179, Persistance 51, Core 19, failing only where tesseract or pymssql aren't installed.
# Conflicts:
#	Core/core/tea/models.py
#	Core/spec/tablas_TEA.md
#	Persistance/persistance/cacu/__init__.py
#	Persistance/persistance/cama/__init__.py
#	Persistance/persistance/edges/silver/__init__.py
#	Persistance/persistance/tea/__init__.py
#	README.md
#	Transformation/.gitignore
#	Transformation/dbt_project.yml
#	WebApi
#	WebApp
#	indicadores_kit
#	models
roberto merged commit 9baeeb7ff0 into dev 2026-11-16 21:09:40 -06:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ISSSTELEON/ISSSTELEON#11