Aggregate ADOS-2 Observation (CSS, classification, module, 22 items); one EEG DiagnosticReport per signal-backed study (id from person and study date; quality, validity, duration, age, channels) with its check and metric Observations (electrode/zone components; z, outside and curve centiles only from a champion); F84.0 Condition; one RiskAssessment per child with every association pair, the headline first (altered biomarkers by q, else lowest q). Served from silver/bronze, not the screening-gated gold; EEG summary gains fhir_eegs/fhir_metrics. Predictions come from the child's earliest scored EEG.
Checks: ruff, import-linter, 44 pure tests, openapi unchanged, client no drift.
Generic: GET .../versions/{v}/checks (reports present/missing, candidate/champion/retired), POST .../retire (not the champion), GET .../lineage (params, metrics, tags, bundle origin), training inputs declared by the domain (TEA reference cohorts: .edf and edades.csv only, path-safe, temp+rename). TEA: GET /models/tea/{name}/versions/{v}/curve (centiles by month 16-36 via curves.centiles; scoring unchanged, regression test), POST/GET /tea/preview, GET /tea/eegs/summary (nine fields from gold/bronze), checks and regions in GET /tea/eegs/{id}.
Checks: ruff, import-linter, openapi diff, client generation, centile regression.
Implement overlap selection, ADOS-2 scoring and TEA filters for Patient
search and $eeg-summary. Add comparisons for all 29 reference queries
inside the existing hospital test. Record the WebApi and WebApp changes
through their submodule pointers.
Implementation choices
- Store filter kind, row field and allowed tokens together. Combine
repeated token values with comma-separated tokens. Use _limit and
finite Decimal bounds for numeric comparisons. Validate every supplied
value even when a preceding condition misses.
- Keep stored row dates intact and normalize them for date comparisons,
ordering and scoring. Count alterations in EEG_METRICS order and
derive the missing EEG count from the total.
- Use TEA_PERSONS for the common SQL projection and _patient_rows for
API selection. Share the four follow-up Query declarations. Validate
filters against an empty row to handle empty selections. Serialize
repeated paging parameters with urlencode and doseq. Skip operation
routes when deriving metadata read and search interactions.
- Use _follow_up_gate for fixture translation and comparison. Normalize
record numbers to integers and compare alteration counts by metric.
Ruff check and format check passed from the worktree root.
Import lint passed both contracts and all 20 pure follow-up tests passed.
FHIR handler smoke checks with stubbed reads passed. The OpenAPI diff
showed the new start parameter and summary operation. The repeated
client regeneration matched. Git diff --check passed. The hospital gate runs on the test machines.
A TEA training run can name its reference cohort (a folder under TEA_REFERENCE_ROOT with edades.csv) and mains frequency (50/60 Hz, validation only); the cache key and the reports carry both. GET /models/{domain}/{name}/training-config gives the train form JSON schema and defaults. Checks: ruff, import-linter, openapi diff, 8 model tests (sandbox).
tea_follow_up: one row per screening child (step, status, step date, M-CHAT score, latest ADOS-2 items for core.tea.ados2.score, first good EEG with duration, channels, whether a champion scored it and its result, alteration flags). tea_eeg_checks: every check of an EEG. tea_eeg_regions: electrode and zone values (new bronze.eeg_sites, written by save_analyses) with their age-curve scores. ADOS2_ITEMS: the 22 catalog items.
Checks: ruff, import-linter, dbt parse; compose: 9 passed (test_core_tea, test_persistance_eeg_sites, test_dbt_tea_follow_up on sqlite and postgres, test_synthetic_tea).
The edf node turns a column of EDF file hashes into edf_* header columns (patient code, sex, birth date, study date, record code, duration, channels, error) for identity and the eeg target. read.header parses the fixed header with the standard library (declared duration, zero signals accepted); _kept/_open keep edfio and refuse truncated or zero-signal files with FileNotValid.
Checks: ruff, import-linter, openapi diff; compose: 21 passed (test_core_pipeline, test_edf_header, test_edf_node, test_edf_upload); ng build clean.
Export (GET /models/{domain}/export) writes a deterministic zip of chosen versions with a manifest of SHA-256s, after the domain guard (TEA: n_reference >= 5, no study codes, dates or paths). Import (POST /models/{domain}/import, Dagster job import_bundle) stages the upload, checks its SHA-256 and that the operator listed it in $DATA_DIR/bundles/trusted (403 otherwise), verifies every file against the manifest and registers new candidate versions with lineage tags; duplicates are skipped.
Checks: ruff, import-linter, openapi diff; compose: 43 passed (test_bundles, test_runs, test_bundle, test_core_bundle_guard); ng build clean.
M30_RESULTADO_EEG counts each child of the cohort whose first good EEG falls in the period, and
of them those with an alteration, one overlapping group per EEG metric. M31_PREVALENCIA counts
every person while in the prevalence age band by her state at the period's end, by sex.
core.measures gains Proportion.overlaps and StatusComposition.strata, generic for every domain.
core.tea sets PREVALENCE_AGE and EEG_METRICS; dbt reads both.