Commit Graph

163 Commits

Author SHA1 Message Date
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
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
rockdrigo 3b192207fd Live survival: no options route 2026-11-21 13:03:19 -06:00
angel 69d2d0e175 Merge pull request 'Integration/tea eeg analysis into dev' (#13) from integration/tea-eeg-analysis-into-dev into dev
Reviewed-on: http://10.0.10.41:3000/ISSSTELEON/WebApi/pulls/13
2026-11-21 12:35:31 -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 1a6db9cf6b Merge origin/feature/cohorts-dbt-canonical 2026-11-21 04:00:00 -06:00
rockdrigo e33eaafb08 Live estimators test says what it checks for CaMa 2026-11-21 03:33:44 -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 fae6b2232f The CaCu timeline fixture knows the biopsy order, and the rare-type wording test uses the ICD-O-3 codes 2026-11-21 02:57:36 -06:00
edgar 2ee95576a8 Tests: the cycle builds every dbt cohort of each project, CaMa's survival cohort included
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HmQxVJVNR5FYkPAregGEQ7
2026-11-21 02:14:26 -06:00
rockdrigo 6b011df0fd Merge the CaMa survival cohort support 2026-11-21 02:07:54 -06:00
rockdrigo 58d3291804 Merge CaMa risk, curves and generic estimators 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
edgar f34c2b5116 Merge remote-tracking branch 'origin/feature/163-cama-risk-curves' into feature/cohorts-dbt-canonical 2026-11-21 02:06:26 -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
rockdrigo d1e06798c9 Tests: no CaMa measure is served by clinical stage or tumour size; the stratifiers view is built in its own test 2026-11-20 23:28:33 -06:00
edgar 26f2b35338 Retire GET /cacu/pacientes/<id>/riesgo: the record reads the FHIR RiskAssessment
The WebApp patient record now reads GET /cacu/fhir/RiskAssessment?subject=Patient/<pac_id> (WebApp
feature/cohorts-dbt-canonical), so the custom route, its blueprint and its tests go; the risk batches and the
follow-up list point to the FHIR search.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HmQxVJVNR5FYkPAregGEQ7
2026-11-20 23:15:55 -06:00
edgar 0c1b383da2 CaCu's individual risk as a FHIR RiskAssessment, and each risk's index date
GET /cacu/fhir/RiskAssessment?subject=Patient/<pac_id> (DEV only, tagged simulado, a searchset validated with R4B, as
TEA's patient resources): the patient's current batch, one prediction per horizon with its outcome, probability and
whenPeriod from the risk's index date, the confidence interval in an extension; declared in the CapabilityStatement.
GET /cacu/pacientes/<id>/riesgo adds riesgo.fecha_indice. Tests and the risk-band fixture carry the index date.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HmQxVJVNR5FYkPAregGEQ7
2026-11-20 23:02:46 -06:00
edgar 7d06f9db9d The cycle builds the cohorts dbt defines; models' moved modules
The `cohorts` and `estimate` steps take the project's cohorts from dbt's manifest (`cohort_urls`) and build each one
with models' `build_of` over dbt's queries, instead of the Python-frame TOMLs in models/cohorts, which are gone; without
a manifest a project has no cohort steps. The recruitment window and cut-off are dbt's vars. The live estimator reads
cin2_logistic through `Scenario` and `KitBuild`, and governance imports `models.reports.experiment`, where models now
keeps it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HmQxVJVNR5FYkPAregGEQ7
2026-11-20 20:18:00 -06:00
rockdrigo 8130f86f3a Silver persona carries the date of death in CaCu and CaMa; tests for it and for CaMa's birth and death on the timeline 2026-11-20 18:46:40 -06:00
rockdrigo 028f774400 Tests: CaMa's clinical scenarios as a hierarchy, with discharge notes starting post-treatment 2026-11-20 17:03:38 -06:00
rockdrigo ca0f02aa0c A coded catalog result may name the code system of its values; the histological type comes out as its ICD-O-3 code 2026-11-20 17:03:38 -06:00
rockdrigo 7a84cb19c9 Tests: each CaMa patient's scenario and the evidence that starts it 2026-11-20 17:03:38 -06:00
rockdrigo 5a4baeb33e Tests: CaMa's stage and size measures of invasive cancers, and the measure counts 2026-11-20 17:03:38 -06:00
Angel Capetillo Zavala c86c530703 Declare the tea library as a direct dependency 2026-11-20 16:56:05 -06:00