Files
ISSSTELEON/Transformation/dbt_project.yml
T
Angel Capetillo Zavala 9903e22c2a Add CaMa cohort and L3 measures with integrated API and dashboard
Publish deterministic cohort candidates and detection, result-to-diagnosis and BI-RADS histopathology measures. Pin locally prepared WebApi and WebApp commits based on current dev; retain models and shared persistence changes from upstream. Document compatibility, required views and stored-report behavior.
2026-11-17 10:44:08 -06:00

161 lines
8.4 KiB
YAML

name: isssteleon
version: "1.0.0"
config-version: 2
profile: cacu
model-paths: ["models"]
test-paths: ["tests"]
vars:
rec_inicio: "2018-01-01"
rec_fin: "2026-12-31"
ventana_basal_dias: 90
grados_evento: ["LIEAG", "CIS", "CARCINOMA"]
# Parámetros de corrida: se sobreescriben con --vars al ejecutar
periodo_inicio: "2024-01-01"
periodo_fin: "2024-07-01"
fecha_corte: "2024-12-31"
deteccion_grados: ["LIEAG", "CIS", "CARCINOMA"]
# Parámetros de catálogo CaCu (cacu.parametros en indicadores_kit)
calidad_insatisfactoria: "INSATISFACTORIO"
citologia_anomala: ["ASC-US", "ASC-H", "LIEBG", "LIEAG", "CIS"]
citologia_alto_grado: ["ASC-H", "LIEAG", "CIS"]
catalogo_biopsia: ["NORMAL", "LIEBG", "LIEAG", "CIS", "CARCINOMA"]
especialidades_diagnostico: ["CLINICA_MUJER_COLPOSCOPIA", "CIRUGIA_ONCOLOGICA"]
# CIE-10 without the dot, compared exactly (the kit's cacu.diagnostico.cie and .cie_antecedente; provisional).
# A medical note with one of these resolves a cytology:
cie_diagnostico: ["Z014", "Z124", "B977", "R876", "N87", "N870", "N871", "N872", "N879",
"D06", "D060", "D061", "D067", "D069", "C53", "C530", "C531", "C538", "C539"]
# A note with one of these before the cytology leaves it out: the patient is already a case.
cie_antecedente: ["D06", "D060", "D061", "D067", "D069", "C53", "C530", "C531", "C538", "C539"]
horizonte_toma_reporte_dias: 60
horizonte_toma_diagnostico_dias: 180
# ASCCP follow-up (the kit's cacu.seguimiento.*; provisional): what counts as a colposcopy and a treatment
# (models/cacu/silver/cacu_procedimientos_inferidos.sql).
seguimiento:
colposcopia_evidencias: ["motivo", "cie", "diagnostico_texto", "orden_biopsia", "biopsia"]
colposcopia_requisito: "valoracion_previa"
biopsia_requisito: "mismo_dia_que_colposcopia"
colposcopia_motivos: ["ACUDE A COLPOSCOPIA", "COLPOSCOPIA"]
colposcopia_especialidades: ["CLINICA_MUJER_COLPOSCOPIA"]
colposcopia_cie: ["R876", "N87", "N870", "N871", "N872", "N879", "B977"]
colposcopia_diagnosticos: ["VIRUS DEL PAPILOMA HUMANO"]
tratamiento_cie: ["D06", "D060", "D061", "D067", "D069"]
vigilancia_especialidades: ["MEDICINA_FAMILIAR", "CLINICA_MUJER_COLPOSCOPIA"]
# The risk estimates a band summary reads (the kit's cacu.riesgos.horizonte_banda; provisional): years from the
# index date, 0 is prevalent.
riesgos_horizonte_banda: 0
# CaMa's rules (the kit's cama.*; provisional). The diagnosis rules: a note with one of `cie_diagnostico` written by
# one of `especialidades_diagnostico` resolves a mammogram within `horizonte_toma_diagnostico_dias`; one with one
# of `cie_antecedente` before it leaves it out. `birads_gravedad`: BI-RADS from least to most severe.
cama:
cie_diagnostico: ["Z123", "N60", "N600", "N601", "N602", "N603", "N604", "N608", "N609", "N61", "N62", "N63",
"N64", "N640", "N641", "N642", "N643", "N644", "N645", "N648", "N649", "D24", "R92", "D05",
"D050", "D051", "D057", "D059", "C50", "C500", "C501", "C502", "C503", "C504", "C505", "C506",
"C508", "C509"]
cie_antecedente: ["D05", "D050", "D051", "D057", "D059", "C50", "C500", "C501", "C502", "C503", "C504", "C505",
"C506", "C508", "C509"]
especialidades_diagnostico: ["CIRUGIA_ONCOLOGICA"]
horizonte_toma_diagnostico_dias: 180
birads_gravedad: ["B1", "B2", "B3", "B0", "B4", "B4A", "B4B", "B4C", "B5", "B6"]
# Biopsy grades from least to most severe (models/cama/gold/eventos/cama_resultado_biopsia.sql): the keys of
# cama.catalogos.biopsia.
biopsia_gravedad: ["BENIGNO", "CARCINOMA_IN_SITU", "CARCINOMA_INVASOR"]
# The grades that count as cancer in the detection rate (models/cama/gold/eventos/cama_deteccion_biopsia.sql): the
# values of the parameter cama.biopsia_cancer (a test keeps them equal).
grados_cancer: ["CARCINOMA_IN_SITU", "CARCINOMA_INVASOR"]
# The analysis' stratifiers (models/cama/silver/cama_estratificadores.sql), from the catalog's provisional results
# read from reports; placeholders until the domain expert validates them. `estadios`: each clinical stage's
# group; `etapa_temprana`: the groups counted as early, the rest of the known ones advanced. The surrogate
# molecular subtype: HER2 3+ is HER2-positive; HER2 0 or 1+ with both receptors negative, triple negative; with a
# positive receptor, luminal A when Ki-67 is under `ki67_corte` % and progesterone positive with at least
# `rp_corte` % (or no percentage), luminal B when Ki-67 is at least `ki67_corte` % or progesterone falls short;
# without Ki-67, none. `tamano_t`: T by the lesion's largest diameter in mm, each up to its bound.
# The biopsy grades that are an invasive cancer (models/cama/gold/eventos/cama_cancer_invasor.sql).
grados_invasor: ["CARCINOMA_INVASOR"]
estratos:
estadios: {E0: "0", EI: "i", EIIA: "ii", EIIB: "ii", EIIIA: "iii", EIIIB: "iii", EIIIC: "iii", EIV: "iv"}
etapa_temprana: ["0", "i", "ii"]
her2_positivo: ["H3"]
her2_negativo: ["H0", "H1"]
ki67_corte: 20
rp_corte: 20
tamano_t: [{t: "t1", hasta_mm: 20}, {t: "t2", hasta_mm: 50}, {t: "t3", hasta_mm: null}]
# TEA's rules (models/tea). The cohort: children whose first M-CHAT was at `edad_min_meses` to `edad_max_meses`
# completed months (days / `dias_por_mes`, rounded to one decimal, then truncated); `ventanas`, the age groups of
# that age. A confirmation is a neuropediatrics note with one of `cie_tea` (without the dot, compared exactly).
# An EEG is bad when any quality criterion passes its threshold (`calidad`); a metric is altered when its z-score
# against the reference of the child's age group at the EEG is at least `alteracion_z` away from 0.
# The references, thresholds and `alteracion_z` are placeholders until the domain expert validates them.
tea:
edad_min_meses: 16
edad_max_meses: 36
dias_por_mes: 30.4375
ventanas:
- {clave: "16_23", desde: 16, hasta: 23}
- {clave: "24_29", desde: 24, hasta: 29}
- {clave: "30_36", desde: 30, hasta: 36}
cie_tea: ["F840"]
alteracion_z: 2
calidad:
canales_amplitud: 2
canales_alta_frecuencia: 2
canales_correlacion: 2
canales_sin_senal: 2
ruido_linea_db: 8
# Reference range of each metric by age group at the EEG: (metric, group, min, max). The mean is the middle of
# the range and the standard deviation a quarter of its width.
referencias:
- ["ritmo_posterior", "16_23", 4.5, 7.0]
- ["ritmo_posterior", "24_29", 5.0, 7.5]
- ["ritmo_posterior", "30_36", 5.5, 8.5]
- ["husos_sueno_n2", "16_23", 2.5, 6.5]
- ["husos_sueno_n2", "24_29", 2.25, 6.25]
- ["husos_sueno_n2", "30_36", 2.0, 6.0]
- ["husos_sueno_n3", "16_23", 0.75, 2.75]
- ["husos_sueno_n3", "24_29", 0.5, 2.5]
- ["husos_sueno_n3", "30_36", 0.5, 2.5]
- ["picos_paroxisticos", "16_23", 0.0, 1.0]
- ["picos_paroxisticos", "24_29", 0.0, 1.0]
- ["picos_paroxisticos", "30_36", 0.0, 1.0]
- ["gradiente_anteroposterior", "16_23", 2.0, 3.5]
- ["gradiente_anteroposterior", "24_29", 1.75, 3.25]
- ["gradiente_anteroposterior", "30_36", 1.5, 3.0]
# The surveillance cohort's rules (models/cacu/cohorts/surveillance).
surveillance_cohort:
recruitment_start: "2024-01-01"
recruitment_end: "2027-01-01"
cutoff: "2026-12-31"
event_grades: ["LIEAG", "CIS", "CARCINOMA"]
# models/<project>/silver: what dbt derives from silver's procedimiento and observacion_clinica, compiled as
# CTEs inside the models that use them (no objects in the database), except the timeline, a view.
# models/<project>/gold/<family>: one view per indicator, a folder per family as in the kit.
# Run one domain at a time against its own database: dbt build --profile cacu --select cacu
models:
isssteleon:
cacu:
silver:
+materialized: ephemeral
+tags: ["silver"]
gold:
+materialized: view
+tags: ["gold"]
cama:
silver:
+materialized: ephemeral
+tags: ["silver"]
gold:
+materialized: view
+tags: ["gold"]
tea:
silver:
+materialized: ephemeral
+tags: ["silver"]
gold:
+materialized: view
+tags: ["gold"]
# The project's own macros come first for dbt's dispatched macros (`datediff` on SQLite: macros/datediff.sql).
dispatch:
- macro_namespace: dbt
search_order: ["isssteleon", "dbt"]