Overview
The Dentist (dentista) role is designed for dental professionals who manage their own clinic within the DentControl SaaS platform. Dentists have full access to their clinic’s patient records, treatments, and clinical data, but are restricted to their assigned clinic only.Dentists are the primary clinical users of the system and have the highest level of access within their assigned clinic.
Key Characteristics
Clinic-Specific Access
Full access to all data within their assigned clinic (id_clinica)
Patient Management
Create, view, edit, and manage patient records and clinical histories
Professional License
Required to have a valid cedula_profesional (7-10 digits)
Clinical Records
Full access to treatment plans, evolution notes, and medical records
Accessible Routes
Dentist routes are protected by thecan:dentista-only middleware, which verifies the user’s role is dentista.
Dashboard
- Today’s appointments (
citasHoy) - Total patients in the clinic (
totalPacientes) - Active treatments (
tratamientosActivos) - System alerts and notifications
app/Http/Controllers/Clinica/DashboardController.php:12
The dashboard displays only data from the dentist’s assigned clinic (filtered by
id_clinica).Patient Management
PacienteController@index
Purpose: View and manage all patients registered in the dentist’s clinic
Data Scope: Filtered by id_clinica to show only the clinic’s patients
Source: routes/web.php:39
Patient Data Model
Patient Data Model
Patients are stored in the
paciente table with the following key fields:Demographics:nombre,apellido_paterno,apellido_maternofecha_nacimiento,sexocurp,telefono,ocupacion
calle,num_ext,num_intcolonia,ciudad,estado,codigo_postal
peso(weight)estatus(active/inactive)id_clinica(clinic association)
app/Models/Paciente.php:16Patient Relationships
Patient Relationships
Each patient can have:
- Appointments (
citas): Multiple appointments scheduled - Clinical Record (
expediente): One clinical file with medical history - Mobile Access (
accesoMovil): Optional patient portal credentials - Clinic (
clinica): Belongs to the dentist’s clinic
app/Models/Paciente.php:44Clinical Capabilities
While the codebase is still in development, dentists are designed to have access to:Treatment Planning
Create and manage treatment plans for patients (via
Tratamiento model)Evolution Notes
Record clinical progress and observations (via
NotasEvolucion model)Appointment Management
View and manage appointments (via
Cita model)Clinical Records
Access complete patient medical histories (via
ExpedienteClinico model)Permission Boundaries
Access Requirements:
- Account status must be
'activo' - Associated clinic status must be
'activo' - Must be logged in with valid session
Authentication & Authorization
Gate Definition
Thedentista-only gate is defined in AppServiceProvider.php:30:
Login Redirection
After successful authentication, Dentists are redirected to:AuthController.php:68
Session Validation
Dentists cannot log in if:- Their user status is not
'activo'(checked atAuthController.php:33) - Their clinic status is
'baja'(checked atAuthController.php:41)
Database Schema
Dentist users are stored in theusuario table:
| Field | Description | Required |
|---|---|---|
id_usuario | Primary key | ✓ |
id_clinica | Foreign key to clinic | ✓ |
nombre | First name | ✓ |
apellido_paterno | Paternal surname | ✓ |
apellido_materno | Maternal surname | Optional |
cedula_profesional | Professional license (7-10 digits) | ✓ |
nom_usuario | Username (4-20 alphanumeric) | ✓ |
password | Hashed password | ✓ |
rol | Must be 'dentista' | ✓ |
estatus | 'activo' or 'baja' | ✓ |
app/Models/Usuario.php:21
User Relationships
Creating Dentist Accounts
Dentist accounts can only be created by Super Admins via:id_clinica- Must be an active clinicnombre- Min 3 chars, letters onlyapellido_paterno- Min 3 chars, letters onlynom_usuario- 4-20 alphanumeric, uniquepassword- Min 8 chars, mixed case, numbersrol- Set to'dentista'cedula_profesional- 7-10 digits
app/Http/Controllers/Admin/UsuarioController.php:26
Account Management
Status Toggle
Super Admins can suspend or reactivate dentist accounts:estatus between 'activo' and 'baja'. When suspended, the dentist cannot log in.
Source: app/Http/Controllers/Admin/UsuarioController.php:91
Profile Updates
Dentists cannot update their own profiles. Updates must be performed by Super Admins via:Best Practices
Professional License
Always verify that the cedula_profesional is valid and belongs to the dentist before creating the account.
Data Security
Dentists should only access patient data within their clinic. The system enforces this through middleware and database queries filtered by
id_clinica.Password Security
Passwords are automatically hashed using Laravel’s built-in hashing (defined in Usuario model as
'password' => 'hashed').Future Capabilities
Based on the data models, dentists will eventually have access to:- Full CRUD operations on patients
- Treatment plan creation and modification
- Clinical note writing and evolution tracking
- Appointment scheduling and management
- X-ray and document uploads
- Billing and payment tracking
Related Documentation
- Super Admin Role - Platform-level management
- Assistant Role - Reception and scheduling support
- Patient Access - Patient portal capabilities
- Patient Management - Detailed patient operations