98 Commits

Author SHA1 Message Date
ulises 6452e43cad Governance TEA EEG: preview of one EDF and its ADOS-2 report analysed in memory, nothing stored 2026-11-23 12:26:19 -06:00
ulises 0e6494f053 Governance TEA EEG: reference cohorts, baselines export and import, cluster health, training and analysis jobs with progress, EDF upload, EEG queries 2026-11-23 09:31:38 -06:00
Roberto Treviño Cervantes 5831fcd9d9 Cycle: skip the scenarios whose definition turns off batch_estimates 2026-11-23 00:14:14 -06:00
Roberto Treviño Cervantes bd8c7aa55a Cycle: answer each measure's latest periods after a run, so the first reader finds them stored 2026-11-23 00:06:33 -06:00
Roberto Treviño Cervantes 1048175531 CaMa survival figure: the whole cohort's points from the pipeline's survival stage 2026-11-22 23:46:57 -06:00
Roberto Treviño Cervantes 5738a9c302 Merge dev into the CaMa consolidation branch 2026-11-22 23:28:00 -06:00
edgar bf93a5fff9 Merge pull request 'CaCu follow-up: CASO status with CIS, per-status probabilities, and a cycle that estimates with every production scenario' (#19) from integration/cacu-197-conciliacion into dev
Reviewed-on: http://10.0.10.41:3000/ISSSTELEON/WebApi/pulls/19
2026-11-22 23:25:34 -06:00
Roberto Treviño Cervantes 32483249c7 Indicators cycle recomputes the CaMa survival scenario points over each new build; the figure draws them 2026-11-22 23:22:31 -06:00
Roberto Treviño Cervantes 93649a0e27 CaMa survival figure takes the points the version's pipeline published for the scenario 2026-11-22 22:59:48 -06:00
Roberto Treviño Cervantes 201ef4fb03 CaMa follow-up list: the cohort of a revision is read from the views once 2026-11-22 22:20:12 -06:00
Roberto Treviño Cervantes f97d1202a9 Live models: the labelled members are saved once per build and version, prepared by the indicators cycle and loaded by each API worker as it starts 2026-11-22 22:02:04 -06:00
ulises eb88cb7eb0 ADOS-2 scoring step in the indicators cycle, run after the document import commits; EEG analysis ordered before the relation steps 2026-11-22 22:01:50 -06:00
ulises 430d165594 Document sources carry any field of the target from their own columns, such as its ids; the ADOS-2 items of a SQL source's PDF upsert into the existing row 2026-11-22 21:47:16 -06:00
ulises 74303aa1b9 TEA: the cycle's relate_ados2 step between the EEG analysis and the load, and the ADOS-2 relation in FHIR 2026-11-22 21:47:16 -06:00
Roberto Treviño Cervantes f7f8af8b4c CaMa: the follow-up row carries a provisional status, priority and mammogram-to-diagnosis days; the survival menu names the patient's own scenarios 2026-11-22 21:38:43 -06:00
edgar 2fe4101982 Cycle: estimate with every scenario in production, one batch per model
The scenarios come from the registry instead of a fixed list, and a cohort can carry several estimators.
2026-11-22 20:34:38 -06:00
Roberto Treviño Cervantes 88c9694a46 CaMa: the patient import takes the recurrence variables again, recurrence trains on the cohort export, the second survival route is retired 2026-11-22 19:51:20 -06:00
edgar e0967d0175 Follow-up status: a case is a carcinoma, invasive or in situ 2026-11-22 19:16:44 -06:00
edgar 377882edd0 Follow-up list: a case's survival is 1 at 0 years, at the index date 2026-11-22 18:40:53 -06:00
Roberto Treviño Cervantes 1fbeabb872 CaMa recurrence: every scenario the patient's covariates place her in 2026-11-22 18:04:57 -06:00
edgar c51402510a Follow-up list: each patient's latest biopsy and probabilities, ordered by one of them
Each row carries the patient's latest biopsy reported by the cut-off and her current probability of LIEAG+, of cancer
and, for a case, of surviving (the complement of the survival model's death, interval swapped) at every horizon, from
the confirmed batches her record shows. `orden` sorts the whole list, not a page, by the most recent study or by one
of those probabilities at `horizonte`; `horizontes_disponibles` names the horizons the models give.
2026-11-22 15:03:49 -06:00
edgar 7640486852 Follow-up status: CASO, a patient with a cancer biopsy
A biopsy reported with a grade of `cacu.seguimiento.caso.grados` (CARCINOMA, provisional) by the reference makes the
patient a case: the status wins over every other, and what is followed for her is survival. Only the follow-up list
reads this rule; the measures' stratum in dbt is unchanged.
2026-11-22 15:03:31 -06:00
edgar 4a61bd8d33 CaCu import: a patient's date of death
`pac_fecha_defuncion` was dropped on import, so `persona.fecha_defuncion` and the timeline's `defuncion` fact were
always empty in CaCu and the survival scenario trained with no deaths. CaMa's schema already carried it.
2026-11-22 15:03:22 -06:00
edgar e2732f5e8a Risk batches: a decision that collides with another of the same batch is a 409
Two decisions of one batch at the same moment (a double click reaching both workers) wrote the same evaluation
version and the second surfaced as a server error.
2026-11-22 09:34:49 -06:00
edgar b9795c02ca FHIR: CaCu's risk names the results of its index cytology
The cytology sampled on the risk's index date gives its squamous, glandular and HPV results in the extension
`resultados-indice`, which the record words its sentence with. CaCu's outcome codes `cin2` and `cancer` get labels.
2026-11-22 09:34:49 -06:00
edgar b63a253b19 FHIR: one RiskAssessment per outcome, and one with no prediction for a model that didn't score her
The patient's Bundle holds the current batch of each outcome (`CohortRepository.current_risks`), so a CIN2+ and a
cancer model are both shown. For a patient with some risk, each current model of another outcome that didn't score
her (`current_batches`) gives a RiskAssessment with no prediction and the extension `sin-estimacion` (its outcome and
why it may be so), so the record can tell "no model" from "not estimated for her".
2026-11-22 09:34:49 -06:00
Roberto Treviño Cervantes cc54c1dc86 Merge the CaMa recurrence follow-up imports and /cama/recurrencia into dev 2026-11-22 09:18:27 -06:00
ulises 9a62ddcdaf CaMa recurrence: import schemas for the follow-up and the new patient variables, silver mappings and /cama/recurrencia
The patient takes the menopausal state, molecular and clinical subtype, integrative cluster, cellularity, mutation load,
Ki-67 category and source of the record; a new import entity carries the recurrence and the last contact; hormone and
anti-HER2 therapy are treatments. The route serves each cohort's scenarios, a scenario's figure and a patient's scenarios
over the live cohort build, computing the models and the bootstrap in the background and caching them per build. Includes
the survival import work this builds on.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 08:46:42 -06:00
edgar f002e24811 FHIR: the patient's RiskAssessment says what the model's number is
The registered model's scenario (`[estimand]` of its `model.toml`) goes in the extension `estimando`, one
`valueString` per key, and its quantity as `method.text`. A model whose scenario can't be read has neither.
2026-11-22 07:47:05 -06:00
edgar a04ceb6301 Cycle: score with the models package's scored_frame, so a model's risk intervals reach the batch
The cycle read the run's horizons and called the model itself; `models.dags.estimation.scored_frame` does both, and
also reads whether the run gives each risk's interval.
2026-11-22 07:47:05 -06:00
edgar 1d52da79e4 FHIR: every URL the API emits hangs from one base, set by FHIR_BASE_URL
The code systems, value sets and the extensions (cut-offs, report id, interval, quartiles) each wrote the domain by
hand. They now derive from webapi.fhir_base, a leaf module so metrics and durations can use it without a cycle. The
default is unchanged; the WebApp still reads the same URLs by exact match, so changing the domain goes to both.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 02:54:23 -06:00
edgar 0a8e3577a1 feat(fhir): publish the Wilson interval of a proportion's score
A proportion's measureScore now carries its 95 % Wilson interval in the ic-bajo and ic-alto extensions,
as proportions, the way durations carry their quartiles. Nothing is published without a denominator.
2026-11-22 00:23:09 -06:00
edgar e44f0c84b3 Governance: run the notebooks kept in the code; plotly in the lock for the survival reports
GET /governance/notebook-templates?domain= lists the notebooks under models/<domain>/<scenario>/notebooks/ with the
scenarios each can run for (models.reports.templates: its folder's and any whose model.toml lists a module of it, so
CaCu's PIM subgroup report serves cin2_pim and its post-colposcopy and post-treatment scenarios). POST
/governance/experiments takes `template` (that id) instead of `file`: the notebook is read from the code, never from
the request, and runs like an upload (its page sandboxed, its hash on the run). A template for a scenario it doesn't
serve, an id outside the templates, or a file and a template together are refused.

uv.lock adds plotly 7.1.0: models' `survival-curves` extra now draws the CaCu subgroup reports (models:
cacu-survival/integration).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HmQxVJVNR5FYkPAregGEQ7
2026-11-22 00:23:04 -06:00
rockdrigo 4cc2ce83ac CaMa: scenario menus and risk-factor rows for the survival and recurrence analyses 2026-11-21 14:43:46 -06:00
rockdrigo d185aba364 Merge remote-tracking branch 'origin/dev' into dev-mvp 2026-11-21 13:53:57 -06:00
rockdrigo 2c4bfa5691 Recurrence figures for a patient; governance trains scenarios with external data; lifelines in the lock 2026-11-21 13:34:56 -06:00
rockdrigo a53179aa2e Live survival: the scenarios of a patient and the figure of one scenario 2026-11-21 13:14:06 -06:00
rockdrigo 3b192207fd Live survival: no options route 2026-11-21 13:03:19 -06:00
Angel Capetillo Zavala 26631bd564 Merge feature/tea-eeg-analysis into dev (TEA age norm and ADOS-2 relation) 2026-11-21 12:23:28 -06:00
rockdrigo 57947d4131 Live survival: score with the rehydrated production model 2026-11-21 12:15:22 -06:00
rockdrigo eeb4c1fbd5 CaMa survival: live options and selection routes over the production model 2026-11-21 12:07:21 -06:00
alberto 31ab347347 feat(tea): import the ADOS-2 association model and serve it as a RiskAssessment in the patient summary 2026-11-21 11:17:58 -06:00
alberto 46473bb106 feat(tea): each EEG metric's age-norm curve and the age at the EEG in the patient summary 2026-11-21 11:17:48 -06:00
rockdrigo 8b379db28b Governance trains TEA's EEG on a local reference folder when one is configured 2026-11-21 04:48:43 -06:00
rockdrigo dab78ad55e Merge remote-tracking branch 'origin/dev' into dev-mvp 2026-11-21 04:00:00 -06:00
rockdrigo 2d71fe1103 Lesion size extracted from pathology reports; development record route; scenario catalog and background training jobs in governance 2026-11-21 03:28:13 -06:00
rockdrigo 6b011df0fd Merge the CaMa survival cohort support 2026-11-21 02:07:54 -06:00
rockdrigo e2ecaa027c CaMa: individual risk and population curves served, and the cycle estimates with any scenario in production
webapi/fhir/risk.py builds a patient's RiskAssessment for CaCu and CaMa; GET /cama/modelo/curvas serves the production
version's survival curves; the cycle's estimator is generic by scenario; silver persona carries the date of death for CaMa;
the import schema accepts it; the CaMa risk batches can be confirmed and voided.
2026-11-21 02:07:34 -06:00
rockdrigo 9b617db9d0 CaMa: two clinical scenarios, post-treatment and under observation, with the follow-up list's scenario column and filter 2026-11-21 01:55:04 -06:00
Angel Capetillo Zavala c2b18d9969 feat(fhir): publish optional category groups and stratum captions of compositions 2026-11-21 01:29:31 -06:00