Files
rodrigo 0d5a9392bf H-6: poblar el hospital y alimentar las bases, en dos pasos (sin probar en el runner)
Comando poblar y opción --sin-poblar; servicios poblar* bajo el perfil
hospital; hospital.yml y despliegue.yml como paso 1 y paso 2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 07:28:50 +00:00

3.0 KiB

What this repository is for

Simulated data for ISSSTELEON, written through Persistance, so the indicators of indicadores_kit and the routes of WebApi can be tested end to end without real data. It lives at ISSSTELEON/dev-data and depends on ../Core, ../Persistance and ../indicadores_kit by path. 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 tea --referencia 2026-01-01 --base sqlite:////path/tea.db - migrate, seed and calculate a TEA database (cacu and cama work the same way); with --hospital <url> the rows go through a simulated hospital database first
  • uv run python -m dev_data poblar tea --referencia 2026-01-01 --hospital <url> - only generate and write into the hospital; --sin-poblar on the project command then seeds from it without ever writing to it
  • montura/poblar.sh then montura/alimentar.sh - the test stack in two steps: MySQL as the hospital on 127.0.0.1:9505 with the generated data, then the SQLite databases seeded from it, WebApi on 9503 and WebApp on 9504, checked over HTTP. 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/montura.yml runs both steps in the runner and tears everything down; hospital.yml (step 1) and despliegue.yml (step 2) update the standing stack (dev-data-prueba) and leave it up. All three are manual
  • Tests need ../WebApi and ../models present (ISSSTELEON submodules)
  • 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, repositorio.py, ingesta.py, montar.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 new project (cacu, cama) is a new package plus one line there

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