4.9 KiB
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 dependenciesuv 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 fileuv run python -m dev_data poblar tea --referencia 2026-01-01 --hospital <url>- generate and write into the hospital (cacuandcamathe same way);--omitir-si-pobladoleaves a populated hospital alone.--edf <folder>(orDEV_DATA_EDF) with at least one.edffile in the folder makes the hospital hold only the children built from those files (--nis 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/commitwith a SQL source), and then the document sources the project declares, one POST each; provisional until the platform keeps its connection to the hospitaluv 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 (--nhistories, 20 by default;datos/is ignored by git). Only projects that declareProyecto.documentoshave them:cacu(scanned records) andtea(the ADOS-2 score summary of the psychological evaluation, text PDFs that are not scanned;poblar teaalso 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 themmontura/poblar.sh- MySQL as the hospital on the server's port 9505 (all interfaces;HOSPITAL_DIRECCION=127.0.0.1for local only) with the generated data.docker compose --profile hospital -f compose.prueba.yml down -vremoves it and its data. Never touch other compose projects on the server.gitea/workflows/hospital.ymlupdates the standing hospital (dev-data-prueba) and leaves it up. ManualHOSPITAL_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__.pyandproyecto.pyare generic and never name a project. What belongs to one project lives in its package (dev_data/tea/) and enters through aProyecto, registered inproyectos.py. Apoblaroption only one project understands is declared inProyecto.opcionesand reaches itsgeneraras 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) declaresProyecto.fuentes_de_documentosandcargarsends them after the tables, onePOST /imports/commitper sourcedev_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 toExpediente(dev_data/cacu/expediente.py) and declares them inProyecto.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,../WebApiand../WebAppare read-only from here- No
date.today(), no unseeded randomness: every generator takes anAzar(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