How johnnyalex77/proyectotbc works
Purpose and Runtime
This is a server-rendered Django system for tuberculosis (TBC) clinical operations: patient records, contacts, examinations, prevention, treatments, laboratory workflows, user roles, and operational/clinical indicators. It runs through Django’s WSGI/ASGI entry points: manage.py, sistemaTBC_demo/wsgi.py, and sistemaTBC_demo/asgi.py.
Project Composition and Routing
The project package owns settings, global routes, shared layouts, and static UI assets. Requests enter the project URL dispatcher and are delegated to domain app URL modules; views render HTML templates or perform form-backed mutations.
• sistemaTBC_demo/settings.py
• sistemaTBC_demo/urls.py
• sistemaTBC_demo/templates/base.html
Identity, Roles, and Dashboards
usuarios provides account/profile management, password changes, registration, and role-specific dashboards (administrator, physician, nurse, paramedic, technologist). This is the likely authorization boundary for access to clinical workflows, implemented around Django’s user/auth model plus local extensions.
• apps/usuarios/models.py
• apps/usuarios/views.py
• apps/usuarios/templates/usuarios/dashboard_admin.html
Patient and Contact Registry
pacientes is the core clinical subject registry, offering create/edit/detail/list/search flows. contactos manages associated contact records with equivalent CRUD/search screens. These app models form the central data boundary referenced by downstream clinical modules.
• apps/pacientes/models.py
• apps/pacientes/views.py
• apps/contactos/models.py
Clinical Care Lifecycle
Three domain apps capture patient-directed care events: examinations, preventive interventions, and treatment administration. Form/view/model layers handle lifecycle CRUD, while templates expose details, pending doses, calendars, follow-up, vaccination, and chemoprophylaxis workflows.
• apps/examenes/models.py
• apps/prevencion/models.py
• apps/tratamientos/models.py
Laboratory Operations
laboratorio manages laboratory records, quality control, indicator records, card/index (“tarjetero”) workflows, reporting, and a laboratory dashboard. Its signals indicate model changes can trigger cross-component updates, likely including indicator refreshes.
• apps/laboratorio/models.py
• apps/laboratorio/signals.py
• apps/laboratorio/views.py
Indicators, Alerts, and Reporting
indicadores is the analytical layer over operational data. Its services and signals separate computation/update behavior from request views; dashboard, cohort, prevention, operational, managerial-report, and alert pages present derived results.
• apps/indicadores/services.py
• apps/indicadores/signals.py
• apps/indicadores/views.py
Persistence, Administration, and Data Loading
Each domain app owns Django models and initial migrations, implying a shared Django relational database configured in project settings. Django admin modules expose operational administration. SQL and import scripts support schema/data setup and indicator loading outside request handling; group/user provisioning scripts establish access-control data.
• sistemaTBC_demo/settings.py
• Script_ModeloDatos.sql
• Load_indicadores_data.py
Main entry points: models.py Patient registry · services.py Indicator computation · urls.py Global URL dispatcher · views.py Account dashboards
Components 22
Django Runtime
- WSGI / ASGI entry points · Serves synchronous and asynchronous Django requests.
sistemaTBC_demo/wsgi.py - Management CLI
manage.py - Project settings · Configures the shared relational database and installed applications.
sistemaTBC_demo/settings.py - Global URL dispatcher · Delegates requests to domain application routes.
sistemaTBC_demo/urls.py - Shared base layout
sistemaTBC_demo/templates/base.html - Shared clinical database · Stores domain models, users, and derived operational records.
- Schema setup SQL
Script_ModeloDatos.sql
Identity & Access
- Users and roles · Extends Django identity with local profiles and roles.
apps/usuarios/models.py - Account dashboards · Provides account flows and role-specific dashboards.
apps/usuarios/views.py - Administrator dashboard
apps/usuarios/templates/usuarios/dashboard_admin.html
Clinical Registry
- Patient registry · Central clinical subject records with CRUD and search.
apps/pacientes/models.py - Patient workflows
apps/pacientes/views.py - Contact registry · Stores patient-associated contact records.
apps/contactos/models.py
Care & Laboratory
- Examinations · Captures patient examination events.
apps/examenes/models.py - Prevention · Captures vaccination and chemoprophylaxis interventions.
apps/prevencion/models.py - Treatment administration · Captures treatment lifecycle, doses, and follow-up.
apps/tratamientos/models.py - Laboratory operations · Manages laboratory records, quality control, reporting, and tarjetero workflows.
apps/laboratorio/models.py - Laboratory change signals · Triggers cross-component updates when laboratory models change.
apps/laboratorio/signals.py
Indicators & Reporting
- Indicator computation · Computes and refreshes derived clinical and operational indicators.
apps/indicadores/services.py - Indicator update signals
apps/indicadores/signals.py - Indicators and alerts · Presents dashboards, cohorts, reports, and alerts.
apps/indicadores/views.py - Indicator data loader · Loads indicator data outside request handling.
Load_indicadores_data.py
Connections 29
- WSGI / ASGI entry points → Project settings: loads
- Management CLI → Project settings: uses
- Project settings → Shared clinical database: configures
- WSGI / ASGI entry points → Global URL dispatcher: dispatches requests
- Global URL dispatcher → Account dashboards: routes account flows
- Global URL dispatcher → Patient workflows: routes registry flows
- Global URL dispatcher → Indicators and alerts: routes analytics pages
- Account dashboards → Users and roles: authenticates and manages
- Account dashboards → Administrator dashboard: renders
- Users and roles → Shared clinical database: persists
- Patient workflows → Patient registry: manages
- Patient registry → Contact registry: associates
- Patient registry → Examinations: subject of
- Patient registry → Prevention: subject of
- Patient registry → Treatment administration: subject of
- Patient registry → Laboratory operations: subject of
- Patient registry → Shared clinical database: persists
- Contact registry → Shared clinical database: persists
- Examinations → Shared clinical database: persists
- Prevention → Shared clinical database: persists
- Treatment administration → Shared clinical database: persists
- Laboratory operations → Shared clinical database: persists
- Laboratory change signals → Indicator computation: triggers refresh
- Indicator update signals → Indicator computation: updates
- Indicator computation → Shared clinical database: reads and writes derived data
- Indicators and alerts → Indicator computation: presents results
- Indicator data loader → Indicator computation: loads data for
- Schema setup SQL → Shared clinical database: initializes
- Shared base layout → Account dashboards: shared by