Commit Graph

30 Commits

Author SHA1 Message Date
alberto 1af7c2c609 TEA per-child FHIR resources: ADOS-2, EEG report, checks, metrics, Condition, RiskAssessment
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.
2026-11-30 01:14:21 -06:00
alberto 3d1d9c6047 Merge P4.3 into P4.1 for one combined gate 2026-11-29 19:46:08 -06:00
alberto b44a898bcc Governance REST: version checks, retire, lineage, training inputs; TEA curve, preview, EEG summary
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.
2026-11-29 19:45:51 -06:00
alberto 67524afd4c TEA follow-up: Patient search with TEA filters and $eeg-summary
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.
2026-11-29 19:42:17 -06:00
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 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 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 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 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 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 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 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
Roberto Treviño d123f0105b Step 5: conectar API, masked secrets, review reads; every port on BIND_ADDRESS 2026-11-24 21:00:52 -06:00
Roberto Treviño 91b681c6f8 Silver from the graph: targets stage, dbt places, reviewers reject; pdfplumber layout text, deskewed OCR 2026-11-24 20:05:29 -06:00
Roberto Treviño 8a84cf48af Ingestion as a node graph DSL: typed nodes and edges, one output table per node 2026-11-24 18:20:28 -06:00
Roberto Treviño be66aa7fb2 Ingestion stages 1-2: dlt sources by import path, MarkItDown and OCRmyPDF, test image 2026-11-24 17:48:19 -06:00
Roberto Treviño 4724b156b1 Core: platform schema and runtime ingestion config 2026-11-24 17:04:26 -06:00
rockdrigo 0a0c467db8 Rebuild phase 0: uv workspace, layering contracts, CI, compose, synthetic hospital
ci / python (push) Failing after 4s
ci / postgres (push) Failing after 5s
ci / web (push) Failing after 3s
Orphan branch: nothing from the current platform is carried over.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 11:18:18 -06:00