Skip to content

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

FieldTypeRequiredDescription
idintegerautoPrimary key
namestringyesSection name (English)
name_arstringnoSection name (Arabic)
codestringnoAuto-generated if empty via SequenceService
descriptionstringnoSection description
is_activebooleannoActive status (default: true)
sort_orderintegernoDisplay order
created_atdatetimeautoCreation timestamp
updated_atdatetimeautoLast update timestamp

ER Diagram

API Endpoints

MethodEndpointDescriptionPermission
GET/api/lis/sectionsList sections (paginated)lis.sections.view
POST/api/lis/sectionsCreate a sectionlis.sections.create
GET/api/lis/sections/{id}Get section detailslis.sections.view
PUT/api/lis/sections/{id}Update a sectionlis.sections.update
DELETE/api/lis/sections/{id}Delete a sectionlis.sections.delete

Query Parameters (List)

ParameterTypeDescription
searchstringSearch by name, name_ar, or code
is_activebooleanFilter 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

  1. Auto-code generation -- If code is not provided, a sequential code is generated via SequenceService (lis, lab_section).
  2. Company scoping -- Sections are scoped to the authenticated user's company.
  3. Soft deletes -- Deleted sections are soft-deleted and can be restored.

Moon ERP API Documentation