update
This commit is contained in:
parent
d7847da450
commit
02984811ab
@ -1,4 +1,4 @@
|
||||
# Generated by Django 5.0.14 on 2026-01-11 21:05
|
||||
# Generated by Django 5.0.14 on 2026-01-12 14:46
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
@ -6,7 +6,7 @@ from django.db import migrations, models
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('accounts', '0003_user_acknowledgement_completed_and_more'),
|
||||
('accounts', '0002_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
@ -917,6 +917,30 @@ def get_staff_by_hospital(request):
|
||||
return JsonResponse({'staff': results})
|
||||
|
||||
|
||||
@login_required
|
||||
def get_physicians_by_hospital(request):
|
||||
"""Get physicians for a hospital (AJAX)"""
|
||||
hospital_id = request.GET.get('hospital_id')
|
||||
if not hospital_id:
|
||||
return JsonResponse({'physicians': []})
|
||||
|
||||
physicians = Staff.objects.filter(
|
||||
hospital_id=hospital_id,
|
||||
status='active',
|
||||
staff_type='physician'
|
||||
).values('id', 'user__first_name', 'user__last_name')
|
||||
|
||||
results = [
|
||||
{
|
||||
'id': str(p['id']),
|
||||
'name': f"{p['user__first_name']} {p['user__last_name']}",
|
||||
}
|
||||
for p in physicians
|
||||
]
|
||||
|
||||
return JsonResponse({'physicians': results})
|
||||
|
||||
|
||||
@login_required
|
||||
def get_departments_by_hospital(request):
|
||||
"""Get departments for a hospital (AJAX)"""
|
||||
|
||||
@ -52,6 +52,7 @@ urlpatterns = [
|
||||
# AJAX Helpers
|
||||
path('ajax/users/', ui_views.get_users_by_hospital, name='get_users_by_hospital'),
|
||||
path('ajax/staff/', ui_views.get_staff_by_hospital, name='get_staff_by_hospital'),
|
||||
path('ajax/physicians/', ui_views.get_physicians_by_hospital, name='get_physicians_by_hospital'),
|
||||
path('ajax/departments/', ui_views.get_departments_by_hospital, name='get_departments_by_hospital'),
|
||||
path('ajax/summary/', ui_views.appreciation_summary_ajax, name='appreciation_summary_ajax'),
|
||||
]
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# Generated by Django 5.0.14 on 2026-01-10 20:27
|
||||
# Generated by Django 5.0.14 on 2026-01-12 14:46
|
||||
|
||||
import django.db.models.deletion
|
||||
import uuid
|
||||
@ -9,8 +9,8 @@ from django.db import migrations, models
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('complaints', '0004_inquiryattachment_inquiryupdate'),
|
||||
('organizations', '0006_staff_email'),
|
||||
('complaints', '0002_initial'),
|
||||
('organizations', '0002_staff_email'),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# Generated by Django 5.0.14 on 2026-01-10 14:43
|
||||
# Generated by Django 5.0.14 on 2026-01-12 14:46
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
@ -6,7 +6,7 @@ from django.db import migrations, models
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('organizations', '0005_alter_staff_department'),
|
||||
('organizations', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
Loading…
x
Reference in New Issue
Block a user