Customers in PatoLab represent the patients or institutions that submit specimens for analysis. A customer record is required before a specimen can be registered — it provides the billing identity on invoices, the phone number for WhatsApp status notifications, and the geographic data used for demographic reporting. Customers can be individual patients (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/lerichardv/patolab-platform/llms.txt
Use this file to discover all available pages before exploring further.
cliente) or corporate entities (empresa), and both types share the same record model.
Customer Resource Routes
| Method | Endpoint | Description |
|---|---|---|
GET | /customers | Paginated list with search and filters |
POST | /customers | Create a new customer |
PUT | /customers/{id} | Update an existing customer |
DELETE | /customers/{id} | Soft-delete (sets active = false) |
GET | /customers/export | Download all customers as a CSV spreadsheet |
patients.view, patients.create, patients.edit, or patients.delete permission respectively.
Customer Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | ✅ | Full name of the patient or company |
id_number | string | ✅ | National identity number or RTN (must be unique) |
type | string | ✅ | cliente (individual patient) or empresa (institution) |
age | integer | ✅ (if type=cliente) | Patient age, used for age-based discounts |
gender | string | ✅ | Patient gender |
phone | string | ✅ | Primary phone number; used for WhatsApp notifications |
state | integer (FK) | ✅ | Department ID from departments table |
city | integer (FK) | ✅ | Municipality ID from municipalities table |
secondary_phone | string | ❌ | Alternate contact number |
address | string | ❌ | Street address |
email | ❌ | Email address | |
active | boolean | — | Managed by the system; false = soft-deleted |
Searching and Filtering
The customers list supports the following query parameters:| Parameter | Description |
|---|---|
search | Matches against name, phone, or email |
type | Filter by cliente or empresa |
gender | Filter by gender value |
state | Filter by department name or ID |
city | Filter by municipality name or ID |
Referrers
Referrers are the doctors or institutions that send patients to the laboratory. Each specimen must have a referrer assigned at registration. Referrers belong to a referrer type (e.g. “General Practitioner”, “Hospital”, “Clinic”).Referrers
Full CRUD via
GET/POST/PUT/DELETE /referrers. Referrer records include name, contact information, and type classification.Referrer Types
Manage referrer categories via
GET/POST/PUT/DELETE /referrer-types. Used to group and filter referrers on the specimen creation form.Geographic Data
PatoLab ships with a seeded geographic hierarchy used to populate state and city dropdowns on the customer form.Locations
Locations represent physical lab branches or collection sites. They are linked to CAI ranges and invoice sequences.Export
clientes_patolab.csv) with all active customers matching the current filter state. Exported columns: Nombre, Identidad/RTN, Tipo, Edad, Género, Teléfono, Estado/Departamento, Ciudad, Correo.
