Commit Graph

18 Commits

Author SHA1 Message Date
alberto 983680ead3 TEA per-child FHIR resources: ADOS-2, EEG report, checks, metrics, Condition, RiskAssessment: routes and the per-child gate 2026-11-30 01:14:13 -06:00
alberto 3300ec3048 TEA gate: TEA_GATE_SLOW stretches its waits on a busy shared server (default 1) 2026-11-29 23:10:46 -06:00
alberto 08f240cde9 Merge P4.3 into P4.1 for one combined gate 2026-11-29 19:46:01 -06:00
alberto 80b3d23b75 Add governance and TEA preview REST endpoints
Use the models router for curves and training inputs, the EEG router for summary, and a separate preview router. Keep the preview result typed with the existing persistence model and declare multipart binary schemas for generated Blob parameters.
2026-11-29 19:45:50 -06:00
alberto b401f98f19 TEA follow-up: Patient search with TEA filters and $eeg-summary
Use _patient_rows and shared Query declarations for follow-up selection. Validate filters with an empty row before reading candidates, and use doseq for repeated values in paging links. Keep operation routes out of the metadata scan for read and search interactions. Use _follow_up_gate to compare the 29 captured queries by normalized record number, scalar counts and metrics.
2026-11-29 19:42:17 -06:00
alberto 9e5aa20092 ADOS-2 association model: Firth/ordinal port, MLflow model, bronze and gold, gate
Port the association estimator and add its source-parity tests in models.
Wire cohort selection, fingerprint deduplication, MLflow registration, and
champion scoring into the TEA jobs. Add both bronze tables, gold models
and key tests, and extend the existing WebApi hospital gate.

Follow the spec's resolved silver/bronze cohort and full CSV fingerprint.
No adaptations beyond the resolved spec. Preserve the source numerical
code with Ruff formatting and reflowed docstrings.

Internal choices:
- Select the first ADOS-2 with a SQL window and assemble predictor columns
  by EDF in pandas. Normalize dates to days across SQLite and PostgreSQL
  and use the undated CSS path if evaluation date is absent.
- Treat unstaged analysis or score tables as empty inputs. Retain the
  existing as_of argument without a cutoff in the specified cohort.
- Keep missing and non-finite report and bronze values as null, including
  open confidence limits. Store counts as bigint and direction as boolean.
  Reuse the EEG bronze merge writer after deleting the prior projection.
- Use a NumPy default_rng seeded with 0, uniform ages, normal predictors,
  and independent draws of module, item codes, and CSS for source parity.
  Load the reference modules in a test-only namespace with stub contracts.
- Record model and WebApi changes in their existing submodule branches
  and update the corresponding gitlinks in the parent commit.

Checks: Ruff lint and format check passed. lint-imports kept both
contracts. The association unit suite passed all five tests. Eight
lightweight TEA job tests passed, with two integration tests deselected.
SQLite smoke checks passed for cohort, registration and deduplication, promotion,
prediction, bronze writes, and both dbt models and their four key tests.
Fixture replay matched the 15 published pairs and 470 published scores.
The full hospital API gate runs on the test machines.
2026-11-29 13:34:01 -06:00
alberto 0a4deea370 Dask scheduler and workers for the test profile and CI; writes-overlap, cancel and remote-mode tests: run concurrency and cancel tests; TEA gate cancels a re-analysis and checks nothing changed 2026-11-29 04:47:23 -06:00
alberto 25955b80e8 TEA gate: re-analysis comparison keeps empty values empty 2026-11-29 03:38:20 -06:00
alberto 51bcdbdfe3 TEA hospital test follows the sensor flow; re-analysis by id in local mode; first_n
Update tests/test_tea.py. Wait for sensor analysis immediately after ingest. Keep training and promotion before scoring and submit the pending scope to apply curves.

Use monotonic polling deadlines, check failures before success, and allow 900 seconds for the expected-failure run to reach a terminal state. Pick the first valid API study, resolve its EDF through silver, compare verdict and level exactly, and compare numeric fields and code-keyed metrics with pytest.approx.
2026-11-29 01:25:29 -06:00
alberto a4c3d6c1b0 Merge tea/parity into P3.5 2026-11-28 16:31:56 -06:00
alberto 09691afc76 TEA gate: the 62-EEG analysis may take up to an hour on a 2-CPU test container 2026-11-28 16:31:45 -06:00
alberto 70c9506b97 tea_preview job: one file previewed, result as run output: GET /runs/{id}?outputs=true; the TEA gate also previews one hospital EDF 2026-11-28 13:37:27 -06:00
alberto 8fa2be8aab TEA gate compares the indicators after the curves score: M30 counts the alterations they find 2026-11-28 06:38:32 -06:00
alberto de4485094f TEA gate compares M24 by age and sex and M31 by sex; the platform-only M30 group per alteration is left out of the comparison 2026-11-28 05:56:42 -06:00
alberto 074fdb5305 TEA gate: ADOS-2 rows match by the platform's record number again (N-0010 is kept as N0010) 2026-11-28 04:50:07 -06:00
alberto 135f23e898 TEA gate on the sitio-b hospital: counts come from the hospital itself, ADOS-2 rows match by the hospital's own patient ids, durations counted to the 2026-11-28 load 2026-11-27 23:56:15 -06:00
Roberto Treviño 05980899a2 TEA gate: every EEG signal kept, alongside the reports 2026-11-26 14:25:53 -06:00
Roberto Treviño cb9115c435 TEA gate, EEG pages, analyze and named training runs 2026-11-26 07:06:52 -06:00