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.
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
How: `linea_de_tiempo_al_corte` is `linea_de_tiempo_al_inicio_del_periodo` with what the timeline held by the
question's event cut-off (all of it without one) instead of before the period's start. FHIR's `_label` reads a
timeline stratum's labels from its `valores` entries and `resto_etiqueta`. Tests cover CaMa's tumour stratifiers:
the facts dbt derives, the surrogate subtype's rules, CAMA_BIRADS_CANCER_INVASOR broken down by them, and the
cut-off.
Implications: a patient's characteristic learned after the fact that put her in the period (a cancer's stage or
subtype, written after its biopsy) can stratify a measure, and stays reproducible through the cut-offs. CaMa
publishes eight measures and five strata.