Commit Graph

2 Commits

Author SHA1 Message Date
edgar 5cc6bee168 Indexing: the first invasive biopsy reads the scenario's event grades and keeps its rules
The whole-frame version of primera_biopsia_invasora looked for the single code CARCINOMA_INVASOR, so CaCu's survival,
which indexes on CIS and CARCINOMA, had no members and could not train. It also dropped the two rules the per-patient
version applied (no birth date, a death on or before the biopsy) and the prior observation threshold. It now takes the
grades from event_grades (invasive_code stays the fallback) and applies the rules in the same order, with the same
attrition.
2026-11-23 02:04:01 -06:00
edgar 410de1d3b7 Each scenario's index and rules in its pipeline, matching dbt's cohorts
models/steps/indexing.py: a scenario that lists it gets its source cohort as `source_cohort`, and the node `cohort`
re-indexes it by `[config.index]` of its model.toml: the surveillance kind (first cytology) and the post-colposcopy
kind (visit k), with dbt's rules in dbt's order and names, the recruitment window taken from the source cohort's
parameters. Every kind ends with `observacion_previa_insuficiente`, a threshold on the days observed before the index
(0 for now: the data are left-truncated, so rules on earlier events read only what was recorded). On the synthetic
copy the pipeline gives dbt's patients, index dates and attrition for cin2_pim and cin2_logistic (surveillance) and
cin2_pim_post_colposcopy (visit 1, now on cacu/cohorte_total). cin2_logistic's MUESTREO records the index attrition and
the prior history; a stored build's lineage carries its parameters.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HmQxVJVNR5FYkPAregGEQ7
2026-11-20 21:54:47 -06:00