feat: enrich patient record with full profile
GET /api/v1/patient/{uuid} now returns a `profile` object from UserProfile
(demographics, contact, insurance names resolved). Admin record detail shows
a "patient info" section. Empty fields render as "ثبت نشده".
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+25
-5
@@ -119,7 +119,7 @@ Creates a patient record for a user under the current entity. If the record alre
|
||||
GET /api/v1/patient/{uuid}
|
||||
```
|
||||
|
||||
Returns a single patient record.
|
||||
Returns a single patient record, enriched with the patient's full profile (`profile`) درونخطی از `UserProfile`. اگر پروفایل وجود نداشت، فیلدها `null` برمیگردند (نه خطا). نام بیمهها از روی id resolve میشوند.
|
||||
|
||||
**Response 200:**
|
||||
|
||||
@@ -130,14 +130,34 @@ Returns a single patient record.
|
||||
"uuid": "...",
|
||||
"entity_type": "doctor",
|
||||
"entity_id": 5,
|
||||
"user": { "uuid": "...", "fullName": "...", "phone": "..." },
|
||||
"created_by_type": "doctor",
|
||||
"created_by_id": 5,
|
||||
"created_at": 1718375000
|
||||
"user_uuid": "...",
|
||||
"user_name": "...",
|
||||
"user_mobile": "0912...",
|
||||
"user_national_code": "...",
|
||||
"created_at": 1718375000,
|
||||
"profile": {
|
||||
"full_name": "محمد محمدی",
|
||||
"national_code": "0012345678",
|
||||
"gender": "male",
|
||||
"date_of_birth": 700000000,
|
||||
"blood_type": "O+",
|
||||
"marital_status": "single",
|
||||
"job": "...",
|
||||
"address": "...",
|
||||
"home_phone": "...",
|
||||
"work_phone": "...",
|
||||
"mobile": "0912...",
|
||||
"basic_insurance_id": 3,
|
||||
"basic_insurance_name": "تأمین اجتماعی",
|
||||
"supplementary_insurance_id": 9,
|
||||
"supplementary_insurance_name": "دانا"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
> `date_of_birth` یک Unix timestamp است؛ سمت کلاینت با `formatDate()` شمسی نمایش داده میشود. `profile` برای هر دو `entity_type` (doctor/clinic) یکسان است.
|
||||
|
||||
**Errors:**
|
||||
|
||||
| Code | HTTP | Description |
|
||||
|
||||
Reference in New Issue
Block a user