# mario-mancia/healthware-app architecture

> Architecture diagram of the GitHub repository mario-mancia/healthware-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mario-mancia/healthware-app
- Repository: https://github.com/mario-mancia/healthware-app

## Overview

This is a Laravel clinic-management application. Staff use routed web screens to manage patients, appointments, clinical records, admissions, referrals, billing, and administration; role and patient-access checks constrain clinical workflows. The graph preserves the central domain models and sampled service/event paths. The README is Laravel’s generic framework README, so product capabilities are inferred from the repository tree and source index; unsampled connections are omitted rather than assumed.

Main entry points: [`app/Services/IngresoService.php`](https://github.com/mario-mancia/healthware-app/blob/main/app/Services/IngresoService.php) (Admission lifecycle), [`app/Http/Controllers/PacienteController.php`](https://github.com/mario-mancia/healthware-app/blob/main/app/Http/Controllers/PacienteController.php) (Patient endpoints), [`app/Http/Controllers/Controller.php`](https://github.com/mario-mancia/healthware-app/blob/main/app/Http/Controllers/Controller.php) (Controller access rules), [`routes/web.php`](https://github.com/mario-mancia/healthware-app/blob/main/routes/web.php) (Web routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web access"]
  node_routes["Web routes<br/>[web.php]"]
  node_base_controller["Controller access rules<br/>[Controller.php]"]
end

subgraph group_care["Clinical care"]
  node_patient_controller["Patient endpoints"]
  node_patient[("Patient record<br/>[Paciente.php]")]
  node_appointment[("Appointments<br/>[Cita.php]")]
  node_doctor[("Doctor records<br/>[Doctor.php]")]
  node_clinical_record[("Clinical record<br/>[RegistroMedico.php]")]
  node_referral_service["Referral workflow"]
end

subgraph group_operations["Clinic operations"]
  node_admission_controller["Admission endpoints"]
  node_admission_service["Admission lifecycle<br/>[IngresoService.php]"]
  node_admission[("Hospital admissions<br/>[Ingreso.php]")]
  node_order[("Orders and charges<br/>[Orden.php]")]
  node_notifications_provider["Clinical event wiring"]
  node_admission_events["Admission events"]
  node_admission_listener["Admission notifications"]
  node_notification_tools["Notification services"]
end

subgraph group_governance["Access and oversight"]
  node_user_controller["User administration"]
  node_care_access["Care relationship service"]
  node_care_relationship[("Care relationships")]
  node_audit[("Clinical audit trail")]
  node_user[("User accounts<br/>[Usuario.php]")]
  node_account_email["Account email<br/>[CorreosService.php]"]
end

node_staff(("Clinic staff"))

node_staff -->|"uses"| node_routes
node_routes -->|"routes to"| node_patient_controller
node_routes -->|"routes to"| node_admission_controller
node_routes -->|"routes to"| node_user_controller
node_patient_controller -->|"inherits access"| node_base_controller
node_admission_controller -.->|"inherits access"| node_base_controller
node_user_controller -->|"inherits access"| node_base_controller
node_patient_controller -->|"reads and updates"| node_patient
node_patient_controller -->|"queries appointments"| node_appointment
node_patient_controller -->|"queries records"| node_clinical_record
node_base_controller -->|"checks patient access"| node_patient
node_base_controller -->|"loads doctor"| node_doctor
node_admission_controller -->|"delegates lifecycle"| node_admission_service
node_admission_service -->|"creates and updates"| node_admission
node_admission_service -->|"uses patient"| node_patient
node_admission_service -->|"creates discharge order"| node_order
node_admission_service -->|"dispatches events"| node_admission_events
node_admission_events -->|"handled by"| node_admission_listener
node_admission_listener -->|"uses notifications"| node_notification_tools
node_admission_listener -->|"sends email"| node_account_email
node_admission_service -->|"records actions"| node_audit
node_admission_service -->|"uses access service"| node_care_access
node_care_access -->|"updates relationship"| node_care_relationship
node_care_access -->|"records access changes"| node_audit
node_referral_service -->|"schedules or cancels"| node_appointment
node_referral_service -->|"uses access service"| node_care_access
node_user_controller -->|"sends credentials"| node_account_email
node_notifications_provider -->|"registers event handling"| node_user

click node_routes "https://github.com/mario-mancia/healthware-app/blob/main/routes/web.php"
click node_base_controller "https://github.com/mario-mancia/healthware-app/blob/main/app/Http/Controllers/Controller.php"
click node_patient_controller "https://github.com/mario-mancia/healthware-app/blob/main/app/Http/Controllers/PacienteController.php"
click node_admission_controller "https://github.com/mario-mancia/healthware-app/blob/main/app/Http/Controllers/IngresoController.php"
click node_user_controller "https://github.com/mario-mancia/healthware-app/blob/main/app/Http/Controllers/UsuarioController.php"
click node_patient "https://github.com/mario-mancia/healthware-app/blob/main/app/Models/Paciente.php"
click node_appointment "https://github.com/mario-mancia/healthware-app/blob/main/app/Models/Cita.php"
click node_doctor "https://github.com/mario-mancia/healthware-app/blob/main/app/Models/Doctor.php"
click node_clinical_record "https://github.com/mario-mancia/healthware-app/blob/main/app/Models/RegistroMedico.php"
click node_admission_service "https://github.com/mario-mancia/healthware-app/blob/main/app/Services/IngresoService.php"
click node_admission "https://github.com/mario-mancia/healthware-app/blob/main/app/Models/Ingreso.php"
click node_care_access "https://github.com/mario-mancia/healthware-app/blob/main/app/Services/AccesoAsistencialService.php"
click node_care_relationship "https://github.com/mario-mancia/healthware-app/blob/main/app/Models/RelacionAsistencial.php"
click node_audit "https://github.com/mario-mancia/healthware-app/blob/main/app/Models/AuditoriaExpediente.php"
click node_user "https://github.com/mario-mancia/healthware-app/blob/main/app/Models/Usuario.php"
click node_order "https://github.com/mario-mancia/healthware-app/blob/main/app/Models/Orden.php"
click node_referral_service "https://github.com/mario-mancia/healthware-app/blob/main/app/Services/ReferenciaMedicaService.php"
click node_notifications_provider "https://github.com/mario-mancia/healthware-app/blob/main/app/Providers/NotificacionesClinicasServiceProvider.php"
click node_admission_events "https://github.com/mario-mancia/healthware-app/blob/main/app/Events/AltaHospitalariaRegistrada.php"
click node_admission_listener "https://github.com/mario-mancia/healthware-app/blob/main/app/Listeners/NotificarIngresoHospitalario.php"
click node_notification_tools "https://github.com/mario-mancia/healthware-app/blob/main/app/Services/AyudaNotificaciones.php"
click node_account_email "https://github.com/mario-mancia/healthware-app/blob/main/app/Services/CorreosService.php"

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_routes,node_base_controller toneBlue
class node_patient_controller,node_patient,node_appointment,node_doctor,node_clinical_record,node_referral_service toneAmber
class node_admission_controller,node_admission_service,node_admission,node_order,node_notifications_provider,node_admission_events,node_admission_listener,node_notification_tools toneMint
class node_user_controller,node_care_access,node_care_relationship,node_audit,node_user,node_account_email toneRose
class node_staff toneIndigo
```

## Components

### Web access

- [Web routes](https://github.com/mario-mancia/healthware-app/blob/main/routes/web.php): `routes/web.php`
- [Controller access rules](https://github.com/mario-mancia/healthware-app/blob/main/app/Http/Controllers/Controller.php): `app/Http/Controllers/Controller.php`

### Clinical care

- [Patient endpoints](https://github.com/mario-mancia/healthware-app/blob/main/app/Http/Controllers/PacienteController.php): `app/Http/Controllers/PacienteController.php`
- [Patient record](https://github.com/mario-mancia/healthware-app/blob/main/app/Models/Paciente.php): `app/Models/Paciente.php`
- [Appointments](https://github.com/mario-mancia/healthware-app/blob/main/app/Models/Cita.php): `app/Models/Cita.php`
- [Doctor records](https://github.com/mario-mancia/healthware-app/blob/main/app/Models/Doctor.php): `app/Models/Doctor.php`
- [Clinical record](https://github.com/mario-mancia/healthware-app/blob/main/app/Models/RegistroMedico.php): `app/Models/RegistroMedico.php`
- [Referral workflow](https://github.com/mario-mancia/healthware-app/blob/main/app/Services/ReferenciaMedicaService.php): `app/Services/ReferenciaMedicaService.php`

### Clinic operations

- [Admission endpoints](https://github.com/mario-mancia/healthware-app/blob/main/app/Http/Controllers/IngresoController.php): `app/Http/Controllers/IngresoController.php`
- [Admission lifecycle](https://github.com/mario-mancia/healthware-app/blob/main/app/Services/IngresoService.php): `app/Services/IngresoService.php`
- [Hospital admissions](https://github.com/mario-mancia/healthware-app/blob/main/app/Models/Ingreso.php): `app/Models/Ingreso.php`
- [Orders and charges](https://github.com/mario-mancia/healthware-app/blob/main/app/Models/Orden.php): `app/Models/Orden.php`
- [Clinical event wiring](https://github.com/mario-mancia/healthware-app/blob/main/app/Providers/NotificacionesClinicasServiceProvider.php): `app/Providers/NotificacionesClinicasServiceProvider.php`
- [Admission events](https://github.com/mario-mancia/healthware-app/blob/main/app/Events/AltaHospitalariaRegistrada.php): `app/Events/AltaHospitalariaRegistrada.php`
- [Admission notifications](https://github.com/mario-mancia/healthware-app/blob/main/app/Listeners/NotificarIngresoHospitalario.php): `app/Listeners/NotificarIngresoHospitalario.php`
- [Notification services](https://github.com/mario-mancia/healthware-app/blob/main/app/Services/AyudaNotificaciones.php): `app/Services/AyudaNotificaciones.php`

### Access and oversight

- [User administration](https://github.com/mario-mancia/healthware-app/blob/main/app/Http/Controllers/UsuarioController.php): `app/Http/Controllers/UsuarioController.php`
- [Care relationship service](https://github.com/mario-mancia/healthware-app/blob/main/app/Services/AccesoAsistencialService.php): `app/Services/AccesoAsistencialService.php`
- [Care relationships](https://github.com/mario-mancia/healthware-app/blob/main/app/Models/RelacionAsistencial.php): `app/Models/RelacionAsistencial.php`
- [Clinical audit trail](https://github.com/mario-mancia/healthware-app/blob/main/app/Models/AuditoriaExpediente.php): `app/Models/AuditoriaExpediente.php`
- [User accounts](https://github.com/mario-mancia/healthware-app/blob/main/app/Models/Usuario.php): `app/Models/Usuario.php`
- [Account email](https://github.com/mario-mancia/healthware-app/blob/main/app/Services/CorreosService.php): `app/Services/CorreosService.php`

### Other components

- **Clinic staff**

## Connections

- Clinic staff → Web routes: uses (evidence: `routes/web.php`)
- Web routes → Patient endpoints: routes to (evidence: `routes/web.php`)
- Web routes → Admission endpoints: routes to (evidence: `routes/web.php`)
- Web routes → User administration: routes to (evidence: `routes/web.php`)
- Patient endpoints → Controller access rules: inherits access (evidence: `app/Http/Controllers/PacienteController.php`)
- Admission endpoints → Controller access rules: inherits access (evidence: `app/Http/Controllers/IngresoController.php`)
- User administration → Controller access rules: inherits access (evidence: `app/Http/Controllers/UsuarioController.php`)
- Patient endpoints → Patient record: reads and updates (evidence: `app/Http/Controllers/PacienteController.php`)
- Patient endpoints → Appointments: queries appointments (evidence: `app/Http/Controllers/PacienteController.php`)
- Patient endpoints → Clinical record: queries records (evidence: `app/Http/Controllers/PacienteController.php`)
- Controller access rules → Patient record: checks patient access (evidence: `app/Http/Controllers/Controller.php`)
- Controller access rules → Doctor records: loads doctor (evidence: `app/Http/Controllers/Controller.php`)
- Admission endpoints → Admission lifecycle: delegates lifecycle (evidence: `app/Http/Controllers/IngresoController.php`)
- Admission lifecycle → Hospital admissions: creates and updates (evidence: `app/Services/IngresoService.php`)
- Admission lifecycle → Patient record: uses patient (evidence: `app/Services/IngresoService.php`)
- Admission lifecycle → Orders and charges: creates discharge order (evidence: `app/Services/IngresoService.php`)
- Admission lifecycle → Admission events: dispatches events (evidence: `app/Services/IngresoService.php`)
- Admission events → Admission notifications: handled by (evidence: `app/Listeners/NotificarIngresoHospitalario.php`)
- Admission notifications → Notification services: uses notifications (evidence: `app/Listeners/NotificarIngresoHospitalario.php`)
- Admission notifications → Account email: sends email (evidence: `app/Listeners/NotificarIngresoHospitalario.php`)
- Admission lifecycle → Clinical audit trail: records actions (evidence: `app/Services/IngresoService.php`)
- Admission lifecycle → Care relationship service: uses access service (evidence: `app/Services/IngresoService.php`)
- Care relationship service → Care relationships: updates relationship (evidence: `app/Services/AccesoAsistencialService.php`)
- Care relationship service → Clinical audit trail: records access changes (evidence: `app/Services/AccesoAsistencialService.php`)
- Referral workflow → Appointments: schedules or cancels (evidence: `app/Services/ReferenciaMedicaService.php`)
- Referral workflow → Care relationship service: uses access service (evidence: `app/Services/ReferenciaMedicaService.php`)
- User administration → Account email: sends credentials (evidence: `app/Http/Controllers/UsuarioController.php`)
- Clinical event wiring → User accounts: registers event handling (evidence: `app/Providers/NotificacionesClinicasServiceProvider.php`)
