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.
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".
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.
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>
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.
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.