إدارة المرضى الشاملة - Complete Patient Management System
Patients Module يوفر نظام شامل لإدارة سجلات المرضى مع جميع البيانات الطبية والشخصية.
الجدول الرئيسي لبيانات المرضى
| Field | Type | Description | Required |
|---|---|---|---|
first_name |
string | الاسم الأول | ✅ |
last_name |
string | الاسم الأخير | ✅ |
date_of_birth |
date | تاريخ الميلاد | ✅ |
gender |
enum | الجنس (male, female, other) | ✅ |
phone |
string | رقم الهاتف | ❌ |
email |
string | البريد الإلكتروني | ❌ |
medical_record_number |
string | رقم السجل الطبي (auto-generated) | Auto |
details() → PatientDetail (hasOne)identifiers() → PatientIdentifier (hasMany)contacts() → PatientContact (hasMany)allergies() → PatientAllergy (hasMany)medications() → PatientMedication (hasMany)conditions() → PatientCondition (hasMany)vitals() → PatientVital (hasMany)insurances() → PatientInsurance (hasMany)familyHistory() → PatientFamilyHistory (hasMany)معلومات تفصيلية إضافية عن المريض
nationality - الجنسيةmarital_status - الحالة الاجتماعية (single, married, divorced, widowed)occupation - المهنةemergency_contact - جهة الاتصال في الطوارئ (JSON)language_preference - اللغة المفضلةblood_type - فصيلة الدم (A+, A-, B+, B-, AB+, AB-, O+, O-)height - الطول (cm)weight - الوزن (kg)Authorization: Bearer {token}
| Parameter | Type | Description | Example |
|---|---|---|---|
search |
string | بحث في الاسم، الهاتف، البريد | ?search=أحمد |
gender |
string | فلترة حسب الجنس | ?gender=male |
date_of_birth |
date | فلترة حسب تاريخ الميلاد | ?date_of_birth=1990-01-01 |
per_page |
integer | عدد النتائج في الصفحة | ?per_page=20 |
include |
string | تضمين العلاقات | ?include=details,allergies |
{
"status": true,
"data": [
{
"id": 1,
"first_name": "أحمد",
"last_name": "محمد",
"medical_record_number": "PAT-2025-00001",
"date_of_birth": "1990-01-15",
"gender": "male",
"phone": "+966501234567",
"email": "ahmad@example.com",
"created_at": "2025-01-15T10:30:00Z"
}
],
"meta": {
"current_page": 1,
"per_page": 15,
"total": 150,
"last_page": 10
}
}
curl -X GET "https://api.example.com/api/patients?search=أحمد&per_page=20" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN_HERE"
id - Patient ID (integer, required){
"status": true,
"data": {
"id": 1,
"first_name": "أحمد",
"last_name": "محمد",
"medical_record_number": "PAT-2025-00001",
"date_of_birth": "1990-01-15",
"gender": "male",
"phone": "+966501234567",
"email": "ahmad@example.com",
"details": {
"nationality": "Saudi",
"marital_status": "married",
"blood_type": "O+",
"occupation": "Engineer"
},
"allergies_count": 2,
"medications_count": 1,
"created_at": "2025-01-15T10:30:00Z"
}
}
{
"first_name": "أحمد",
"last_name": "محمد",
"date_of_birth": "1990-01-15",
"gender": "male",
"phone": "+966501234567",
"email": "ahmad@example.com",
"address": "الرياض، السعودية"
}
first_name - required, string, max:100last_name - required, string, max:100date_of_birth - required, date, before:todaygender - required, in:male,female,otherphone - nullable, string, unique:patientsemail - nullable, email, unique:patients{
"status": true,
"message": "Patient created successfully",
"data": {
"id": 123,
"medical_record_number": "PAT-2025-00123",
"first_name": "أحمد",
"last_name": "محمد",
...
}
}
الوصف: يرجع قائمة مختصرة للاستخدام في autocomplete/typeahead
q - النص المراد البحث عنه (required, min:2)limit - عدد النتائج (default: 10, max: 50){
"status": true,
"data": [
{
"id": 1,
"label": "أحمد محمد - PAT-2025-00001",
"mrn": "PAT-2025-00001",
"phone": "+966501234567"
},
{
"id": 2,
"label": "أحمد علي - PAT-2025-00042",
"mrn": "PAT-2025-00042",
"phone": "+966509876543"
}
]
}
{
"allergen": "Penicillin",
"category": "medication",
"reaction": "Skin rash",
"severity": "moderate",
"onset_date": "2023-06-15",
"notes": "Developed after first dose"
}
category: medication, food, environmental, otherseverity: mild, moderate, severe{
"blood_pressure": "120/80",
"heart_rate": 72,
"temperature": 36.8,
"respiratory_rate": 16,
"oxygen_saturation": 98,
"weight": 75.5,
"height": 175,
"recorded_at": "2024-01-15 14:30:00"
}
{
"patients": [
{
"first_name": "أحمد",
"last_name": "محمد",
"date_of_birth": "1990-01-15",
"gender": "male"
},
{
"first_name": "فاطمة",
"last_name": "علي",
"date_of_birth": "1992-05-20",
"gender": "female"
}
]
}
{
"status": true,
"message": "2 patients created successfully",
"data": {
"created": 2,
"failed": 0,
"patients": [...]
}
}
{
"source_patient_id": 123,
"target_patient_id": 456
}
الوصف: يتم دمج جميع السجلات والعلاقات من source إلى target ثم حذف source
// عرض مواعيد مريض معين
$patient = Patient::find(1);
$appointments = $patient->appointments;
// عرض زيارات المريض
$encounters = $patient->encounters;
// التحقق من الحساسيات قبل الصرف
$patient = Patient::with('allergies')->find(1);
foreach ($patient->allergies as $allergy) {
if ($allergy->category === 'medication') {
// تحذير: المريض لديه حساسية من دواء
}
}
// طلب فحص مخبري لمريض
$patient->labOrders()->create([
'test_type' => 'Complete Blood Count',
'ordered_at' => now()
]);