Skip to main content

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 the can:dentista-only middleware, which verifies the user’s role is dentista.

Dashboard

GET /dentista/dashboard
View clinic-specific statistics including:
  • Today’s appointments (citasHoy)
  • Total patients in the clinic (totalPacientes)
  • Active treatments (tratamientosActivos)
  • System alerts and notifications
Implemented in: app/Http/Controllers/Clinica/DashboardController.php:12
The dashboard displays only data from the dentist’s assigned clinic (filtered by id_clinica).

Patient Management

GET /pacientes
Controller: 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
Patients are stored in the paciente table with the following key fields:Demographics:
  • nombre, apellido_paterno, apellido_materno
  • fecha_nacimiento, sexo
  • curp, telefono, ocupacion
Address:
  • calle, num_ext, num_int
  • colonia, ciudad, estado, codigo_postal
Clinical:
  • peso (weight)
  • estatus (active/inactive)
  • id_clinica (clinic association)
Source: app/Models/Paciente.php:16
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
Source: app/Models/Paciente.php:44

Clinical 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

Restrictions:
  • Cannot access patients from other clinics
  • Cannot modify clinic settings or logo
  • Cannot create or manage other users
  • Cannot access Super Admin routes (/admin/*)
  • Cannot access Assistant-only routes (/asistente/*)
Access Requirements:
  • Account status must be 'activo'
  • Associated clinic status must be 'activo'
  • Must be logged in with valid session

Authentication & Authorization

Gate Definition

The dentista-only gate is defined in AppServiceProvider.php:30:
Gate::define('dentista-only', function ($user) {
    return $user->rol === 'dentista';
});

Login Redirection

After successful authentication, Dentists are redirected to:
/dentista/dashboard
Implemented in: AuthController.php:68

Session Validation

Dentists cannot log in if:
  1. Their user status is not 'activo' (checked at AuthController.php:33)
  2. Their clinic status is 'baja' (checked at AuthController.php:41)

Database Schema

Dentist users are stored in the usuario table:
FieldDescriptionRequired
id_usuarioPrimary key
id_clinicaForeign key to clinic
nombreFirst name
apellido_paternoPaternal surname
apellido_maternoMaternal surnameOptional
cedula_profesionalProfessional license (7-10 digits)
nom_usuarioUsername (4-20 alphanumeric)
passwordHashed password
rolMust be 'dentista'
estatus'activo' or 'baja'
Source: app/Models/Usuario.php:21

User Relationships

Creating Dentist Accounts

Dentist accounts can only be created by Super Admins via:
POST /usuarios
Required Fields:
  • id_clinica - Must be an active clinic
  • nombre - Min 3 chars, letters only
  • apellido_paterno - Min 3 chars, letters only
  • nom_usuario - 4-20 alphanumeric, unique
  • password - Min 8 chars, mixed case, numbers
  • rol - Set to 'dentista'
  • cedula_profesional - 7-10 digits
Source: app/Http/Controllers/Admin/UsuarioController.php:26

Account Management

Status Toggle

Super Admins can suspend or reactivate dentist accounts:
PATCH /usuarios/{id}/toggle
This switches the 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:
PUT /usuarios/{id}

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

Build docs developers (and LLMs) love