Lab Sections (اقسام المختبر)
Lab Sections represent the organizational departments within the laboratory, such as Hematology, Biochemistry, Microbiology, etc. Investigations and machines are assigned to sections.
Entity Attributes
| Field | Type | Required | Description |
|---|---|---|---|
id | integer | auto | Primary key |
name | string | yes | Section name (English) |
name_ar | string | no | Section name (Arabic) |
code | string | no | Auto-generated if empty via SequenceService |
description | string | no | Section description |
is_active | boolean | no | Active status (default: true) |
sort_order | integer | no | Display order |
created_at | datetime | auto | Creation timestamp |
updated_at | datetime | auto | Last update timestamp |
ER Diagram
API Endpoints
| Method | Endpoint | Description | Permission |
|---|---|---|---|
GET | /api/lis/sections | List sections (paginated) | lis.sections.view |
POST | /api/lis/sections | Create a section | lis.sections.create |
GET | /api/lis/sections/{id} | Get section details | lis.sections.view |
PUT | /api/lis/sections/{id} | Update a section | lis.sections.update |
DELETE | /api/lis/sections/{id} | Delete a section | lis.sections.delete |
Query Parameters (List)
| Parameter | Type | Description |
|---|---|---|
search | string | Search by name, name_ar, or code |
is_active | boolean | Filter by active status |
Request / Response Examples
Create Section
bash
curl -X POST /api/lis/sections \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"name": "Hematology",
"name_ar": "امراض الدم",
"description": "Complete blood analysis section"
}'dart
final response = await dio.post('/api/lis/sections', data: {
'name': 'Hematology',
'name_ar': 'امراض الدم',
'description': 'Complete blood analysis section',
});Response 201 Created
json
{
"data": {
"id": 1,
"name": "Hematology",
"name_ar": "امراض الدم",
"code": "SEC-000001",
"description": "Complete blood analysis section",
"is_active": true,
"sort_order": 0,
"created_at": "2026-03-01T10:00:00.000000Z",
"updated_at": "2026-03-01T10:00:00.000000Z"
}
}List Sections
bash
curl -G /api/lis/sections \
-H "Authorization: Bearer {token}" \
-d "search=hema" \
-d "is_active=true"dart
final response = await dio.get('/api/lis/sections', queryParameters: {
'search': 'hema',
'is_active': true,
});Business Rules
- Auto-code generation -- If
codeis not provided, a sequential code is generated via SequenceService (lis,lab_section). - Company scoping -- Sections are scoped to the authenticated user's company.
- Soft deletes -- Deleted sections are soft-deleted and can be restored.