# martinezaus/clinicaplus architecture

> Architecture diagram of the GitHub repository martinezaus/clinicaplus, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/martinezaus/clinicaplus
- Repository: https://github.com/martinezaus/clinicaplus

## Overview

This is a Django clinic-management application: staff manage organization-scoped patient records, physical charts and loans, and admission wristbands. The archive workflow is patient lookup or registration, physical-file intake and location tracking, then lending, return, or transfer to passive storage. Organization membership gates module access. The supplied excerpts support archive and access-control calls; bracelet dispatch details and URL routing were not sampled, so those links are left unverified rather than inferred.

Main entry points: [`archivo/views.py`](https://github.com/martinezaus/clinicaplus/blob/main/archivo/views.py) (Archive workflows), [`pacientes/views.py`](https://github.com/martinezaus/clinicaplus/blob/main/pacientes/views.py) (Patient workflows), [`pulseras/views.py`](https://github.com/martinezaus/clinicaplus/blob/main/pulseras/views.py) (Wristband workflow), [`organizaciones/access.py`](https://github.com/martinezaus/clinicaplus/blob/main/organizaciones/access.py) (Module access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_org["Organization access"]
  node_org_views["Organization workflows<br/>[views.py]"]
  node_org_forms["Organization forms<br/>[forms.py]"]
  node_org_models[("Organizations &amp; membership<br/>[models.py]")]
  node_org_access["Module access<br/>[access.py]"]
end

subgraph group_patients["Patient records"]
  node_patient_views["Patient workflows<br/>[views.py]"]
  node_patient_forms["Patient forms<br/>[forms.py]"]
  node_patient_model[("Patient records<br/>[pacientes.py]")]
end

subgraph group_archive["Physical archive"]
  node_archive_views["Archive workflows<br/>[views.py]"]
  node_archive_forms["Archive forms<br/>[forms.py]"]
  node_archive_models[("Files &amp; loans<br/>[models.py]")]
  node_csv_import["CSV history import"]
end

subgraph group_bracelets["Admission wristbands"]
  node_bracelet_views["Wristband workflow<br/>[views.py]"]
  node_bracelet_forms["Wristband forms<br/>[forms.py]"]
  node_bracelet_models[("Printers &amp; jobs<br/>[models.py]")]
  node_printing["Label printing<br/>[printing.py]"]
end

subgraph group_runtime["Application runtime"]
  node_settings["Django configuration<br/>[settings.py]"]
end

node_staff(("Clinic staff"))
node_printer_queue["Windows print queue"]
node_postgres[("PostgreSQL")]

node_staff -.->|"uses archive"| node_archive_views
node_staff -.->|"manages patients"| node_patient_views
node_staff -.->|"requests wristband"| node_bracelet_views
node_org_views -->|"checks access"| node_org_access
node_org_views -->|"uses forms"| node_org_forms
node_org_views -->|"reads and writes"| node_org_models
node_org_access -->|"checks membership"| node_org_models
node_patient_views -->|"requires module"| node_org_access
node_patient_views -->|"validates input"| node_patient_forms
node_patient_views -->|"reads and writes"| node_patient_model
node_archive_views -->|"requires module"| node_org_access
node_archive_views -->|"validates input"| node_archive_forms
node_archive_views -->|"reads and writes"| node_archive_models
node_archive_views -->|"searches patients"| node_patient_model
node_csv_import -->|"selects organization"| node_org_models
node_csv_import -->|"imports patients"| node_patient_model
node_csv_import -->|"imports files"| node_archive_models
node_bracelet_views -.->|"validates input"| node_bracelet_forms
node_bracelet_views -.->|"reads and writes"| node_bracelet_models
node_bracelet_views -.->|"dispatches print"| node_printing
node_printing -.->|"sends labels"| node_printer_queue
node_settings -->|"configures database"| node_postgres

click node_org_views "https://github.com/martinezaus/clinicaplus/blob/main/organizaciones/views.py"
click node_org_forms "https://github.com/martinezaus/clinicaplus/blob/main/organizaciones/forms.py"
click node_org_models "https://github.com/martinezaus/clinicaplus/blob/main/organizaciones/models.py"
click node_org_access "https://github.com/martinezaus/clinicaplus/blob/main/organizaciones/access.py"
click node_patient_views "https://github.com/martinezaus/clinicaplus/blob/main/pacientes/views.py"
click node_patient_forms "https://github.com/martinezaus/clinicaplus/blob/main/pacientes/forms.py"
click node_patient_model "https://github.com/martinezaus/clinicaplus/blob/main/pacientes/models/pacientes.py"
click node_archive_views "https://github.com/martinezaus/clinicaplus/blob/main/archivo/views.py"
click node_archive_forms "https://github.com/martinezaus/clinicaplus/blob/main/archivo/forms.py"
click node_archive_models "https://github.com/martinezaus/clinicaplus/blob/main/archivo/models.py"
click node_csv_import "https://github.com/martinezaus/clinicaplus/blob/main/pacientes/management/commands/importar_historias_csv.py"
click node_bracelet_views "https://github.com/martinezaus/clinicaplus/blob/main/pulseras/views.py"
click node_bracelet_forms "https://github.com/martinezaus/clinicaplus/blob/main/pulseras/forms.py"
click node_bracelet_models "https://github.com/martinezaus/clinicaplus/blob/main/pulseras/models.py"
click node_printing "https://github.com/martinezaus/clinicaplus/blob/main/pulseras/printing.py"
click node_settings "https://github.com/martinezaus/clinicaplus/blob/main/config/settings.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_org_views,node_org_forms,node_org_models,node_org_access toneBlue
class node_patient_views,node_patient_forms,node_patient_model,node_postgres toneAmber
class node_archive_views,node_archive_forms,node_archive_models,node_csv_import toneMint
class node_bracelet_views,node_bracelet_forms,node_bracelet_models,node_printing,node_printer_queue toneRose
class node_settings,node_staff toneIndigo
```

## Components

### Organization access

- [Organization workflows](https://github.com/martinezaus/clinicaplus/blob/main/organizaciones/views.py): `organizaciones/views.py`
- [Organization forms](https://github.com/martinezaus/clinicaplus/blob/main/organizaciones/forms.py): `organizaciones/forms.py`
- [Organizations & membership](https://github.com/martinezaus/clinicaplus/blob/main/organizaciones/models.py): `organizaciones/models.py`
- [Module access](https://github.com/martinezaus/clinicaplus/blob/main/organizaciones/access.py): `organizaciones/access.py`

### Patient records

- [Patient workflows](https://github.com/martinezaus/clinicaplus/blob/main/pacientes/views.py): `pacientes/views.py`
- [Patient forms](https://github.com/martinezaus/clinicaplus/blob/main/pacientes/forms.py): `pacientes/forms.py`
- [Patient records](https://github.com/martinezaus/clinicaplus/blob/main/pacientes/models/pacientes.py): `pacientes/models/pacientes.py`

### Physical archive

- [Archive workflows](https://github.com/martinezaus/clinicaplus/blob/main/archivo/views.py): `archivo/views.py`
- [Archive forms](https://github.com/martinezaus/clinicaplus/blob/main/archivo/forms.py): `archivo/forms.py`
- [Files & loans](https://github.com/martinezaus/clinicaplus/blob/main/archivo/models.py): `archivo/models.py`
- [CSV history import](https://github.com/martinezaus/clinicaplus/blob/main/pacientes/management/commands/importar_historias_csv.py): `pacientes/management/commands/importar_historias_csv.py`

### Admission wristbands

- [Wristband workflow](https://github.com/martinezaus/clinicaplus/blob/main/pulseras/views.py): `pulseras/views.py`
- [Wristband forms](https://github.com/martinezaus/clinicaplus/blob/main/pulseras/forms.py): `pulseras/forms.py`
- [Printers & jobs](https://github.com/martinezaus/clinicaplus/blob/main/pulseras/models.py): `pulseras/models.py`
- [Label printing](https://github.com/martinezaus/clinicaplus/blob/main/pulseras/printing.py): `pulseras/printing.py`

### Application runtime

- [Django configuration](https://github.com/martinezaus/clinicaplus/blob/main/config/settings.py): `config/settings.py`

### Other components

- **Clinic staff**
- **Windows print queue**
- **PostgreSQL**

## Connections

- Clinic staff → Archive workflows: uses archive
- Clinic staff → Patient workflows: manages patients
- Clinic staff → Wristband workflow: requests wristband
- Organization workflows → Module access: checks access (evidence: `organizaciones/views.py`)
- Organization workflows → Organization forms: uses forms (evidence: `organizaciones/views.py`)
- Organization workflows → Organizations & membership: reads and writes (evidence: `organizaciones/views.py`)
- Module access → Organizations & membership: checks membership (evidence: `organizaciones/access.py`)
- Patient workflows → Module access: requires module (evidence: `pacientes/views.py`)
- Patient workflows → Patient forms: validates input (evidence: `pacientes/views.py`)
- Patient workflows → Patient records: reads and writes (evidence: `pacientes/views.py`)
- Archive workflows → Module access: requires module (evidence: `archivo/views.py`)
- Archive workflows → Archive forms: validates input (evidence: `archivo/views.py`)
- Archive workflows → Files & loans: reads and writes (evidence: `archivo/views.py`)
- Archive workflows → Patient records: searches patients (evidence: `archivo/views.py`)
- CSV history import → Organizations & membership: selects organization (evidence: `pacientes/management/commands/importar_historias_csv.py`)
- CSV history import → Patient records: imports patients (evidence: `pacientes/management/commands/importar_historias_csv.py`)
- CSV history import → Files & loans: imports files (evidence: `pacientes/management/commands/importar_historias_csv.py`)
- Wristband workflow → Wristband forms: validates input
- Wristband workflow → Printers & jobs: reads and writes
- Wristband workflow → Label printing: dispatches print
- Label printing → Windows print queue: sends labels
- Django configuration → PostgreSQL: configures database (evidence: `config/settings.py`)
