How m-fo2sh-f/clinic_erp_server_side works
This is a multi-tenant clinic-management API with clinic-branch operations and a separate platform-admin surface. The central clinic workflow covers patient records, appointments, live queue, clinical encounters, and billing/payment. The tree and source index support those domain stages and several service relationships; unsampled controllers and route wiring are represented conservatively. The README describes Laravel generally, not this product’s capabilities.
Main entry points: BillingService.php Billing service · Clinic Clinic endpoints · LiveQueueService.php Live queue service · EncounterService.php Encounter service
Components 27
Clinic API
- Clinic endpoints
app/Http/Controllers/Api/V1/Clinic - Patient API
app/Http/Controllers/Api/V1/Clinic/PatientController.php - Billing API
app/Http/Controllers/Api/V1/Clinic/BillingController.php
Clinic Operations
- Patient service
app/Services/Clinic/PatientService.php - Appointment service
app/Services/Clinic/AppointmentService.php - Live queue service
app/Services/Clinic/LiveQueueService.php - Encounter service
app/Services/Clinic/EncounterService.php - Billing service
app/Services/Clinic/BillingService.php - Patient records
app/Models/Patient.php - Appointment records
app/Models/Appointment.php - Queue records
app/Models/LiveQueue.php - Encounter records
app/Models/Encounter.php - Invoice records
app/Models/Invoice.php - Service catalog
app/Models/Service.php - Branch pricing
app/Models/BranchService.php
Platform Admin
- Tenant API
app/Http/Controllers/Api/V1/Platform/PlatformTenantController.php - Branch admin API
app/Http/Controllers/Api/V1/Platform/PlatformTenantBranchController.php - Staff admin API
app/Http/Controllers/Api/V1/Platform/PlatformTenantStaffController.php - Tenant service
app/Services/Platform/PlatformTenantService.php - Branch service
app/Services/Platform/PlatformTenantBranchService.php - Staff service
app/Services/Platform/PlatformTenantStaffService.php
Tenant Access
- Tenant access
app/Http/Middleware/EnsureUserBelongsToTenant.php - Branch context
app/Http/Middleware/SetBranchContext.php - User records
app/Models/User.php - Branch records
app/Models/Branch.php
Other components
- Clinic staff
- Platform administrator
Connections 26
- Clinic staff → Clinic endpoints: uses
- Clinic endpoints → Patient API: routes to
- Clinic endpoints → Billing API: routes to
- Patient API → Patient service: delegates to
app/Http/Controllers/Api/V1/Clinic/PatientController.php - Patient service → Patient records: reads/writes
app/Services/Clinic/PatientService.php - Appointment service → Appointment records: uses
- Live queue service → Queue records: uses
app/Services/Clinic/LiveQueueService.php - Live queue service → Patient service: delegates to
app/Services/Clinic/LiveQueueService.php - Live queue service → Billing service: delegates to
app/Services/Clinic/LiveQueueService.php - Live queue service → Encounter service: delegates to
app/Services/Clinic/LiveQueueService.php - Encounter service → Encounter records: uses
app/Services/Clinic/EncounterService.php - Encounter service → Billing service: delegates to
app/Services/Clinic/EncounterService.php - Billing API → Billing service: delegates to
app/Http/Controllers/Api/V1/Clinic/BillingController.php - Billing service → Invoice records: creates/updates
app/Services/Clinic/BillingService.php - Billing service → Service catalog: reads
app/Services/Clinic/BillingService.php - Billing service → Branch pricing: reads
app/Services/Clinic/BillingService.php - Platform administrator → Tenant API: uses
- Platform administrator → Branch admin API: uses
- Tenant API → Tenant service: delegates to
app/Http/Controllers/Api/V1/Platform/PlatformTenantController.php - Branch admin API → Branch service: delegates to
app/Http/Controllers/Api/V1/Platform/PlatformTenantBranchController.php - Staff admin API → Staff service: delegates to
- Tenant service → User records: uses
app/Services/Platform/PlatformTenantService.php - Tenant service → Branch records: uses
app/Services/Platform/PlatformTenantService.php - Staff service → User records: uses
app/Services/Platform/PlatformTenantStaffService.php - Tenant access → Clinic endpoints: guards
- Branch context → Clinic endpoints: sets context