Commit Graph

65 Commits

Author SHA1 Message Date
alberto 77ffe24ee8 Merge tea/parity into P3.7 (P1.4); tea/__init__ keeps ADOS2_ITEMS and TRAINING_OPTIONS 2026-11-28 13:26:44 -06:00
alberto 493de8c1a1 Training config: reference name and mains frequency
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).
2026-11-28 13:26:19 -06:00
alberto df5368c3e8 Merge P1.4: gold follow-up, EEG checks and regions 2026-11-28 13:24:54 -06:00
alberto 74c9827cef Gold tea_follow_up, tea_eeg_checks, tea_eeg_regions; bronze eeg_sites
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).
2026-11-28 13:24:54 -06:00
alberto 58f0e7f38f Merge P3.6: EDF reader node in the ingestion DSL 2026-11-28 13:15:14 -06:00
alberto 0fc18077c4 Merge tea/parity into P3.6 (P3.4 bundles, runs-locked, P1 gate); openapi.json regenerated, identical 2026-11-28 10:32:03 -06:00
alberto 6eb04a1d27 EDF reader node in the ingestion DSL
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.
2026-11-28 10:30:50 -06:00
alberto 7cba0df111 Merge P3.4: generic model bundles, export and import
# Conflicts:
#	WebApi
2026-11-28 09:24:54 -06:00
alberto fdce3a5f49 Generic model bundles: export and import
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.
2026-11-28 09:24:40 -06:00
alberto 15bdef5ee2 Merge runs-locked: the runs API retries a locked Dagster run storage 2026-11-28 08:43:00 -06:00
alberto 3bca49469b Runs API retries a locked Dagster run storage 2026-11-28 08:43:00 -06:00
alberto 4f83e8fae9 Merge P1 gate: TEA end-to-end parity against the sitio-b hospital (SQLite passes); M24 by age group and sex 2026-11-28 08:14:35 -06:00
alberto be77587f8f Merge P3.3: runs API (progress, info and warnings, cancel, history), execution options and health 2026-11-28 06:54:01 -06:00
alberto 0616df6927 Runs API and run monitoring: Dagster ends a run whose process died, and a cancel that never stops 2026-11-28 06:54:01 -06:00
alberto 993a36599c TEA gate: indicators after scoring 2026-11-28 06:38:32 -06:00
alberto acef3e97fd M24 by age group and sex: tea_screening carries the child's sex, and the age_sex stratifier joins them as one value
The current platform reports M24 by age and sex (edad_sexo); the WebApp's Resumen draws it.
2026-11-28 05:56:42 -06:00
alberto 529bd0ee7e TEA gate: ADOS-2 match by record number 2026-11-28 04:50:08 -06:00
alberto 25af679665 TEA gate follows the sitio-b reference 2026-11-27 23:56:15 -06:00
alberto f0df5799ef Merge P0.3: TEA reference from sitio-b 2026-11-27 23:53:49 -06:00
alberto 125b413ec6 TEA reference recaptured from sitio-b: 62 children with real EDFs, M30/M31, follow-up queries, patient summaries, code systems, association tables, baselines bundle
The hospital manifest records the sitio-b TEA hospital (sha256 2b2abae4...), which replaces the
200-child synthetic one. follow_up and patients are stored gzipped (58 MB and 6 MB as JSON); the
capture tool writes them that way with mtime 0, so a recapture is byte-identical.
2026-11-27 23:53:48 -06:00
alberto 0b4851b681 Merge P3.2: the tea_eeg job (analyse, score age curves, relate ADOS-2, rebuild gold) and the after-ingest sensor 2026-11-27 23:30:06 -06:00
alberto c4c11fa4ef EEG scope: which EEGs an analysis takes (pending, first n, named ids), in a fixed order 2026-11-27 18:02:28 -06:00
alberto 931e4e5107 Merge P3.1: execution backend (sync, local, remote Dask) with live progress 2026-11-27 17:56:17 -06:00
alberto ae924a6399 compose passes DASK_LOCAL_WORKERS, so a shared host can size the local cluster 2026-11-27 17:56:17 -06:00
alberto a82edd879f Execution backend: the cluster choice, allow-list, health and progress shape live in Persistance; Dask and psutil added 2026-11-27 17:19:55 -06:00
alberto 1afc89ab2d Merge P1.3: gold for M30 and M31 2026-11-27 17:11:46 -06:00
alberto b6cd1f7d50 Gold for M30 and M31: each child's first good EEG and its alterations, every person in the prevalence age band
tea_alterations: one row per child whose chain reached the EEG step, dated by her first good EEG,
altered when a metric scored by a champion curve falls outside p5-p95. tea_prevalence: every person
with a birth date, the day she enters and leaves the 16-36 month band, and her confirmation day.
add_days macro on every engine; tea.yml tests every TEA gold model.
2026-11-27 17:11:46 -06:00
alberto abb1183691 Merge P1.1: TEA identity reads sex and name 2026-11-27 17:09:25 -06:00
alberto 58d2a8eeb0 The TEA pipeline reads the child's sex and name into identity
As the CaMa pipeline does: the patients' sex (through the hospital_tea ConceptMap) and full name,
and the link compares sex too. M31 is stratified by sex; the follow-up list searches names.
The TEA gate runs once the sitio-b reference is captured (P0.3).
2026-11-27 17:09:25 -06:00
alberto ea800e48b8 Merge P0.4: synthetic TEA hospital 2026-11-27 17:09:07 -06:00
alberto 0b63c19e53 Synthetic TEA hospital: fourteen children covering every case state, ADOS-2 reports in the hospital's layout, generated EDF studies
Default seed EEG verdicts by spec child index:
- 8: valid, complete.
- 9: valid, complete.
- 10: valid, complete.
- 11: invalid, not_analyzable. T3/T4 are dead and P3/P4/O1/O2
  have abnormal amplitudes and intermittent bursts.

