Lab Doctors (الاطباء)
Doctors represent the physicians who order lab tests. A doctor can be internal (hospital staff linked to an HRM department) or external (referring physician from an outside clinic).
Entity Attributes
| Field | Type | Required | Description |
|---|---|---|---|
id | integer | auto | Primary key |
name | string | yes | Doctor name (English) |
name_ar | string | no | Doctor name (Arabic) |
code | string | no | Auto-generated if empty |
specialization | string | no | Medical specialization (English) |
specialization_ar | string | no | Medical specialization (Arabic) |
license_number | string | no | Medical license number |
phone | string | no | Phone number |
email | string | no | Email address |
is_internal | boolean | no | Internal hospital doctor (default: false) |
department_id | FK | no | HRM department (for internal doctors) |
partner_id | FK | no | Linked BusinessPartner (supplier) for accounting |
commission_type | enum | no | percentage, fixed_per_referral, fixed_per_test |
commission_value | decimal | no | Commission rate or fixed amount |
commission_account_id | FK | no | Override expense GL account |
commission_payable_account_id | FK | no | Override payable GL account |
is_commission_active | boolean | no | Enable commissions (default: false) |
is_active | boolean | no | Active status (default: true) |
created_at | datetime | auto | Creation timestamp |
updated_at | datetime | auto | Last update timestamp |
ER Diagram
API Endpoints
| Method | Endpoint | Description | Permission |
|---|---|---|---|
GET | /api/lis/doctors | List doctors (paginated) | lis.doctors.view |
POST | /api/lis/doctors | Create a doctor | lis.doctors.create |
GET | /api/lis/doctors/{id} | Get doctor details | lis.doctors.view |
PUT | /api/lis/doctors/{id} | Update a doctor | lis.doctors.update |
DELETE | /api/lis/doctors/{id} | Delete a doctor | lis.doctors.delete |
Query Parameters (List)
| Parameter | Type | Description |
|---|---|---|
search | string | Search by name, name_ar, or code |
is_active | boolean | Filter by active status |
is_internal | boolean | Filter internal vs external doctors |
has_commission | boolean | Filter doctors with commission enabled |
commission_type | string | Filter by commission type |
Request / Response Examples
Create Doctor
bash
curl -X POST /api/lis/doctors \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"name": "Dr. Sara Ali",
"name_ar": "د. سارة علي",
"specialization": "Internal Medicine",
"specialization_ar": "الباطنة",
"license_number": "KW-MED-12345",
"phone": "+965-5555-1234",
"is_internal": true,
"department_id": 3
}'dart
final response = await dio.post('/api/lis/doctors', data: {
'name': 'Dr. Sara Ali',
'name_ar': 'د. سارة علي',
'specialization': 'Internal Medicine',
'specialization_ar': 'الباطنة',
'license_number': 'KW-MED-12345',
'phone': '+965-5555-1234',
'is_internal': true,
'department_id': 3,
});Response 201 Created
json
{
"data": {
"id": 1,
"name": "Dr. Sara Ali",
"name_ar": "د. سارة علي",
"code": "DOC-000001",
"specialization": "Internal Medicine",
"specialization_ar": "الباطنة",
"license_number": "KW-MED-12345",
"phone": "+965-5555-1234",
"email": null,
"is_internal": true,
"department_id": 3,
"is_active": true,
"created_at": "2026-03-01T10:00:00.000000Z",
"updated_at": "2026-03-01T10:00:00.000000Z"
}
}Business Rules
- Internal vs external -- Internal doctors are linked to an HRM department. External doctors are referring physicians.
- Lab requests -- A doctor is referenced on every lab request to identify who ordered the tests.
- Department link -- The
department_idreferences the HRM module's Department model (cross-module relation). - Commission system -- Doctors can earn commissions on referred lab tests. See Doctor Commissions for the full commission workflow.
- Auto-create partner -- Pass
auto_create_partner: truewhen creating/updating a doctor to auto-create a BusinessPartner (supplier) for accounting integration.