# dashing-dev/swarnabindu_care architecture

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

- Interactive diagram: https://gitdiagram.com/dashing-dev/swarnabindu_care
- Repository: https://github.com/dashing-dev/swarnabindu_care

## Overview

Swarnabindu is a Django hospital application for managing patient registration, manually scheduled vaccination sessions, vaccination records, and official reports. The main workflow is staff sign-in, patient lookup or registration, selection of a real session, recording vitals and vaccination status, then viewing patient history or session reports. Nepali-calendar conversion and age-at-vaccination calculations support those stages. The graph reflects the README and shown call sites; unsampled implementation details and database wiring are left out or marked unverified.

Main entry points: [`hospital/views.py`](https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/views.py) (Request handlers), [`hospital/models.py`](https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/models.py) (Patient records), [`hospital/management/commands/check_system.py`](https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/management/commands/check_system.py) (System health check), [`hospital/nepali_date.py`](https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/nepali_date.py) (BS date and age)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Hospital workflow"]
  node_views["Request handlers<br/>[views.py]"]
  node_forms["Form validation<br/>[forms.py]"]
  node_duplicate_check["Duplicate detection<br/>[services.py]"]
end

subgraph group_domain["Clinical domain"]
  node_patients["Patient records<br/>[models.py]"]
  node_sessions["Vaccination sessions<br/>[models.py]"]
  node_vaccinations["Vaccination records<br/>[models.py]"]
  node_date_engine["BS date and age<br/>[nepali_date.py]"]
  node_database[("Application database")]
end

subgraph group_oversight["Administration and oversight"]
  node_reporting["Session reporting<br/>[reports.py]"]
  node_access["Role enforcement<br/>[permissions.py]"]
  node_audit["Audit history<br/>[models.py]"]
  node_settings["Hospital settings<br/>[models.py]"]
  node_backup["Database backup<br/>[backup_database.py]"]
  node_health["System health check<br/>[check_system.py]"]
end

subgraph group_interface["Web interface"]
  node_routes["URL routing<br/>[urls.py]"]
  node_templates["Staff screens"]
end

node_staff(("Hospital staff"))

node_staff -.->|"requests pages"| node_routes
node_routes -->|"routes requests"| node_views
node_views -->|"renders screens"| node_templates
node_views -->|"validates input"| node_forms
node_views -->|"queries patients"| node_patients
node_views -->|"queries sessions"| node_sessions
node_views -->|"saves records"| node_vaccinations
node_forms -->|"parses BS dates"| node_date_engine
node_patients -->|"calculates age"| node_date_engine
node_vaccinations -->|"stores age snapshot"| node_date_engine
node_views -->|"checks duplicates"| node_duplicate_check
node_duplicate_check -->|"finds matches"| node_patients
node_views -->|"generates summaries"| node_reporting
node_reporting -->|"filters records"| node_vaccinations
node_views -->|"enforces roles"| node_access
node_views -->|"reads audit history"| node_audit
node_backup -->|"logs backup"| node_audit
node_backup -->|"exports data"| node_database
node_health -->|"counts patients"| node_patients
node_health -->|"counts sessions"| node_sessions
node_health -->|"counts records"| node_vaccinations
node_patients -.->|"persists entities"| node_database
node_sessions -.->|"persists entities"| node_database
node_vaccinations -.->|"persists entities"| node_database

click node_routes "https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/urls.py"
click node_views "https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/views.py"
click node_templates "https://github.com/dashing-dev/swarnabindu_care/tree/main/templates"
click node_forms "https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/forms.py"
click node_patients "https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/models.py"
click node_sessions "https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/models.py"
click node_vaccinations "https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/models.py"
click node_date_engine "https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/nepali_date.py"
click node_duplicate_check "https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/services.py"
click node_reporting "https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/reports.py"
click node_access "https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/permissions.py"
click node_audit "https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/models.py"
click node_settings "https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/models.py"
click node_backup "https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/management/commands/backup_database.py"
click node_health "https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/management/commands/check_system.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_views,node_forms,node_duplicate_check toneBlue
class node_patients,node_sessions,node_vaccinations,node_date_engine,node_database toneAmber
class node_reporting,node_access,node_audit,node_settings,node_backup,node_health toneMint
class node_routes,node_templates toneRose
class node_staff toneIndigo
```

## Components

### Hospital workflow

- [Request handlers](https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/views.py): `hospital/views.py`
- [Form validation](https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/forms.py): `hospital/forms.py`
- [Duplicate detection](https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/services.py): `hospital/services.py`

### Clinical domain

- [Patient records](https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/models.py): `hospital/models.py`
- [Vaccination sessions](https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/models.py): `hospital/models.py`
- [Vaccination records](https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/models.py): `hospital/models.py`
- [BS date and age](https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/nepali_date.py): `hospital/nepali_date.py`
- **Application database**

### Administration and oversight

- [Session reporting](https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/reports.py): `hospital/reports.py`
- [Role enforcement](https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/permissions.py): `hospital/permissions.py`
- [Audit history](https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/models.py): `hospital/models.py`
- [Hospital settings](https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/models.py): `hospital/models.py`
- [Database backup](https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/management/commands/backup_database.py): `hospital/management/commands/backup_database.py`
- [System health check](https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/management/commands/check_system.py): `hospital/management/commands/check_system.py`

### Web interface

- [URL routing](https://github.com/dashing-dev/swarnabindu_care/blob/main/hospital/urls.py): `hospital/urls.py`
- [Staff screens](https://github.com/dashing-dev/swarnabindu_care/tree/main/templates): `templates`

### Other components

- **Hospital staff**

## Connections

- Hospital staff → URL routing: requests pages
- URL routing → Request handlers: routes requests (evidence: `hospital/urls.py`)
- Request handlers → Staff screens: renders screens (evidence: `hospital/views.py`)
- Request handlers → Form validation: validates input (evidence: `hospital/views.py`)
- Request handlers → Patient records: queries patients (evidence: `hospital/views.py`)
- Request handlers → Vaccination sessions: queries sessions (evidence: `hospital/views.py`)
- Request handlers → Vaccination records: saves records (evidence: `hospital/views.py`)
- Form validation → BS date and age: parses BS dates (evidence: `hospital/forms.py`)
- Patient records → BS date and age: calculates age (evidence: `hospital/models.py`)
- Vaccination records → BS date and age: stores age snapshot (evidence: `hospital/models.py`)
- Request handlers → Duplicate detection: checks duplicates (evidence: `hospital/views.py`)
- Duplicate detection → Patient records: finds matches (evidence: `hospital/services.py`)
- Request handlers → Session reporting: generates summaries (evidence: `hospital/views.py`)
- Session reporting → Vaccination records: filters records (evidence: `hospital/reports.py`)
- Request handlers → Role enforcement: enforces roles (evidence: `hospital/views.py`)
- Request handlers → Audit history: reads audit history (evidence: `hospital/views.py`)
- Database backup → Audit history: logs backup (evidence: `hospital/management/commands/backup_database.py`)
- Database backup → Application database: exports data (evidence: `hospital/management/commands/backup_database.py`)
- System health check → Patient records: counts patients (evidence: `hospital/management/commands/check_system.py`)
- System health check → Vaccination sessions: counts sessions (evidence: `hospital/management/commands/check_system.py`)
- System health check → Vaccination records: counts records (evidence: `hospital/management/commands/check_system.py`)
- Patient records → Application database: persists entities
- Vaccination sessions → Application database: persists entities
- Vaccination records → Application database: persists entities
