Appearance
Data Model
Thực thể quan trọng nhất không phải Hospital mà là Navigation Case.
Patient ─┬─ MedicalHistory (symptom | diagnosis | medication | treatment | visit | test_result)
├─ MedicalDocument (ảnh, hồ sơ — file ở R2)
└─ Contact (primary ≤ 1, secondary *)
NavigationCase (HT3-000123) ── Patient
├─ Recommendation* (engine_version, result_json, chosen_hospital)
├─ CaseEvent* (nhật ký: created, updated, document.uploaded, share.viewed, …)
├─ FollowUp*
├─ CaseShare* ── CaseOpinion* (hội chẩn từ xa)
Hospital ─┬─ Department ─┬─ Doctor ── Schedule
│ └─ Schedule
├─ HealthcareService (diagnostic | inpatient | family | aftercare | booking | transport)
├─ Policy (visitor | documents | fasting | insurance | parking)
└─ Place (lodging | food | transport_hub | pharmacy | parking)Navigation Case
Navigation Case #HT3-000123
need: checkup state: pre_hospital
current_location: Nghệ An preferred_city: Hà Nội
urgency: routine specialties: ["cardiology"]
needs_human: 0 intake_json: {...} ← input gốc để chạy lại engineTrạng thái: intake → pre_hospital → in_hospital → post_discharge → follow_up → closed (+ emergency).
Contact
| Trường | Ý nghĩa |
|---|---|
role | primary (tối đa 1 / người bệnh — unique index) hoặc secondary |
relationship | con gái, chồng, … |
phone, zalo, email | |
decision_authority | có quyền quyết định |
can_accompany | có thể đi cùng |
can_receive_medical_info | được nhận thông tin y tế |
is_emergency_contact |
Schema đầy đủ: migrations/0001_init.sql.