193 Commits

Author SHA1 Message Date
alberto af054460b5 Merge pull request 'Preview of one EDF and its ADOS-2 report, analysed in memory' (#21) from feature/tea-eeg-analysis into dev 2026-11-23 12:27:54 -06:00
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
alberto b0b797ac15 Merge pull request 'Governance TEA EEG: cohorts, baselines zip, cluster health, jobs with progress, EDF upload' (#20) from feature/tea-eeg-analysis into dev 2026-11-23 09:38:32 -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
alberto 05b0ccfce6 Merge pull request 'ADOS-2 scoring step in the indicators cycle' (#18) from feature/tea-eeg-analysis into dev
Reviewed-on: http://10.0.10.41:3000/ISSSTELEON/WebApi/pulls/18
2026-11-22 22:13:43 -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 71557ecbd3 Merge pull request 'CaCu: windows to diagnosis and treatment, FHIR base URL, the patient's risks per outcome' (#17) from integration/cacu-197-conciliacion into dev
Reviewed-on: http://10.0.10.41:3000/ISSSTELEON/WebApi/pulls/17
2026-11-22 13:47:01 -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 03be05fb17 Docker: Graphviz in the image, so each model version stores its dataflow's drawing as SVG 2026-11-22 07:47:05 -06:00
edgar 0c69140d2e Tests: the windows from the sample to the diagnosis (120) and to the treatment (180)
The 161-day diagnosis of the fixture is out of the 120-day window, and the sample-to-treatment horizon (180) leaves the
August and October samples pending. The comparison with the kit's oracle (180 days to the diagnosis) is marked as an
expected divergence until the oracle is regenerated with the project's horizon.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 04:37:22 -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 6d01742a85 Merge pull request 'CaCu indicators: times along the screening route, proportion intervals and survival notebooks' (#16) from integration/cacu-indicadores into dev
Reviewed-on: http://10.0.10.41:3000/ISSSTELEON/WebApi/pulls/16
2026-11-22 01:01:07 -06:00
edgar 8e5a7e3b81 test(cacu): the timeline's birth and death rows come from persona
CaCu's timeline now holds the patient's birth and death like CaMa's, so the comparison with the kit's rows leaves them
out along with the inferred procedures.
2026-11-22 00:28:43 -06:00
edgar d156bf3c99 test(cacu): cover the times along the screening route
The CaCu catalog holds fourteen measures. A fixture adds H-007, who goes the whole route in order, and a test pins the
population, the cases and the median of each of the five new times.
2026-11-22 00:23:23 -06:00
edgar 9461dfbd20 test(cacu): cover the two times to treatment
The CaCu catalog holds nine measures. A fixture adds H-004's colposcopy and treatment on top of the shared data, and a
test pins the days of both intervals with a 60-day horizon.
2026-11-22 00:23:17 -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
edgar 4840bd3dc8 Tests: a version declared over the API is blocked only by ML-01b
models dev (feb934d) relaxed ML-01a: not every model has the five routine records (a prevalence-incidence mixture
such as CaCu's PIM has no class balance or classifier calibration), so requiring all of them blocked the promotion
of models whose training run is in order. ML-01a now passes when the version comes from its training run, and its
detail reports which routine records that run holds. A version registered over HTTP still has a run, so it passes
ML-01a too; what keeps it from production is that it carries no saved model (ML-01b). This test expected both checks
to fail and would break as soon as the WebApi runs on that models dev.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HmQxVJVNR5FYkPAregGEQ7
2026-11-21 19:22:32 -06:00
angel b7ce3e7ddd Merge pull request 'CaMa: FHIR risk, live survival and recurrence figures, governance training jobs, lesion-size extraction' (#14) from feature/cama-roundtrip into dev
Reviewed-on: http://10.0.10.41:3000/ISSSTELEON/WebApi/pulls/14
2026-11-21 15:02:47 -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 0edac6d0e2 Lock: lifelines in the models dev group 2026-11-21 13:35:23 -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