A timeline stratum read by the event cut-off, and labels for a timeline stratum's values

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.
This commit is contained in:
rockdrigo
2026-11-13 12:07:58 -06:00
parent 97480ab832
commit dc9a3422e0
5 changed files with 141 additions and 10 deletions
+4 -4
View File
@@ -84,11 +84,11 @@ def test_las_definiciones_son_las_del_manifiesto_de_dbt(base):
measure the manifest declares stops reaching `cat_estrato` and `cat_measure`, or a second run deletes rows."""
resumen = base.run("definitions")["definitions"]
# CaCu: three strata and its seven measures; CaMa: its seven measures, without strata; TEA: the age group and its
# ten measures.
assert resumen["definitions"] == {"cacu": 10, "cama": 7, "tea": 11}[base.proyecto]
# CaCu: three strata and its seven measures; CaMa: the five strata of its invasive cancers and its eight measures;
# TEA: the age group and its ten measures.
assert resumen["definitions"] == {"cacu": 10, "cama": 13, "tea": 11}[base.proyecto]
# Y el catálogo de publicación de §6f (T-19b): un `cat_measure` por measure, sincronizado.
assert base.dominio.cat_measure_repository.count() == {"cacu": 7, "cama": 7, "tea": 10}[base.proyecto]
assert base.dominio.cat_measure_repository.count() == {"cacu": 7, "cama": 8, "tea": 10}[base.proyecto]
assert base.run("definitions")["definitions"]["borradas"] == 0