Files

4.9 KiB

What this repository is for

Simulated data for ISSSTELEON: it generates TEA, CaCu and CaMa histories and writes them into a MySQL that plays the hospital system. Loading the hospital into the platform goes through the platform's own import API (cargar), the way a person connecting the hospital in /conectar would; dev-data never writes the platform's databases. It lives next to the ISSSTELEON tree (in WorkingNarrative) and depends by path on ../ISSSTELEON/Core only, for the hospital tables' schemas; the clinical rules it follows are its own copy, src/dev_data/parametros.toml. Nothing here is real patient data, and nothing here ships to production.

Commands

  • uv sync - install dependencies
  • uv run --python 3.12 pytest - the whole suite (3.12 is what CI runs)
  • uv run --python 3.12 pytest tests/test_azar.py - one test file
  • uv run python -m dev_data poblar tea --referencia 2026-01-01 --hospital <url> - generate and write into the hospital (cacu and cama the same way); --omitir-si-poblado leaves a populated hospital alone. --edf <folder> (or DEV_DATA_EDF) with at least one .edf file in the folder makes the hospital hold only the children built from those files (--n is ignored), each a confirmed autism case whose only EEG carries that file with its header rewritten and its age kept (dev_data.tea.edf_reales, historias.con_edf); README "EEG de archivos EDF de verdad"
  • uv run python -m dev_data cargar cacu --api http://localhost:5050 --hospital <url as the WebApi sees it> - ask the WebApi to import each table of the project from the hospital (POST /imports/commit with a SQL source), and then the document sources the project declares, one POST each; provisional until the platform keeps its connection to the hospital
  • uv run python -m dev_data documentos cacu --referencia 2026-01-01 --salida datos/expedientes - write the records of the same histories as PDFs: clean, scanned-looking and the ground truth of every field (--n histories, 20 by default; datos/ is ignored by git). Only projects that declare Proyecto.documentos have them: cacu (scanned records) and tea (the ADOS-2 score summary of the psychological evaluation, text PDFs that are not scanned; poblar tea also stores each one in its ADOS-2 order, ordenes_estudio.ord_pdf_blob, and a short synthetic EDF in every EEG, eeg.eeg_estudio)
  • montura/cargar.sh <api url> [host:port] - load the three projects into an empty platform from the dev-data image; addresses as a container sees them
  • montura/poblar.sh - MySQL as the hospital on the server's port 9505 (all interfaces; HOSPITAL_DIRECCION=127.0.0.1 for local only) with the generated data. docker compose --profile hospital -f compose.prueba.yml down -v removes it and its data. Never touch other compose projects on the server
  • .gitea/workflows/hospital.yml updates the standing hospital (dev-data-prueba) and leaves it up. Manual
  • HOSPITAL_URL=mysql+pymysql://hospital:hospital@127.0.0.1:9505/hospital uv run --python 3.12 pytest tests/test_hospital_mysql.py - the hospital against the stack's MySQL (skipped without the variable; it drops the hospital tables)

Layout

  • hospital.py, __main__.py and proyecto.py are generic and never name a project. What belongs to one project lives in its package (dev_data/tea/) and enters through a Proyecto, registered in proyectos.py. A poblar option only one project understands is declared in Proyecto.opciones and reaches its generar as a keyword argument. A new project (cacu, cama) is a new package plus one line there. A project whose documents carry what its rows don't (TEA: the ADOS-2 items exist only in the PDF) declares Proyecto.fuentes_de_documentos and cargar sends them after the tables, one POST /imports/commit per source
  • dev_data/documentos/ is generic too: XML page templates, the PDF renderer, the scan degradation and the ground truth. A project adds its templates and a function from its histories to Expediente (dev_data/cacu/expediente.py) and declares them in Proyecto.documentos. Values the hospital rows carry come from the history, never from a new draw

Rules

  • Dependencies are added in pyproject.toml. Do not add one without asking
  • ../Core, ../Persistance, ../indicadores_kit, ../WebApi and ../WebApp are read-only from here
  • No date.today(), no unseeded randomness: every generator takes an Azar (seed and reference date)
  • No push without the user's go-ahead

Documents

  • _docs/process.md - how work is organized
  • _docs/tareas.md - the tasks, with their state
  • _docs/hallazgos.md - what went wrong or surprised, I-D<n>
  • _docs/supuestos.md - what was decided without asking, S-D<n>
  • _docs/grooming.md - proposals that came up inside a task and are not solved in it, G-D<n>
  • Before writing tests, read _docs/testing-guidelines.md