CaMa: FHIR risk, live survival and recurrence figures, governance training jobs, lesion-size extraction #14

Merged
angel merged 29 commits from feature/cama-roundtrip into dev 2026-11-21 15:02:49 -06:00
Owner
  • CaMa's risk as a FHIR RiskAssessment (shared builder with CaCu), risk batches for CaMa, and the cycle estimating with the production version.
  • Governance: the trainable scenarios (GET /governance/scenarios) and background training jobs (POST /model-versions/<d>/<s>/train-jobs, GET /training-jobs); a scenario with external data, and TEA on a local reference folder, train without a dbt export.
  • Model analysis routes: /cama/modelo/curvas and /desarrollo (what a version published), /cama/modelo/escenarios and POST /cama/modelo/curvas/consulta (the live figure of a clinical scenario), /cama/modelo/recurrencia (the recurrence scenarios a patient meets).
  • Pathology reports: lesion size is extracted (a wrapped caption included); pac_fecha_defuncion is imported.
  • seer-survival extra (pgmpy, statsmodels, lifelines...) in the lock.

Tests: the WebApi suite passes except the OCR/PDF tests (no Tesseract) and the connector tests that need the SQL Server driver.

- CaMa's risk as a FHIR `RiskAssessment` (shared builder with CaCu), risk batches for CaMa, and the cycle estimating with the production version. - Governance: the trainable scenarios (`GET /governance/scenarios`) and background training jobs (`POST /model-versions/<d>/<s>/train-jobs`, `GET /training-jobs`); a scenario with external data, and TEA on a local reference folder, train without a dbt export. - Model analysis routes: `/cama/modelo/curvas` and `/desarrollo` (what a version published), `/cama/modelo/escenarios` and `POST /cama/modelo/curvas/consulta` (the live figure of a clinical scenario), `/cama/modelo/recurrencia` (the recurrence scenarios a patient meets). - Pathology reports: lesion size is extracted (a wrapped caption included); `pac_fecha_defuncion` is imported. - `seer-survival` extra (pgmpy, statsmodels, lifelines...) in the lock. Tests: the WebApi suite passes except the OCR/PDF tests (no Tesseract) and the connector tests that need the SQL Server driver.
roberto added 27 commits 2026-11-21 13:49:41 -06:00
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
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
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
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.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HmQxVJVNR5FYkPAregGEQ7
rodrigo added 1 commit 2026-11-21 14:05:53 -06:00
rodrigo added 1 commit 2026-11-21 14:43:56 -06:00
angel merged commit b7ce3e7ddd into dev 2026-11-21 15:02:49 -06:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ISSSTELEON/WebApi#14