feat: patient management system + health landing page
Backend:
- Patient model: name, phone, email, age, weight, height, gender,
blood type, disease history, allergies, medications, notes, category
- PatientVisit model: title, content, prescription, visit type,
visit/next-visit dates, linked to patient (cascade delete)
- HealthRequest model: public form submissions for beauty/health care
- Runtime SQLite migrations for all 3 new tables
- Full CRUD API: /api/patients, /api/patients/{id}/visits,
/api/health-requests (public POST + admin GET/PUT/DELETE)
Admin panel:
- 'پرونده بیماران' page: list, search, filter by category (beauty/health)
- Patient profile page: personal info + medical history + visits timeline
- Add/edit patient modal with all medical fields
- Add visit modal: type, date, clinical notes, prescription, next visit
- 'درخواستها' page: manage public health requests, mark as handled
- Badge counter for unhandled requests in sidebar
Frontend (SEO):
- New #health-care section with Schema.org MedicalClinic markup
- Two category cards: زیبایی پوست and سلامت عمومی
- Feature lists with checkmarks per category
- Inline request form that submits to /api/health-request
- Mobile responsive (single column on small screens)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -130,6 +130,56 @@ public class Faq
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
// ─── Patient ──────────────────────────────────────────────────────────────────
|
||||
public class Patient
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[MaxLength(150)] public string FullName { get; set; } = "";
|
||||
[MaxLength(20)] public string PhoneNumber { get; set; } = "";
|
||||
[MaxLength(200)] public string Email { get; set; } = "";
|
||||
public int Age { get; set; }
|
||||
public decimal Weight { get; set; } // kg
|
||||
public decimal Height { get; set; } // cm
|
||||
[MaxLength(10)] public string Gender { get; set; } = ""; // مرد / زن
|
||||
[MaxLength(10)] public string BloodType { get; set; } = "";
|
||||
public string DiseaseHistory { get; set; } = "";
|
||||
public string Allergies { get; set; } = "";
|
||||
public string Medications { get; set; } = "";
|
||||
public string Notes { get; set; } = "";
|
||||
[MaxLength(20)] public string Category { get; set; } = "beauty"; // beauty | health
|
||||
public bool IsActive { get; set; } = true;
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
public ICollection<PatientVisit> Visits { get; set; } = new List<PatientVisit>();
|
||||
}
|
||||
|
||||
// ─── Patient Visit / Doctor Note ──────────────────────────────────────────────
|
||||
public class PatientVisit
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int PatientId { get; set; }
|
||||
public Patient? Patient { get; set; }
|
||||
[MaxLength(300)] public string Title { get; set; } = "";
|
||||
public string Content { get; set; } = "";
|
||||
public string Prescription { get; set; } = ""; // دارو / تجویز
|
||||
[MaxLength(50)] public string VisitType { get; set; } = "ویزیت"; // ویزیت | آزمایش | پروسیجر
|
||||
public DateTime VisitDate { get; set; } = DateTime.UtcNow;
|
||||
public DateTime? NextVisitDate { get; set; }
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
// ─── Health / Appointment Request (public form) ───────────────────────────────
|
||||
public class HealthRequest
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[MaxLength(150)] public string FullName { get; set; } = "";
|
||||
[MaxLength(20)] public string PhoneNumber { get; set; } = "";
|
||||
[MaxLength(200)] public string Email { get; set; } = "";
|
||||
public string Message { get; set; } = "";
|
||||
[MaxLength(20)] public string Category { get; set; } = "beauty"; // beauty | health
|
||||
public bool IsHandled { get; set; } = false;
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
// ─── DTOs ─────────────────────────────────────────────────────────────────────
|
||||
public record LoginRequest(string Username, string Password);
|
||||
public record ChangePasswordRequest(string CurrentPassword, string NewPassword);
|
||||
|
||||
Reference in New Issue
Block a user