ADOS-2 scoring step in the indicators cycle, run after the document import commits; EEG analysis ordered before the relation steps

This commit is contained in:
ulises
2026-11-22 22:01:50 -06:00
parent 430d165594
commit eb88cb7eb0
10 changed files with 139 additions and 9 deletions
+11 -1
View File
@@ -82,16 +82,26 @@ def catalogs(migrate: str, ctx: Context) -> dict[str, int]:
return counts
def analyze_eeg(migrate: str, ctx: Context) -> dict[str, int]:
def analyze_eeg(migrate: str, score_ados2: dict, ctx: Context) -> dict[str, int]:
"""The EEG analysis of each stored EDF that needs one (`ctx.eeg_analysis`), written to bronze before `load` reads
it: the verdict, quality checks and metrics in `eeg`, `eeg_criterio`, `eeg_metrica`, `eeg_metrica_electrodo`
and `eeg_metrica_zona`.
Waits for `score_ados2` only so the quick scoring doesn't queue behind a long analysis.
Returns how many EEGs were pending and how each ended; nothing without an analysis (every domain but TEA)."""
if ctx.eeg_analysis is None:
return {}
return asdict(ctx.eeg_analysis())
def score_ados2(migrate: str, ctx: Context) -> dict:
"""The CSS and classification of each ADOS-2 from its items, module, algorithm and the child's age
(`ctx.ados2_scoring`), written to bronze before the association and `load` read them. Returns how many
evaluations were scored; nothing without a scoring (every domain but TEA)."""
if ctx.ados2_scoring is None:
return {}
return asdict(ctx.ados2_scoring())
def relate_ados2(analyze_eeg: dict[str, int], ctx: Context) -> dict:
"""The ADOS-2 association fitted on the EEGs the analysis left (`ctx.ados2_relation`), written to
`relacion_ados2` and `relacion_ados2_paciente` before `load`, so the same cycle's gold views show it. Returns