After validation, children 8–10 each return a ValueError during
preprocessing. The model's 100 Hz bandpass cutoff exceeds the 64 Hz
Nyquist frequency of the specified 128 Hz studies (since raised to 256 Hz). The test uses the
validation verdict as specified.

Implementation choices:
- Group the fixed profiles, table definitions and report item labels in
  the generator. Insert child by child in a SQLite transaction. Use
  truth row counts to allocate table-local IDs and flatten truth by table.
- Reuse the synthetic package's fixed PDF creation date and fpdf2's
  default margins. Draw the score for the S/D item in print order, then
  replace it with None before totaling and rendering.
- Evaluate continuous EDF events on the sample grid with start-inclusive,
  end-exclusive bounds. Give awake the extra sample when the count is
  odd. Draw the gap after every slow-wave candidate, clip blinks at the
  awake boundary and evaluate beat Gaussians across the full recording.
  Apply awake rhythm and slow-wave scaling to the positioned channels,
  including ears, and give the auxiliary channels their specified events.
- Require positive whole-second durations and positive integer sample
  rates. Keep zero-variance noise at zero. Apply channel faults after
  adding mains. Write each study in a private temporary directory.
- Compare SQLite rows in primary-key order, and use case-insensitive
  fixture patterns to check PDF text. The slow test prints the validator
  checks and any analysis error when run with capture disabled.
- Updated the synthetic package entries in uv.lock against the existing
  locked versions after the registry lookup failed. uv lock validated
  the resulting lockfile.

