How nasrullaunais/carelanka works
CareLanka is a hospital operations platform with a staff-facing web UI and an ASP.NET API. Its principal workflows span patient registration and care, emergency call dispatch, equipment and pharmacy operations, and staff scheduling and coverage; authentication and persistence support these domains. The sampled code confirms the ward-coverage request path, patient self-service calls, equipment controller delegation, and emergency UI routing. Other domain areas are represented from the repository tree and source index; their internal links are left unasserted where implementation excerpts were unavailable.
Main entry points: CareLankaDbContext.cs Hospital database · AuthController.cs Authentication endpoints · AuthService.cs Authentication service · WardCoverageService.cs Coverage calculation
Components 29
Staff and patient access
- Web application
web-ui/src/App.tsx - Emergency workspace
web-ui/src/features/emergency/emergency-routes.tsx
Identity and API foundation
- HTTP API
api/Program.cs - Authentication endpoints
api/Controllers/Common/AuthController.cs - Authentication service
api/Services/Common/AuthService.cs - Authorization policies
api/Common/Auth/Policies.cs - API errors
api/Common/Errors/MessageCode.cs - Common API contracts
api/DTOs/Common - Hospital database
api/Data/CareLankaDbContext.cs - Refresh token records
api/Data/Entities/Common/RefreshToken.cs - Authentication contract
api/Services/Common/IAuthService.cs - API exception types
api/Common/Exceptions/ApiException.cs - Principal roles
api/Data/Enums/PrincipalRole.cs
Patient care
- Patient endpoints
api/Controllers/Patient/MeController.cs - Patient services
api/Services/Patient - Patient care contracts
api/DTOs/Patient
Emergency response
- Emergency endpoints
api/Controllers/Emergency - Emergency call workflow
api/Services/Emergency/EmergencyCallService.cs - Dispatch records
api/Data/Entities/Emergency/Dispatch.cs - Proposal worker
api/Agents/Emergency/DispatchProposalWorker.cs - Proposal executor
api/Agents/Emergency/DispatchProposalExecutor.cs
Hospital operations
- Equipment endpoints
api/Controllers/Equipment/EquipmentItemsController.cs - Equipment services
api/Services/Equipment - Staff endpoints
api/Controllers/Staff - Ward coverage endpoint
api/Controllers/Staff/WardCoverageController.cs - Coverage calculation
api/Services/Staff/WardCoverageService.cs - Staffing records
api/Data/Entities/Staff
Other components
- Staff users
- Patients
Connections 24
- Staff users → Web application: use
- Patients → Web application: use
- Web application → Emergency workspace: routes to
web-ui/src/App.tsx - Emergency workspace → Emergency endpoints: uses API
- Staff users → Emergency workspace: manage response
web-ui/src/features/emergency/emergency-routes.tsx - HTTP API → Authorization policies: configures
api/Program.cs - HTTP API → API errors: registers handler
api/Program.cs - Authentication endpoints → Authentication service: calls
api/Controllers/Common/AuthController.cs - Authentication service → Hospital database: reads and writes
api/Services/Common/AuthService.cs - Authentication endpoints → Common API contracts: accepts and returns
api/Controllers/Common/AuthController.cs - Authentication service → Refresh token records: uses records
api/Services/Common/AuthService.cs - Authentication endpoints → Authentication contract: uses contract
api/Controllers/Common/AuthController.cs - Patient endpoints → Patient services: calls
api/Controllers/Patient/MeController.cs - Patient endpoints → Patient care contracts: accepts and returns
api/Controllers/Patient/MeController.cs - Patient services → Hospital database: uses
- Emergency call workflow → Hospital database: uses
api/Services/Emergency/EmergencyCallService.cs - Emergency call workflow → Dispatch records: works with
api/Services/Emergency/EmergencyCallService.cs - Proposal worker → Proposal executor: runs
api/Agents/Emergency/DispatchProposalWorker.cs - Equipment endpoints → Equipment services: calls
api/Controllers/Equipment/EquipmentItemsController.cs - Equipment services → Hospital database: uses
- Staff endpoints → Staffing records: manages
- Ward coverage endpoint → Coverage calculation: calls
api/Controllers/Staff/WardCoverageController.cs - Coverage calculation → Hospital database: queries
api/Services/Staff/WardCoverageService.cs - Coverage calculation → Staffing records: evaluates shifts
api/Services/Staff/WardCoverageService.cs