feat(tea): EEG analysis before the silver load, and its verdict, quality checks and baselines through silver and FHIR
This commit is contained in:
@@ -11,6 +11,7 @@ Bronce lo escribe la ingesta, fuera del ciclo.
|
||||
"""
|
||||
|
||||
import logging
|
||||
from dataclasses import asdict
|
||||
from datetime import date, datetime
|
||||
from functools import partial
|
||||
from importlib import import_module
|
||||
@@ -81,8 +82,17 @@ def catalogs(migrate: str, ctx: Context) -> dict[str, int]:
|
||||
return counts
|
||||
|
||||
|
||||
def load(catalogs: dict[str, int], ctx: Context) -> SQLModel:
|
||||
"""`carga`, `persona`, `procedimiento` y `observacion_clinica` desde staging (T-20c).
|
||||
def analyze_eeg(migrate: str, 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` and `eeg_metrica_electrodo`.
|
||||
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 load(catalogs: dict[str, int], analyze_eeg: dict[str, int], ctx: Context) -> SQLModel:
|
||||
"""`carga`, `persona`, `procedimiento` y `observacion_clinica` desde staging (T-20c), after the EEG analysis.
|
||||
|
||||
Incremental por la llave lógica de cada procedimiento (`save_load_in`): repetir no cambia nada.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user