The default sampling rate was raised to 256 Hz: at 128 Hz the analysis's 100 Hz band edge is above
Nyquist. At 256 Hz children 8-10 analyse fully (valid, complete, five metrics) and child 11 is not analysable.
2026-11-27 17:09:07 -06:00
alberto 2d185eba7f Merge P0.2: TEA capture from sitio-b 2026-11-27 17:03:03 -06:00
alberto 5edc7eebff Capture TEA from sitio-b: follow-up list with each filter, EEG summary, patient summaries, code systems, association tables and bundle manifest
Follow-up queries in the unit check: 24
2026-11-27 17:03:03 -06:00
alberto 2f39d9cd8d M30 and M31: proportions over overlapping groups and status compositions with strata
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.
2026-11-27 16:59:59 -06:00
Roberto Treviño 2d6d604e3e Erick's site as he holds it now: one table, sample dated by reception, his wording and employee numbers; a date read as a record number is held
ci / python (push) Successful in 49m9s
ci / web (push) Successful in 11m54s
2026-11-27 14:02:09 -06:00
Roberto Treviño 0724b04e69 models: outcomes per split in the CaCu metrics 2026-11-27 11:05:28 -06:00
Roberto Treviño ecf37e1f8c Synthetic CaCu with colposcopy clinic, treatment, co-test follow-up, cancers and deaths; Erick's site prints notes and death notes 2026-11-27 08:46:09 -06:00
Roberto Treviño 359c2415b4 Erick's site: OCR stage look-alikes in its map; review conflicts as an anti-join
ci / python (push) Successful in 48m49s
ci / web (push) Successful in 13m20s
2026-11-27 05:07:54 -06:00
Roberto Treviño 0bbbdaa130 ISSSTELEON's test source as the site: SQL Server ArchivosUni and ResultadosSubrogados in its layouts, fed by Synthea; cervical screening module as NOM-014 runs it 2026-11-27 01:45:16 -06:00
Roberto Treviño 23d8135040 CaMa catalog: biopsy results, stage and treatments; Synthea breast screening module and FHIR door pipeline
ci / python (push) Successful in 35m29s
ci / web (push) Successful in 8m37s
2026-11-26 19:03:39 -06:00
Roberto Treviño e13ae70e1c Files kept once at the source and carried by hash; reference cohorts loaded by a pipeline; tests drop dlt's staging schemas
ci / python (push) Failing after 36m49s
ci / web (push) Failing after 14m48s
2026-11-26 14:25:54 -06:00
Roberto Treviño d9f7d22029 Phase 4 part 2: TEA catalog, pipeline, gold and indicators, files kept by hash, EEG tables, status-at-period-end measures, ADOS-2 scoring
ci / python (push) Successful in 41m39s
ci / web (push) Successful in 10m36s
2026-11-26 07:06:53 -06:00
Roberto Treviño 266d0f876e Phase 4 part 1: domains as packages, CaMa measures and follow-up from gold, shared survival cohorts, references recaptured (CaMa, CaCu survival, TEA curves, CaMa recurrence) 2026-11-25 23:20:53 -06:00
Roberto Treviño 5d88098cea Names keep accents and ñ in silver; synthetic registry names written with them
ci / python (push) Successful in 28m32s
ci / web (push) Successful in 6m35s
2026-11-25 17:39:32 -06:00
Roberto Treviño 6de1175a7d Phase 3.5: catalog in Core, long silver with generated views, ConceptMaps, FHIR door, stable person ids; Synthea in tests
ci / python (push) Successful in 28m51s
ci / web (push) Successful in 6m53s
2026-11-25 16:17:24 -06:00
Roberto Treviño df3a819e5a WebApp: page tests serve on IPv4
ci / python (push) Successful in 18m3s
ci / web (push) Successful in 7m56s
2026-11-25 11:06:54 -06:00
Roberto Treviño 1c93ebc0b3 Phase 3: FHIR mappers and conformance in Core, follow-up gold table, HL7 validator in the test image and CI, page tests in the web job
ci / python (push) Successful in 18m16s
ci / web (push) Failing after 8m57s
2026-11-25 10:21:34 -06:00
Roberto Treviño 1d70946400 Phase 2 CaCu: hospital to silver, gold timeline, cohorts and measures, model registry
ci / python (push) Successful in 15m55s
ci / web (push) Failing after 1m14s
2026-11-25 01:16:45 -06:00
Roberto Treviño 1652a83722 CaCu reference recaptured at the last load; CaCu clinical parameters; models submodule 2026-11-25 00:28:43 -06:00
Roberto Treviño 75a5203219 Split patients: every split reaches review, decisions apply on the next run; stable record ids 2026-11-24 22:35:13 -06:00