Overview
The Facilities Module is a comprehensive facility management system designed for healthcare organizations. It provides complete control over organizational structures, buildings, floors, rooms, staff members, departments, and service definitions.
Module Name
Facilities
Module Alias
facilities
Priority Level
115
Namespace
Modules\Facilities
Architecture
The Facilities module follows Clean Architecture principles with clear separation of concerns across multiple layers.
Domain Layer
Contains business entities, repository interfaces, and domain models representing core facilities concepts.
Application Layer
Houses service classes that orchestrate business logic and coordinate between controllers and repositories.
Infrastructure Layer
Implements repository interfaces using Eloquent ORM for data persistence and database operations.
Presentation Layer
HTTP controllers, request validation, API resources, and views for user interaction.
Service Provider Configuration
API Endpoints
All API routes are protected with auth:sanctum,
resolve.location, and
resolve.locale middleware.
Organizations Management
Buildings Management
Floors Management
Rooms Management
Service Definitions
Staff Members
Room Allotments
Departments
Controllers
| Controller | Type | Purpose |
|---|---|---|
| OrganizationController | CRUD API | Manages healthcare organizations and institutions |
| BuildingController | CRUD API | Handles building management within organizations |
| FloorController | CRUD API | Manages floors within buildings |
| RoomController | CRUD API | Controls room creation and management |
| RoomAllotmentController | CRUD API | Manages room assignments and allocations |
| ServiceDefinitionController | CRUD API | Defines available services in facilities |
| StaffMemberController | CRUD API | Manages staff member records |
| DepartmentController | API (Custom) | Department management with statistics and card status |
| OrganizationApiController | API (Custom) | Extended organization endpoints with building details |
| FacilitiesController | Web | Web interface controller for facilities module |
BaseCrudController from HmsCore,
providing standardized REST operations. Custom API controllers add specialized functionality
like statistics, filtering, and complex data retrieval.
Key Features
Multi-Level Hierarchy
Supports organization → building → floor → room structure for complete facility representation.
Department Management
Track departments with active/inactive status and comprehensive statistics.
Room Allotment System
Efficiently allocate and track room assignments across the facility.
Service Definitions
Define and manage services available within the facility infrastructure.
Staff Member Tracking
Maintain comprehensive records of staff members associated with facilities.
Location & Locale Resolution
Automatic location and locale middleware for multi-location healthcare systems.
Authorization & Security
Complete policy-based authorization on all operations with Sanctum authentication.
Statistics & Analytics
Built-in card status and statistics for organizations and departments.
Dependencies & Integration
Service Providers
Core Dependencies
HmsCore Package
Leverages BaseCrudController, CrudServiceInterface, ResolveLocale, and ResolveLocation middleware from the core package.
Core Module
Uses Department entity from Modules\Core for department management functionality.
Laravel Sanctum
All API routes protected with auth:sanctum middleware for secure API access.
Database Seeding
Translations
Translation files are loaded from resources/lang
with the facilities namespace.
Migrations
Database migrations are automatically loaded from
Database/Migrations directory.