diff --git a/db.sqlite3 b/db.sqlite3 index e1cfa7c3..6c7d1ca2 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/inpatients/__pycache__/models.cpython-312.pyc b/inpatients/__pycache__/models.cpython-312.pyc index 932be621..90f0ff45 100644 Binary files a/inpatients/__pycache__/models.cpython-312.pyc and b/inpatients/__pycache__/models.cpython-312.pyc differ diff --git a/inpatients/__pycache__/views.cpython-312.pyc b/inpatients/__pycache__/views.cpython-312.pyc index 497f12ca..f10b41d5 100644 Binary files a/inpatients/__pycache__/views.cpython-312.pyc and b/inpatients/__pycache__/views.cpython-312.pyc differ diff --git a/inpatients/models.py b/inpatients/models.py index ae1bbf73..6f26ecac 100644 --- a/inpatients/models.py +++ b/inpatients/models.py @@ -262,7 +262,48 @@ class Bed(models.Model): """ Hospital bed model for tracking individual bed status and assignments. """ - + BED_TYPE_CHOICES = [ + ('STANDARD', 'Standard Bed'), + ('ICU', 'ICU Bed'), + ('CARDIAC', 'Cardiac Monitoring'), + ('ISOLATION', 'Isolation Bed'), + ('BARIATRIC', 'Bariatric Bed'), + ('PEDIATRIC', 'Pediatric Bed'), + ('NEONATAL', 'Neonatal Bed'), + ('MATERNITY', 'Maternity Bed'), + ('PSYCHIATRIC', 'Psychiatric Bed'), + ('STRETCHER', 'Stretcher/Gurney'), + ('RECLINER', 'Recliner Chair'), + ('OTHER', 'Other'), + ] + ROOM_TYPE_CHOICES = [ + ('PRIVATE', 'Private Room'), + ('SEMI_PRIVATE', 'Semi-Private'), + ('SHARED', 'Shared Room'), + ('ICU', 'ICU Room'), + ('ISOLATION', 'Isolation Room'), + ] + STATUS_CHOICES = [ + ('AVAILABLE', 'Available'), + ('OCCUPIED', 'Occupied'), + ('RESERVED', 'Reserved'), + ('MAINTENANCE', 'Under Maintenance'), + ('CLEANING', 'Being Cleaned'), + ('OUT_OF_ORDER', 'Out of Order'), + ('BLOCKED', 'Blocked'), + ] + CLEANING_LEVEL_CHOICES = [ + ('STANDARD', 'Standard Cleaning'), + ('DEEP', 'Deep Cleaning'), + ('ISOLATION', 'Isolation Cleaning'), + ('TERMINAL', 'Terminal Cleaning'), + ] + BED_POSITION_CHOICES = [ + ('WINDOW', 'Window Side'), + ('DOOR', 'Door Side'), + ('CENTER', 'Center'), + ('CORNER', 'Corner'), + ] # Ward relationship ward = models.ForeignKey( Ward, @@ -284,48 +325,21 @@ class Bed(models.Model): # Bed Type and Configuration bed_type = models.CharField( max_length=30, - choices=[ - ('STANDARD', 'Standard Bed'), - ('ICU', 'ICU Bed'), - ('CARDIAC', 'Cardiac Monitoring'), - ('ISOLATION', 'Isolation Bed'), - ('BARIATRIC', 'Bariatric Bed'), - ('PEDIATRIC', 'Pediatric Bed'), - ('NEONATAL', 'Neonatal Bed'), - ('MATERNITY', 'Maternity Bed'), - ('PSYCHIATRIC', 'Psychiatric Bed'), - ('STRETCHER', 'Stretcher/Gurney'), - ('RECLINER', 'Recliner Chair'), - ('OTHER', 'Other'), - ], + choices=BED_TYPE_CHOICES, default='STANDARD', help_text='Type of bed' ) room_type = models.CharField( max_length=20, - choices=[ - ('PRIVATE', 'Private Room'), - ('SEMI_PRIVATE', 'Semi-Private'), - ('SHARED', 'Shared Room'), - ('ICU', 'ICU Room'), - ('ISOLATION', 'Isolation Room'), - ], + choices=ROOM_TYPE_CHOICES, help_text='Type of room' ) # Bed Status status = models.CharField( max_length=20, - choices=[ - ('AVAILABLE', 'Available'), - ('OCCUPIED', 'Occupied'), - ('RESERVED', 'Reserved'), - ('MAINTENANCE', 'Under Maintenance'), - ('CLEANING', 'Being Cleaned'), - ('OUT_OF_ORDER', 'Out of Order'), - ('BLOCKED', 'Blocked'), - ], + choices=STATUS_CHOICES, default='AVAILABLE', help_text='Current bed status' ) @@ -405,12 +419,7 @@ class Bed(models.Model): ) cleaning_level = models.CharField( max_length=20, - choices=[ - ('STANDARD', 'Standard Cleaning'), - ('DEEP', 'Deep Cleaning'), - ('ISOLATION', 'Isolation Cleaning'), - ('TERMINAL', 'Terminal Cleaning'), - ], + choices=CLEANING_LEVEL_CHOICES, blank=True, null=True, help_text='Level of last cleaning' @@ -439,12 +448,7 @@ class Bed(models.Model): # Location Details bed_position = models.CharField( max_length=20, - choices=[ - ('WINDOW', 'Window Side'), - ('DOOR', 'Door Side'), - ('CENTER', 'Center'), - ('CORNER', 'Corner'), - ], + choices=BED_POSITION_CHOICES, blank=True, null=True, help_text='Position within room' diff --git a/inpatients_data.py b/inpatients_data.py index b0a4a7ae..2b863d19 100644 --- a/inpatients_data.py +++ b/inpatients_data.py @@ -403,6 +403,22 @@ def create_saudi_transfers(admissions): to_bed = random.choice(available_beds) to_ward = to_bed.ward + # Get users who can request transfers (physicians, nurses, etc.) + requesting_users = User.objects.filter( + tenant=admission.tenant, + is_active=True, + role__in=['PHYSICIAN', 'NURSE', 'NURSE_PRACTITIONER', 'PHYSICIAN_ASSISTANT'] + ) + + if not requesting_users.exists(): + # Fallback to any active user from the tenant + requesting_users = User.objects.filter(tenant=admission.tenant, is_active=True) + + if not requesting_users.exists(): + continue # Skip if no users available + + requested_by = random.choice(requesting_users) + requested_datetime = admission.admission_datetime + timedelta(hours=random.randint(1, 72)) status = random.choice(transfer_statuses) @@ -415,6 +431,15 @@ def create_saudi_transfers(admissions): if status in ['in_progress', 'completed']: actual_datetime = scheduled_datetime + timedelta(minutes=random.randint(-30, 60)) + # Get transport team members + transport_team_members = [] + nurses = User.objects.filter( + tenant=admission.tenant, + role__in=['NURSE', 'NURSE_PRACTITIONER'] + ) + if nurses: + transport_team_members = random.sample(list(nurses), min(2, nurses.count())) + transfer = Transfer.objects.create( transfer_id=uuid.uuid4(), admission=admission, @@ -424,6 +449,7 @@ def create_saudi_transfers(admissions): from_bed=admission.current_bed, to_ward=to_ward, to_bed=to_bed, + requested_by=requested_by, # Add the required field requested_datetime=requested_datetime, scheduled_datetime=scheduled_datetime, actual_datetime=actual_datetime, @@ -435,7 +461,6 @@ def create_saudi_transfers(admissions): ]), priority=random.choice(priorities), transport_method=random.choice(transport_methods), - transport_team=['Nursing staff', 'Transport aide'] if random.choice([True, False]) else [], equipment_needed=['IV pole', 'Oxygen tank', 'Monitor'] if random.choice([True, False]) else [], supplies_needed=['Medications', 'Patient chart', 'Personal items'] if random.choice([True, False]) else [], patient_condition=random.choice(['stable', 'unstable', 'critical', 'improving']), @@ -455,6 +480,10 @@ def create_saudi_transfers(admissions): updated_at=requested_datetime + timedelta(hours=random.randint(1, 24)) ) + # Set transport team using .set() method for many-to-many relationship + if transport_team_members: + transfer.transport_team.set(transport_team_members) + # Update admission current location if transfer completed if status == 'completed': admission.current_ward = to_ward @@ -570,7 +599,7 @@ def create_saudi_discharge_summaries(admissions): social_worker_involved=random.choice([True, False]), case_manager_involved=random.choice([True, False]), readmission_risk=random.choice(['low', 'moderate', 'high']), - patient_satisfaction=random.choice(['excellent', 'good', 'fair', 'poor']), + patient_satisfaction=random.randint(1, 5), # Changed to numeric scale (1-5) discharging_physician=admission.attending_physician, summary_completed=True, summary_signed=True, @@ -623,12 +652,14 @@ def create_saudi_surgery_schedules(tenants, surgeries_per_tenant=30): nurses = list(User.objects.filter(tenant=tenant, role__in=['NURSE', 'NURSE_PRACTITIONER'])) admissions = list(Admission.objects.filter(tenant=tenant, status='active')) - if not patients or not surgeons or not nurses: + if not patients or not surgeons or not nurses or not admissions: + print(f"Insufficient data for tenant {tenant.name}: patients={len(patients)}, surgeons={len(surgeons)}, nurses={len(nurses)}, admissions={len(admissions)}") continue - for i in range(surgeries_per_tenant): - patient = random.choice(patients) - admission = random.choice(admissions) if admissions and random.choice([True, False]) else None + for i in range(min(surgeries_per_tenant, len(admissions))): # Don't exceed available admissions + # Always use an admission - required field + admission = random.choice(admissions) + patient = admission.patient # Use patient from the admission procedure = random.choice(SAUDI_SURGICAL_PROCEDURES) # Generate surgery date (within next 30 days) @@ -653,7 +684,7 @@ def create_saudi_surgery_schedules(tenants, surgeries_per_tenant=30): tenant=tenant, surgery_id=uuid.uuid4(), patient=patient, - admission=admission, + admission=admission, # Always provide admission - required field procedure_name=procedure, procedure_code=f"CPT-{random.randint(10000, 99999)}", surgery_type=random.choice(surgery_types)[0], @@ -693,14 +724,14 @@ def create_saudi_surgery_schedules(tenants, surgeries_per_tenant=30): updated_at=django_timezone.now() - timedelta(hours=random.randint(1, 24)) ) - # Set assistant surgeons + # Set assistant surgeons using .set() method for many-to-many relationship assistant_surgeons = random.sample(surgeons, random.randint(0, 2)) if assistant_surgeons: surgery.assistant_surgeons.set(assistant_surgeons) surgeries.append(surgery) - print(f"Created {surgeries_per_tenant} surgeries for {tenant.name}") + print(f"Created {min(surgeries_per_tenant, len(admissions))} surgeries for {tenant.name}") return surgeries diff --git a/logs/hospital_management.log b/logs/hospital_management.log index b052820c..1efcb12a 100644 --- a/logs/hospital_management.log +++ b/logs/hospital_management.log @@ -70282,3 +70282,1278 @@ django.urls.exceptions.NoReverseMatch: Reverse for 'adjust_inventory' with argum ERROR 2025-08-14 18:03:03,399 basehttp 92441 6159364096 "GET /en/pharmacy/inventory/4226/ HTTP/1.1" 500 208579 INFO 2025-08-14 18:04:07,714 basehttp 92441 6159364096 "GET /en/pharmacy/inventory/4226/ HTTP/1.1" 200 90337 INFO 2025-08-14 18:04:07,762 basehttp 92441 6159364096 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:07:13,733 autoreload 94515 8601149632 Watching for file changes with StatReloader +INFO 2025-08-14 18:07:16,074 basehttp 94515 6126350336 "GET /en/pharmacy/inventory/4226/ HTTP/1.1" 200 90337 +INFO 2025-08-14 18:07:16,107 basehttp 94515 6126350336 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:07:18,263 basehttp 94515 6126350336 "GET /en/pharmacy/inventory/ HTTP/1.1" 200 117825 +INFO 2025-08-14 18:07:18,302 basehttp 94515 6126350336 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:08:18,301 basehttp 94515 6126350336 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:08:31,201 basehttp 94515 6126350336 "GET /en/pharmacy/inventory/ HTTP/1.1" 200 117825 +INFO 2025-08-14 18:08:31,243 basehttp 94515 6126350336 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:09:31,251 basehttp 94515 6126350336 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:09:35,795 basehttp 94515 6126350336 "GET /en/pharmacy/inventory/ HTTP/1.1" 200 118015 +INFO 2025-08-14 18:09:35,837 basehttp 94515 6126350336 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:10:35,843 basehttp 94515 6126350336 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:11:35,849 basehttp 94515 6126350336 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:12:22,449 basehttp 94515 6126350336 "GET /en/pharmacy/inventory/ HTTP/1.1" 200 118015 +INFO 2025-08-14 18:12:22,487 basehttp 94515 6126350336 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:12:28,555 basehttp 94515 6126350336 "GET /en/pharmacy/inventory/ HTTP/1.1" 200 118015 +INFO 2025-08-14 18:12:28,596 basehttp 94515 6126350336 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:12:40,231 basehttp 94515 6126350336 "GET /en/pharmacy/inventory/ HTTP/1.1" 200 118015 +INFO 2025-08-14 18:12:40,270 basehttp 94515 6126350336 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:13:14,334 basehttp 94515 6126350336 "GET /en/pharmacy/inventory/ HTTP/1.1" 200 118071 +INFO 2025-08-14 18:13:14,376 basehttp 94515 6126350336 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:14:05,964 basehttp 94515 6126350336 "GET /en/pharmacy/inventory/ HTTP/1.1" 200 118070 +INFO 2025-08-14 18:14:05,997 basehttp 94515 6126350336 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:14:23,546 basehttp 94515 6126350336 "GET /en/pharmacy/inventory/ HTTP/1.1" 200 118305 +INFO 2025-08-14 18:14:23,587 basehttp 94515 6126350336 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:15:23,597 basehttp 94515 6126350336 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:16:23,599 basehttp 94515 6126350336 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:17:23,597 basehttp 94515 6126350336 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:18:23,601 basehttp 94515 6126350336 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:18:56,014 basehttp 94515 6126350336 "GET /en/pharmacy/inventory/ HTTP/1.1" 200 119669 +INFO 2025-08-14 18:18:56,058 basehttp 94515 6126350336 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:19:56,067 basehttp 94515 6126350336 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:20:56,067 basehttp 94515 6126350336 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:21:56,069 basehttp 94515 6126350336 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:22:10,417 basehttp 94515 6126350336 "GET /en/pharmacy/inventory/ HTTP/1.1" 200 118437 +INFO 2025-08-14 18:22:10,458 basehttp 94515 6126350336 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:23:10,459 basehttp 94515 6126350336 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:23:11,332 basehttp 94515 6126350336 "GET /en/pharmacy/inventory/ HTTP/1.1" 200 118853 +INFO 2025-08-14 18:23:11,375 basehttp 94515 6126350336 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:24:11,374 basehttp 94515 6126350336 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:24:50,538 basehttp 94515 6126350336 "GET /en/pharmacy/inventory/ HTTP/1.1" 200 120345 +INFO 2025-08-14 18:24:50,573 basehttp 94515 6126350336 "GET /static/css/saudiriyalsymbol.woff2 HTTP/1.1" 200 720 +INFO 2025-08-14 18:24:50,580 basehttp 94515 6143176704 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:25:35,409 basehttp 94515 6143176704 "GET /en/pharmacy/inventory/ HTTP/1.1" 200 120505 +INFO 2025-08-14 18:25:35,440 basehttp 94515 6143176704 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:25:48,073 basehttp 94515 6143176704 "GET /en/pharmacy/inventory/ HTTP/1.1" 200 120285 +INFO 2025-08-14 18:25:48,104 basehttp 94515 6143176704 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:26:00,143 basehttp 94515 6143176704 "GET /en/pharmacy/inventory/ HTTP/1.1" 200 120345 +INFO 2025-08-14 18:26:00,174 basehttp 94515 6143176704 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:27:00,174 basehttp 94515 6143176704 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:27:07,730 basehttp 94515 6143176704 "GET /en/pharmacy/inventory/ HTTP/1.1" 200 120348 +INFO 2025-08-14 18:27:07,767 basehttp 94515 6143176704 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:27:14,912 basehttp 94515 6143176704 "GET /en/pharmacy/inventory/4226/ HTTP/1.1" 200 90337 +INFO 2025-08-14 18:27:14,948 basehttp 94515 6143176704 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:27:23,419 basehttp 94515 6143176704 "GET /en/pharmacy/inventory/4226/ HTTP/1.1" 200 90337 +INFO 2025-08-14 18:27:23,454 basehttp 94515 6143176704 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:27:39,765 basehttp 94515 6143176704 "GET /en/pharmacy/inventory/4226/ HTTP/1.1" 200 90337 +INFO 2025-08-14 18:27:39,803 basehttp 94515 6143176704 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:27:52,101 basehttp 94515 6143176704 "GET /en/pharmacy/inventory/?page=2 HTTP/1.1" 200 120827 +INFO 2025-08-14 18:27:52,138 basehttp 94515 6143176704 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:28:10,214 basehttp 94515 6143176704 "GET /en/pharmacy/inventory/?page=3 HTTP/1.1" 200 120959 +INFO 2025-08-14 18:28:10,253 basehttp 94515 6143176704 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:29:02,843 basehttp 94515 6143176704 "GET /en/pharmacy/inventory/?page=3 HTTP/1.1" 200 120443 +INFO 2025-08-14 18:29:02,885 basehttp 94515 6143176704 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:29:16,386 basehttp 94515 6143176704 "GET /en/pharmacy/inventory/?page=5 HTTP/1.1" 200 120365 +INFO 2025-08-14 18:29:16,423 basehttp 94515 6143176704 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:29:23,993 basehttp 94515 6143176704 "GET /en/pharmacy/inventory/?page=6 HTTP/1.1" 200 120786 +INFO 2025-08-14 18:29:24,030 basehttp 94515 6143176704 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:29:26,083 basehttp 94515 6143176704 "GET /en/pharmacy/inventory/?page=7 HTTP/1.1" 200 120234 +INFO 2025-08-14 18:29:26,121 basehttp 94515 6143176704 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:29:28,559 basehttp 94515 6143176704 "GET /en/pharmacy/inventory/?page=9 HTTP/1.1" 200 120552 +INFO 2025-08-14 18:29:28,595 basehttp 94515 6143176704 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:29:30,894 basehttp 94515 6143176704 "GET /en/pharmacy/inventory/?page=31 HTTP/1.1" 200 103204 +INFO 2025-08-14 18:29:30,933 basehttp 94515 6143176704 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:29:44,193 basehttp 94515 6143176704 "GET /en/pharmacy/inventory/?page=1 HTTP/1.1" 200 119846 +INFO 2025-08-14 18:29:44,232 basehttp 94515 6143176704 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-14 18:29:58,300 basehttp 94515 6143176704 "GET /en/pharmacy/inventory/4485/ HTTP/1.1" 200 90360 +INFO 2025-08-14 18:29:58,337 basehttp 94515 6143176704 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +ERROR 2025-08-14 18:30:13,047 log 94515 6143176704 Internal Server Error: /en/pharmacy/prescriptions/create/ +Traceback (most recent call last): + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 220, in _get_response + response = response.render() + ^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/response.py", line 114, in render + self.content = self.rendered_content + ^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/response.py", line 92, in rendered_content + return template.render(context, self._request) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/backends/django.py", line 107, in render + return self.template.render(context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 171, in render + return self._render(context) + ^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 163, in _render + return self.nodelist.render(context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 1016, in render + return SafeString("".join([node.render_annotated(context) for node in self])) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 977, in render_annotated + return self.render(context) + ^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/loader_tags.py", line 159, in render + return compiled_parent._render(context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 163, in _render + return self.nodelist.render(context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 1016, in render + return SafeString("".join([node.render_annotated(context) for node in self])) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 977, in render_annotated + return self.render(context) + ^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/loader_tags.py", line 65, in render + result = block.nodelist.render(context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 1016, in render + return SafeString("".join([node.render_annotated(context) for node in self])) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 977, in render_annotated + return self.render(context) + ^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/defaulttags.py", line 480, in render + url = reverse(view_name, args=args, kwargs=kwargs, current_app=current_app) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/urls/base.py", line 98, in reverse + resolved_url = resolver._reverse_with_prefix(view, prefix, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/urls/resolvers.py", line 831, in _reverse_with_prefix + raise NoReverseMatch(msg) +django.urls.exceptions.NoReverseMatch: Reverse for 'get_patient_info' not found. 'get_patient_info' is not a valid view function or pattern name. +ERROR 2025-08-14 18:30:13,049 basehttp 94515 6143176704 "GET /en/pharmacy/prescriptions/create/ HTTP/1.1" 500 184320 +ERROR 2025-08-14 18:30:26,139 log 94515 6143176704 Internal Server Error: /en/pharmacy/medications/create/ +Traceback (most recent call last): + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 220, in _get_response + response = response.render() + ^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/response.py", line 114, in render + self.content = self.rendered_content + ^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/response.py", line 92, in rendered_content + return template.render(context, self._request) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/backends/django.py", line 107, in render + return self.template.render(context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 171, in render + return self._render(context) + ^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 163, in _render + return self.nodelist.render(context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 1016, in render + return SafeString("".join([node.render_annotated(context) for node in self])) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 977, in render_annotated + return self.render(context) + ^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/loader_tags.py", line 159, in render + return compiled_parent._render(context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 163, in _render + return self.nodelist.render(context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 1016, in render + return SafeString("".join([node.render_annotated(context) for node in self])) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 977, in render_annotated + return self.render(context) + ^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/loader_tags.py", line 65, in render + result = block.nodelist.render(context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 1016, in render + return SafeString("".join([node.render_annotated(context) for node in self])) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 977, in render_annotated + return self.render(context) + ^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/defaulttags.py", line 480, in render + url = reverse(view_name, args=args, kwargs=kwargs, current_app=current_app) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/urls/base.py", line 98, in reverse + resolved_url = resolver._reverse_with_prefix(view, prefix, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/urls/resolvers.py", line 831, in _reverse_with_prefix + raise NoReverseMatch(msg) +django.urls.exceptions.NoReverseMatch: Reverse for 'validate_ndc' not found. 'validate_ndc' is not a valid view function or pattern name. +ERROR 2025-08-14 18:30:26,140 basehttp 94515 6143176704 "GET /en/pharmacy/medications/create/ HTTP/1.1" 500 179536 +ERROR 2025-08-14 18:30:34,578 log 94515 6143176704 Internal Server Error: /en/pharmacy/inventory/create/ +Traceback (most recent call last): + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 197, in _get_response + response = wrapped_callback(request, *callback_args, **callback_kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/views/generic/base.py", line 105, in view + return self.dispatch(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/contrib/auth/mixins.py", line 73, in dispatch + return super().dispatch(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/views/generic/base.py", line 144, in dispatch + return handler(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/views/generic/edit.py", line 178, in get + return super().get(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/views/generic/edit.py", line 142, in get + return self.render_to_response(self.get_context_data()) + ^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/views/generic/edit.py", line 72, in get_context_data + kwargs["form"] = self.get_form() + ^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/views/generic/edit.py", line 37, in get_form + return form_class(**self.get_form_kwargs()) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +TypeError: BaseModelForm.__init__() got an unexpected keyword argument 'user' +ERROR 2025-08-14 18:30:34,579 basehttp 94515 6143176704 "GET /en/pharmacy/inventory/create/ HTTP/1.1" 500 94423 +WARNING 2025-08-14 18:30:38,386 log 94515 6143176704 Not Found: /en/pharmacy/pharmacy/drug-interaction-check/undefined/ +WARNING 2025-08-14 18:30:38,386 basehttp 94515 6143176704 "GET /en/pharmacy/pharmacy/drug-interaction-check/undefined/ HTTP/1.1" 404 38634 +ERROR 2025-08-14 18:30:44,391 log 94515 6143176704 Internal Server Error: /en/pharmacy/stats/ +Traceback (most recent call last): + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 197, in _get_response + response = wrapped_callback(request, *callback_args, **callback_kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/contrib/auth/decorators.py", line 59, in _view_wrapper + return view_func(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/pharmacy/views.py", line 682, in pharmacy_stats + 'low_stock_items': InventoryItem.objects.filter( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/manager.py", line 87, in manager_method + return getattr(self.get_queryset(), name)(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 1493, in filter + return self._filter_or_exclude(False, args, kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 1511, in _filter_or_exclude + clone._filter_or_exclude_inplace(negate, args, kwargs) + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 1518, in _filter_or_exclude_inplace + self._query.add_q(Q(*args, **kwargs)) + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1646, in add_q + clause, _ = self._add_q(q_object, can_reuse) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1678, in _add_q + child_clause, needed_inner = self.build_filter( + ^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1526, in build_filter + lookups, parts, reffed_expression = self.solve_lookup_type(arg, summarize) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1333, in solve_lookup_type + _, field, _, lookup_parts = self.names_to_path(lookup_splitted, self.get_meta()) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1805, in names_to_path + raise FieldError( +django.core.exceptions.FieldError: Cannot resolve keyword 'current_stock' into field. Choices are: bin_location, created_at, created_by, created_by_id, dispense_records, expiration_date, id, inventory_id, last_counted, lot_number, medication, medication_id, purchase_order_number, quality_check_date, quality_checked, quality_notes, quantity_allocated, quantity_available, quantity_on_hand, received_date, reorder_point, reorder_quantity, status, storage_location, supplier, tenant, tenant_id, total_cost, unit_cost, updated_at +ERROR 2025-08-14 18:30:44,392 basehttp 94515 6143176704 "GET /en/pharmacy/stats/ HTTP/1.1" 500 125246 +INFO 2025-08-14 18:30:45,745 basehttp 94515 6143176704 "GET /en/pharmacy/ HTTP/1.1" 200 33888 +INFO 2025-08-14 18:30:45,798 basehttp 94515 6143176704 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +ERROR 2025-08-14 18:30:45,848 log 94515 6160003072 Internal Server Error: /en/pharmacy/inventory-alerts/ +Traceback (most recent call last): + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 197, in _get_response + response = wrapped_callback(request, *callback_args, **callback_kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/contrib/auth/decorators.py", line 59, in _view_wrapper + return view_func(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/pharmacy/views.py", line 737, in inventory_alerts + low_stock = InventoryItem.objects.filter( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/manager.py", line 87, in manager_method + return getattr(self.get_queryset(), name)(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 1493, in filter + return self._filter_or_exclude(False, args, kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 1511, in _filter_or_exclude + clone._filter_or_exclude_inplace(negate, args, kwargs) + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 1518, in _filter_or_exclude_inplace + self._query.add_q(Q(*args, **kwargs)) + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1646, in add_q + clause, _ = self._add_q(q_object, can_reuse) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1678, in _add_q + child_clause, needed_inner = self.build_filter( + ^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1526, in build_filter + lookups, parts, reffed_expression = self.solve_lookup_type(arg, summarize) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1333, in solve_lookup_type + _, field, _, lookup_parts = self.names_to_path(lookup_splitted, self.get_meta()) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1805, in names_to_path + raise FieldError( +django.core.exceptions.FieldError: Cannot resolve keyword 'current_stock' into field. Choices are: bin_location, created_at, created_by, created_by_id, dispense_records, expiration_date, id, inventory_id, last_counted, lot_number, medication, medication_id, purchase_order_number, quality_check_date, quality_checked, quality_notes, quantity_allocated, quantity_available, quantity_on_hand, received_date, reorder_point, reorder_quantity, status, storage_location, supplier, tenant, tenant_id, total_cost, unit_cost, updated_at +ERROR 2025-08-14 18:30:45,851 basehttp 94515 6160003072 "GET /en/pharmacy/inventory-alerts/ HTTP/1.1" 500 125429 +ERROR 2025-08-14 18:30:45,857 log 94515 6126350336 Internal Server Error: /en/pharmacy/stats/ +Traceback (most recent call last): + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 197, in _get_response + response = wrapped_callback(request, *callback_args, **callback_kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/contrib/auth/decorators.py", line 59, in _view_wrapper + return view_func(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/pharmacy/views.py", line 682, in pharmacy_stats + 'low_stock_items': InventoryItem.objects.filter( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/manager.py", line 87, in manager_method + return getattr(self.get_queryset(), name)(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 1493, in filter + return self._filter_or_exclude(False, args, kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 1511, in _filter_or_exclude + clone._filter_or_exclude_inplace(negate, args, kwargs) + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 1518, in _filter_or_exclude_inplace + self._query.add_q(Q(*args, **kwargs)) + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1646, in add_q + clause, _ = self._add_q(q_object, can_reuse) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1678, in _add_q + child_clause, needed_inner = self.build_filter( + ^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1526, in build_filter + lookups, parts, reffed_expression = self.solve_lookup_type(arg, summarize) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1333, in solve_lookup_type + _, field, _, lookup_parts = self.names_to_path(lookup_splitted, self.get_meta()) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1805, in names_to_path + raise FieldError( +django.core.exceptions.FieldError: Cannot resolve keyword 'current_stock' into field. Choices are: bin_location, created_at, created_by, created_by_id, dispense_records, expiration_date, id, inventory_id, last_counted, lot_number, medication, medication_id, purchase_order_number, quality_check_date, quality_checked, quality_notes, quantity_allocated, quantity_available, quantity_on_hand, received_date, reorder_point, reorder_quantity, status, storage_location, supplier, tenant, tenant_id, total_cost, unit_cost, updated_at +ERROR 2025-08-14 18:30:45,858 basehttp 94515 6126350336 "GET /en/pharmacy/stats/ HTTP/1.1" 500 125246 +INFO 2025-08-14 18:30:51,241 basehttp 94515 6126350336 "GET /en/pharmacy/ HTTP/1.1" 200 33888 +INFO 2025-08-14 18:30:51,287 basehttp 94515 6126350336 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +ERROR 2025-08-14 18:30:51,345 log 94515 6160003072 Internal Server Error: /en/pharmacy/stats/ +Traceback (most recent call last): + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 197, in _get_response + response = wrapped_callback(request, *callback_args, **callback_kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/contrib/auth/decorators.py", line 59, in _view_wrapper + return view_func(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/pharmacy/views.py", line 682, in pharmacy_stats + 'low_stock_items': InventoryItem.objects.filter( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/manager.py", line 87, in manager_method + return getattr(self.get_queryset(), name)(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 1493, in filter + return self._filter_or_exclude(False, args, kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 1511, in _filter_or_exclude + clone._filter_or_exclude_inplace(negate, args, kwargs) + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 1518, in _filter_or_exclude_inplace + self._query.add_q(Q(*args, **kwargs)) + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1646, in add_q + clause, _ = self._add_q(q_object, can_reuse) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1678, in _add_q + child_clause, needed_inner = self.build_filter( + ^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1526, in build_filter + lookups, parts, reffed_expression = self.solve_lookup_type(arg, summarize) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1333, in solve_lookup_type + _, field, _, lookup_parts = self.names_to_path(lookup_splitted, self.get_meta()) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1805, in names_to_path + raise FieldError( +django.core.exceptions.FieldError: Cannot resolve keyword 'current_stock' into field. Choices are: bin_location, created_at, created_by, created_by_id, dispense_records, expiration_date, id, inventory_id, last_counted, lot_number, medication, medication_id, purchase_order_number, quality_check_date, quality_checked, quality_notes, quantity_allocated, quantity_available, quantity_on_hand, received_date, reorder_point, reorder_quantity, status, storage_location, supplier, tenant, tenant_id, total_cost, unit_cost, updated_at +ERROR 2025-08-14 18:30:51,347 basehttp 94515 6160003072 "GET /en/pharmacy/stats/ HTTP/1.1" 500 125246 +ERROR 2025-08-14 18:30:51,351 log 94515 6143176704 Internal Server Error: /en/pharmacy/inventory-alerts/ +Traceback (most recent call last): + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 197, in _get_response + response = wrapped_callback(request, *callback_args, **callback_kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/contrib/auth/decorators.py", line 59, in _view_wrapper + return view_func(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/pharmacy/views.py", line 737, in inventory_alerts + low_stock = InventoryItem.objects.filter( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/manager.py", line 87, in manager_method + return getattr(self.get_queryset(), name)(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 1493, in filter + return self._filter_or_exclude(False, args, kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 1511, in _filter_or_exclude + clone._filter_or_exclude_inplace(negate, args, kwargs) + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 1518, in _filter_or_exclude_inplace + self._query.add_q(Q(*args, **kwargs)) + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1646, in add_q + clause, _ = self._add_q(q_object, can_reuse) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1678, in _add_q + child_clause, needed_inner = self.build_filter( + ^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1526, in build_filter + lookups, parts, reffed_expression = self.solve_lookup_type(arg, summarize) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1333, in solve_lookup_type + _, field, _, lookup_parts = self.names_to_path(lookup_splitted, self.get_meta()) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1805, in names_to_path + raise FieldError( +django.core.exceptions.FieldError: Cannot resolve keyword 'current_stock' into field. Choices are: bin_location, created_at, created_by, created_by_id, dispense_records, expiration_date, id, inventory_id, last_counted, lot_number, medication, medication_id, purchase_order_number, quality_check_date, quality_checked, quality_notes, quantity_allocated, quantity_available, quantity_on_hand, received_date, reorder_point, reorder_quantity, status, storage_location, supplier, tenant, tenant_id, total_cost, unit_cost, updated_at +ERROR 2025-08-14 18:30:51,352 basehttp 94515 6143176704 "GET /en/pharmacy/inventory-alerts/ HTTP/1.1" 500 125429 +ERROR 2025-08-14 18:31:00,977 log 94515 6143176704 Internal Server Error: /en/pharmacy/medications/ +Traceback (most recent call last): + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 197, in _get_response + response = wrapped_callback(request, *callback_args, **callback_kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/views/generic/base.py", line 105, in view + return self.dispatch(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/contrib/auth/mixins.py", line 73, in dispatch + return super().dispatch(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/views/generic/base.py", line 144, in dispatch + return handler(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/views/generic/list.py", line 158, in get + self.object_list = self.get_queryset() + ^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/pharmacy/views.py", line 396, in get_queryset + return queryset.order_by('name') + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 1722, in order_by + obj.query.add_ordering(*field_names) + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 2291, in add_ordering + self.names_to_path(item.split(LOOKUP_SEP), self.model._meta) + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1805, in names_to_path + raise FieldError( +django.core.exceptions.FieldError: Cannot resolve keyword 'name' into field. Choices are: administration_instructions, adult_dose_range, awp, brand_name, contraindications, controlled_substance_schedule, created_at, created_by, created_by_id, dosage_form, drug_class, formulary_status, generic_name, id, indications, interactions_as_drug1, interactions_as_drug2, inventory_items, is_active, is_available, manufacturer, manufacturer_ndc, max_daily_dose, medication_id, ndc_number, pediatric_dose_range, prescriptions, routes_of_administration, rxcui, side_effects, special_handling, storage_requirements, strength, tenant, tenant_id, unit_cost, unit_of_measure, updated_at, warnings +ERROR 2025-08-14 18:31:00,978 basehttp 94515 6143176704 "GET /en/pharmacy/medications/ HTTP/1.1" 500 108165 +INFO 2025-08-14 18:31:31,357 autoreload 94515 8601149632 /Users/marwanalwali/manus_project/hospital_management_system_v4/pharmacy/views.py changed, reloading. +INFO 2025-08-14 18:31:31,698 autoreload 5693 8601149632 Watching for file changes with StatReloader +ERROR 2025-08-14 18:31:32,630 log 5693 6166376448 Internal Server Error: /en/pharmacy/medications/ +Traceback (most recent call last): + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/options.py", line 683, in get_field + return self.fields_map[field_name] + ~~~~~~~~~~~~~~~^^^^^^^^^^^^ +KeyError: 'medication_type' + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 197, in _get_response + response = wrapped_callback(request, *callback_args, **callback_kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/views/generic/base.py", line 105, in view + return self.dispatch(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/contrib/auth/mixins.py", line 73, in dispatch + return super().dispatch(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/views/generic/base.py", line 144, in dispatch + return handler(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/views/generic/list.py", line 178, in get + context = self.get_context_data() + ^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/pharmacy/views.py", line 401, in get_context_data + 'medication_types': Medication._meta.get_field('medication_type').choices, + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/options.py", line 685, in get_field + raise FieldDoesNotExist( +django.core.exceptions.FieldDoesNotExist: Medication has no field named 'medication_type' +ERROR 2025-08-14 18:31:32,631 basehttp 5693 6166376448 "GET /en/pharmacy/medications/ HTTP/1.1" 500 97137 +INFO 2025-08-15 13:02:14,855 autoreload 68589 8601149632 Watching for file changes with StatReloader +INFO 2025-08-15 13:02:16,707 basehttp 68589 6200602624 "GET / HTTP/1.1" 302 0 +INFO 2025-08-15 13:02:16,804 basehttp 68589 6200602624 "GET /en/ HTTP/1.1" 200 46418 +INFO 2025-08-15 13:02:16,816 basehttp 68589 6200602624 "GET /static/js/app.min.js HTTP/1.1" 304 0 +INFO 2025-08-15 13:02:16,886 basehttp 68589 6200602624 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 13:02:16,890 basehttp 68589 6251081728 "GET /en/htmx/tenant-info/ HTTP/1.1" 200 1093 +INFO 2025-08-15 13:02:16,891 basehttp 68589 6234255360 "GET /en/htmx/system-health/ HTTP/1.1" 200 1359 +INFO 2025-08-15 13:02:16,893 basehttp 68589 6217428992 "GET /en/htmx/dashboard-stats/ HTTP/1.1" 200 2093 +INFO 2025-08-15 13:02:46,884 basehttp 68589 6217428992 "GET /en/htmx/dashboard-stats/ HTTP/1.1" 200 2093 +INFO 2025-08-15 13:03:16,906 basehttp 68589 6234255360 "GET /en/htmx/system-health/ HTTP/1.1" 200 1359 +INFO 2025-08-15 13:03:16,907 basehttp 68589 6217428992 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 13:03:16,908 basehttp 68589 6251081728 "GET /en/htmx/dashboard-stats/ HTTP/1.1" 200 2093 +INFO 2025-08-15 13:03:37,566 basehttp 68589 6251081728 "GET / HTTP/1.1" 302 0 +INFO 2025-08-15 13:03:37,580 basehttp 68589 6217428992 "GET /en/ HTTP/1.1" 200 46418 +INFO 2025-08-15 13:03:37,637 basehttp 68589 6217428992 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 13:03:37,639 basehttp 68589 6200602624 "GET /en/htmx/system-health/ HTTP/1.1" 200 1359 +INFO 2025-08-15 13:03:37,640 basehttp 68589 6251081728 "GET /en/htmx/tenant-info/ HTTP/1.1" 200 1093 +INFO 2025-08-15 13:03:37,642 basehttp 68589 6234255360 "GET /en/htmx/dashboard-stats/ HTTP/1.1" 200 2093 +INFO 2025-08-15 13:03:44,041 basehttp 68589 6234255360 "GET / HTTP/1.1" 302 0 +INFO 2025-08-15 13:03:44,055 basehttp 68589 6251081728 "GET /en/ HTTP/1.1" 200 46418 +INFO 2025-08-15 13:03:44,108 basehttp 68589 6251081728 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 13:03:44,109 basehttp 68589 6217428992 "GET /en/htmx/system-health/ HTTP/1.1" 200 1359 +INFO 2025-08-15 13:03:44,111 basehttp 68589 6234255360 "GET /en/htmx/tenant-info/ HTTP/1.1" 200 1093 +INFO 2025-08-15 13:03:44,112 basehttp 68589 6200602624 "GET /en/htmx/dashboard-stats/ HTTP/1.1" 200 2093 +INFO 2025-08-15 13:03:56,405 basehttp 68589 6200602624 "GET /en/emr/ HTTP/1.1" 200 71317 +INFO 2025-08-15 13:03:56,453 basehttp 68589 6200602624 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 13:03:56,455 basehttp 68589 6234255360 "GET /en/emr/stats/ HTTP/1.1" 200 2966 +INFO 2025-08-15 13:04:01,465 basehttp 68589 6234255360 "GET /en/inpatients/ HTTP/1.1" 200 41352 +INFO 2025-08-15 13:04:01,503 basehttp 68589 6200602624 "GET /en/inpatients/stats/ HTTP/1.1" 200 2997 +INFO 2025-08-15 13:04:01,503 basehttp 68589 6234255360 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 13:04:01,527 basehttp 68589 6217428992 "GET /en/inpatients/bed-grid/ HTTP/1.1" 200 634395 +INFO 2025-08-15 13:04:09,858 basehttp 68589 6217428992 "GET /en/inpatients/beds/ HTTP/1.1" 200 782135 +INFO 2025-08-15 13:04:09,904 basehttp 68589 6217428992 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 13:04:09,955 basehttp 68589 6217428992 "GET /en/inpatients/beds/ HTTP/1.1" 200 782135 +INFO 2025-08-15 13:04:39,955 basehttp 68589 6217428992 "GET /en/inpatients/beds/ HTTP/1.1" 200 782135 +INFO 2025-08-15 13:05:09,922 basehttp 68589 6217428992 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 13:05:09,968 basehttp 68589 6217428992 "GET /en/inpatients/beds/ HTTP/1.1" 200 782135 +INFO 2025-08-15 13:05:39,993 basehttp 68589 6200602624 "GET /en/inpatients/beds/ HTTP/1.1" 200 782135 +INFO 2025-08-15 13:05:55,116 basehttp 68589 6200602624 "GET /en/inpatients/beds/ HTTP/1.1" 200 782135 +INFO 2025-08-15 13:05:55,169 basehttp 68589 6200602624 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 13:05:55,209 basehttp 68589 6200602624 "GET /en/inpatients/beds/ HTTP/1.1" 200 782135 +INFO 2025-08-15 13:06:25,221 basehttp 68589 6200602624 "GET /en/inpatients/beds/ HTTP/1.1" 200 782135 +INFO 2025-08-15 13:06:55,184 basehttp 68589 6200602624 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 13:06:55,227 basehttp 68589 6217428992 "GET /en/inpatients/beds/ HTTP/1.1" 200 782135 +INFO 2025-08-15 13:07:25,222 basehttp 68589 6217428992 "GET /en/inpatients/beds/ HTTP/1.1" 200 782135 +INFO 2025-08-15 13:07:55,186 basehttp 68589 6217428992 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 13:07:55,231 basehttp 68589 6200602624 "GET /en/inpatients/beds/ HTTP/1.1" 200 782135 +WARNING 2025-08-15 13:08:11,640 log 68589 6200602624 Not Found: /.well-known/appspecific/com.chrome.devtools.json +WARNING 2025-08-15 13:08:11,640 basehttp 68589 6200602624 "GET /.well-known/appspecific/com.chrome.devtools.json HTTP/1.1" 404 2668 +INFO 2025-08-15 13:08:24,234 basehttp 68589 6200602624 "GET /en/inpatients/beds/ HTTP/1.1" 200 782135 +WARNING 2025-08-15 13:08:24,251 log 68589 6217428992 Not Found: /.well-known/appspecific/com.chrome.devtools.json +WARNING 2025-08-15 13:08:24,253 basehttp 68589 6217428992 "GET /.well-known/appspecific/com.chrome.devtools.json HTTP/1.1" 404 2668 +INFO 2025-08-15 13:08:24,312 basehttp 68589 6200602624 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 13:08:24,367 basehttp 68589 6200602624 "GET /en/inpatients/beds/ HTTP/1.1" 200 782135 +INFO 2025-08-15 13:08:25,418 basehttp 68589 6200602624 "GET /en/inpatients/beds/ HTTP/1.1" 200 782135 +WARNING 2025-08-15 13:08:25,433 log 68589 6200602624 Not Found: /.well-known/appspecific/com.chrome.devtools.json +WARNING 2025-08-15 13:08:25,433 basehttp 68589 6200602624 "GET /.well-known/appspecific/com.chrome.devtools.json HTTP/1.1" 404 2668 +INFO 2025-08-15 13:08:25,492 basehttp 68589 6200602624 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 13:08:25,546 basehttp 68589 6200602624 "GET /en/inpatients/beds/ HTTP/1.1" 200 782135 +INFO 2025-08-15 13:08:26,347 basehttp 68589 6200602624 "GET /en/inpatients/beds/ HTTP/1.1" 200 782135 +WARNING 2025-08-15 13:08:26,360 log 68589 6200602624 Not Found: /.well-known/appspecific/com.chrome.devtools.json +WARNING 2025-08-15 13:08:26,360 basehttp 68589 6200602624 "GET /.well-known/appspecific/com.chrome.devtools.json HTTP/1.1" 404 2668 +INFO 2025-08-15 13:08:26,422 basehttp 68589 6200602624 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 13:08:26,464 basehttp 68589 6200602624 "GET /en/inpatients/beds/ HTTP/1.1" 200 782135 +INFO 2025-08-15 13:08:56,491 basehttp 68589 6200602624 "GET /en/inpatients/beds/ HTTP/1.1" 200 782135 +INFO 2025-08-15 13:09:26,439 basehttp 68589 6200602624 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 13:09:26,488 basehttp 68589 6217428992 "GET /en/inpatients/beds/ HTTP/1.1" 200 782135 +INFO 2025-08-15 13:09:53,063 basehttp 68589 6217428992 "GET /en/inpatients/beds/ HTTP/1.1" 200 782091 +WARNING 2025-08-15 13:09:53,079 log 68589 6217428992 Not Found: /.well-known/appspecific/com.chrome.devtools.json +WARNING 2025-08-15 13:09:53,079 basehttp 68589 6217428992 "GET /.well-known/appspecific/com.chrome.devtools.json HTTP/1.1" 404 2668 +INFO 2025-08-15 13:09:53,153 basehttp 68589 6217428992 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 13:09:53,197 basehttp 68589 6217428992 "GET /en/inpatients/beds/ HTTP/1.1" 200 782091 +INFO 2025-08-15 21:33:30,729 autoreload 84287 8601149632 Watching for file changes with StatReloader +INFO 2025-08-15 21:33:32,908 basehttp 84287 6190870528 "GET /en/inpatients/beds/ HTTP/1.1" 200 782091 +INFO 2025-08-15 21:33:33,030 basehttp 84287 6190870528 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +WARNING 2025-08-15 21:33:33,035 log 84287 6207696896 Not Found: /.well-known/appspecific/com.chrome.devtools.json +WARNING 2025-08-15 21:33:33,035 basehttp 84287 6207696896 "GET /.well-known/appspecific/com.chrome.devtools.json HTTP/1.1" 404 2668 +INFO 2025-08-15 21:33:33,076 basehttp 84287 6207696896 "GET /en/inpatients/beds/ HTTP/1.1" 200 782091 +INFO 2025-08-15 21:33:56,809 basehttp 84287 6207696896 "GET /en/inpatients/beds/ HTTP/1.1" 200 779904 +WARNING 2025-08-15 21:33:56,826 log 84287 6207696896 Not Found: /.well-known/appspecific/com.chrome.devtools.json +WARNING 2025-08-15 21:33:56,826 basehttp 84287 6207696896 "GET /.well-known/appspecific/com.chrome.devtools.json HTTP/1.1" 404 2668 +INFO 2025-08-15 21:33:56,933 basehttp 84287 6207696896 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 21:33:56,973 basehttp 84287 6190870528 "GET /en/inpatients/beds/ HTTP/1.1" 200 779904 +INFO 2025-08-15 21:34:26,969 basehttp 84287 6190870528 "GET /en/inpatients/beds/ HTTP/1.1" 200 779904 +INFO 2025-08-15 21:34:56,926 basehttp 84287 6190870528 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 21:34:56,965 basehttp 84287 6190870528 "GET /en/inpatients/beds/ HTTP/1.1" 200 779904 +INFO 2025-08-15 21:35:01,748 basehttp 84287 6190870528 "GET /en/inpatients/beds/ HTTP/1.1" 200 782091 +WARNING 2025-08-15 21:35:01,764 log 84287 6190870528 Not Found: /.well-known/appspecific/com.chrome.devtools.json +WARNING 2025-08-15 21:35:01,765 basehttp 84287 6190870528 "GET /.well-known/appspecific/com.chrome.devtools.json HTTP/1.1" 404 2668 +INFO 2025-08-15 21:35:01,827 basehttp 84287 6190870528 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 21:35:01,874 basehttp 84287 6190870528 "GET /en/inpatients/beds/ HTTP/1.1" 200 782091 +INFO 2025-08-15 21:35:31,890 basehttp 84287 6190870528 "GET /en/inpatients/beds/ HTTP/1.1" 200 782091 +INFO 2025-08-15 21:35:38,729 basehttp 84287 6190870528 "GET /en/inpatients/beds/ HTTP/1.1" 200 782097 +WARNING 2025-08-15 21:35:38,743 log 84287 6190870528 Not Found: /.well-known/appspecific/com.chrome.devtools.json +WARNING 2025-08-15 21:35:38,744 basehttp 84287 6190870528 "GET /.well-known/appspecific/com.chrome.devtools.json HTTP/1.1" 404 2668 +INFO 2025-08-15 21:35:38,803 basehttp 84287 6190870528 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 21:35:38,852 basehttp 84287 6190870528 "GET /en/inpatients/beds/ HTTP/1.1" 200 782097 +INFO 2025-08-15 21:36:08,847 basehttp 84287 6190870528 "GET /en/inpatients/beds/ HTTP/1.1" 200 782097 +INFO 2025-08-15 21:36:38,821 basehttp 84287 6190870528 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 21:36:38,865 basehttp 84287 6207696896 "GET /en/inpatients/beds/ HTTP/1.1" 200 782097 +INFO 2025-08-15 21:37:08,845 basehttp 84287 6207696896 "GET /en/inpatients/beds/ HTTP/1.1" 200 782097 +INFO 2025-08-15 21:37:38,848 basehttp 84287 6207696896 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 21:37:38,890 basehttp 84287 6190870528 "GET /en/inpatients/beds/ HTTP/1.1" 200 782097 +INFO 2025-08-15 21:38:08,845 basehttp 84287 6190870528 "GET /en/inpatients/beds/ HTTP/1.1" 200 782097 +INFO 2025-08-15 21:38:38,812 basehttp 84287 6190870528 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 21:38:38,847 basehttp 84287 6190870528 "GET /en/inpatients/beds/ HTTP/1.1" 200 782097 +INFO 2025-08-15 21:39:08,848 basehttp 84287 6190870528 "GET /en/inpatients/beds/ HTTP/1.1" 200 782097 +INFO 2025-08-15 21:39:38,814 basehttp 84287 6190870528 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 21:39:38,848 basehttp 84287 6207696896 "GET /en/inpatients/beds/ HTTP/1.1" 200 782097 +INFO 2025-08-15 21:40:08,848 basehttp 84287 6207696896 "GET /en/inpatients/beds/ HTTP/1.1" 200 782097 +INFO 2025-08-15 21:40:38,821 basehttp 84287 6207696896 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 21:40:38,852 basehttp 84287 6190870528 "GET /en/inpatients/beds/ HTTP/1.1" 200 782097 +INFO 2025-08-15 21:40:56,883 autoreload 84287 8601149632 /Users/marwanalwali/manus_project/hospital_management_system_v4/inpatients/models.py changed, reloading. +INFO 2025-08-15 21:40:57,259 autoreload 87680 8601149632 Watching for file changes with StatReloader +INFO 2025-08-15 21:41:06,660 autoreload 87680 8601149632 /Users/marwanalwali/manus_project/hospital_management_system_v4/inpatients/views.py changed, reloading. +INFO 2025-08-15 21:41:06,902 autoreload 87763 8601149632 Watching for file changes with StatReloader +INFO 2025-08-15 21:41:08,946 basehttp 87763 12901707776 "GET /en/inpatients/beds/ HTTP/1.1" 200 782097 +INFO 2025-08-15 21:41:13,297 basehttp 87763 12901707776 "GET /en/inpatients/beds/ HTTP/1.1" 200 782097 +WARNING 2025-08-15 21:41:13,319 log 87763 12901707776 Not Found: /.well-known/appspecific/com.chrome.devtools.json +WARNING 2025-08-15 21:41:13,319 basehttp 87763 12901707776 "GET /.well-known/appspecific/com.chrome.devtools.json HTTP/1.1" 404 2668 +INFO 2025-08-15 21:41:13,388 basehttp 87763 12901707776 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 21:41:13,442 basehttp 87763 12901707776 "GET /en/inpatients/beds/ HTTP/1.1" 200 782097 +INFO 2025-08-15 21:41:43,461 basehttp 87763 12901707776 "GET /en/inpatients/beds/ HTTP/1.1" 200 782097 +INFO 2025-08-15 21:42:13,404 basehttp 87763 12901707776 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 21:42:13,450 basehttp 87763 12918534144 "GET /en/inpatients/beds/ HTTP/1.1" 200 782097 +INFO 2025-08-15 21:42:43,457 basehttp 87763 12918534144 "GET /en/inpatients/beds/ HTTP/1.1" 200 782097 +INFO 2025-08-15 21:43:13,423 basehttp 87763 12918534144 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 21:43:13,458 basehttp 87763 12901707776 "GET /en/inpatients/beds/ HTTP/1.1" 200 782097 +INFO 2025-08-15 21:43:19,003 basehttp 87763 12901707776 "GET /en/inpatients/beds/ HTTP/1.1" 200 782097 +WARNING 2025-08-15 21:43:19,020 log 87763 12901707776 Not Found: /.well-known/appspecific/com.chrome.devtools.json +WARNING 2025-08-15 21:43:19,020 basehttp 87763 12901707776 "GET /.well-known/appspecific/com.chrome.devtools.json HTTP/1.1" 404 2668 +INFO 2025-08-15 21:43:19,092 basehttp 87763 12901707776 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 21:43:19,136 basehttp 87763 12901707776 "GET /en/inpatients/beds/ HTTP/1.1" 200 782097 +INFO 2025-08-15 21:43:49,164 basehttp 87763 12901707776 "GET /en/inpatients/beds/ HTTP/1.1" 200 782097 +WARNING 2025-08-15 21:43:59,687 log 87763 12901707776 Not Found: /.well-known/appspecific/com.chrome.devtools.json +WARNING 2025-08-15 21:43:59,687 basehttp 87763 12901707776 "GET /.well-known/appspecific/com.chrome.devtools.json HTTP/1.1" 404 2668 +INFO 2025-08-15 21:44:29,712 basehttp 87763 12901707776 "GET /en/inpatients/stats/ HTTP/1.1" 200 2997 +INFO 2025-08-15 21:44:59,733 basehttp 87763 12901707776 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 21:44:59,736 basehttp 87763 12935360512 "GET /en/inpatients/stats/ HTTP/1.1" 200 2997 +INFO 2025-08-15 21:44:59,764 basehttp 87763 12918534144 "GET /en/inpatients/bed-grid/ HTTP/1.1" 200 634395 +INFO 2025-08-15 21:45:29,716 basehttp 87763 12918534144 "GET /en/inpatients/stats/ HTTP/1.1" 200 2997 +INFO 2025-08-15 21:45:59,730 basehttp 87763 12935360512 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 21:45:59,732 basehttp 87763 12901707776 "GET /en/inpatients/stats/ HTTP/1.1" 200 2997 +INFO 2025-08-15 21:45:59,760 basehttp 87763 12918534144 "GET /en/inpatients/bed-grid/ HTTP/1.1" 200 634395 +INFO 2025-08-15 21:45:59,792 basehttp 87763 12901707776 "GET /en/inpatients/bed-grid/ HTTP/1.1" 200 634395 +INFO 2025-08-15 21:46:29,718 basehttp 87763 12901707776 "GET /en/inpatients/stats/ HTTP/1.1" 200 2997 +INFO 2025-08-15 21:46:59,738 basehttp 87763 12901707776 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 21:46:59,741 basehttp 87763 12935360512 "GET /en/inpatients/stats/ HTTP/1.1" 200 2997 +INFO 2025-08-15 21:46:59,778 basehttp 87763 12918534144 "GET /en/inpatients/bed-grid/ HTTP/1.1" 200 634395 +INFO 2025-08-15 21:47:06,414 basehttp 87763 12918534144 "GET /en/inpatients/beds/ HTTP/1.1" 200 782097 +WARNING 2025-08-15 21:47:06,428 log 87763 12918534144 Not Found: /.well-known/appspecific/com.chrome.devtools.json +WARNING 2025-08-15 21:47:06,428 basehttp 87763 12918534144 "GET /.well-known/appspecific/com.chrome.devtools.json HTTP/1.1" 404 2668 +INFO 2025-08-15 21:47:06,499 basehttp 87763 12918534144 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 21:47:06,545 basehttp 87763 12918534144 "GET /en/inpatients/beds/ HTTP/1.1" 200 782097 +WARNING 2025-08-15 21:47:08,859 log 87763 12918534144 Not Found: /.well-known/appspecific/com.chrome.devtools.json +WARNING 2025-08-15 21:47:08,859 basehttp 87763 12918534144 "GET /.well-known/appspecific/com.chrome.devtools.json HTTP/1.1" 404 2668 +WARNING 2025-08-15 21:47:08,872 log 87763 12918534144 Not Found: /.well-known/appspecific/com.chrome.devtools.json +WARNING 2025-08-15 21:47:08,872 basehttp 87763 12918534144 "GET /.well-known/appspecific/com.chrome.devtools.json HTTP/1.1" 404 2668 +INFO 2025-08-15 21:47:10,350 basehttp 87763 12918534144 "GET /en/inpatients/transfers/ HTTP/1.1" 200 22259 +WARNING 2025-08-15 21:47:10,366 log 87763 12918534144 Not Found: /.well-known/appspecific/com.chrome.devtools.json +WARNING 2025-08-15 21:47:10,366 basehttp 87763 12918534144 "GET /.well-known/appspecific/com.chrome.devtools.json HTTP/1.1" 404 2668 +INFO 2025-08-15 21:47:10,410 basehttp 87763 12918534144 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +WARNING 2025-08-15 21:47:24,826 log 87763 12918534144 Not Found: /en/inpatients/transfers/create +WARNING 2025-08-15 21:47:24,826 basehttp 87763 12918534144 "GET /en/inpatients/transfers/create HTTP/1.1" 404 39130 +WARNING 2025-08-15 21:47:24,842 log 87763 12918534144 Not Found: /.well-known/appspecific/com.chrome.devtools.json +WARNING 2025-08-15 21:47:24,842 basehttp 87763 12918534144 "GET /.well-known/appspecific/com.chrome.devtools.json HTTP/1.1" 404 2668 +WARNING 2025-08-15 21:47:48,832 log 87763 12918534144 Not Found: /.well-known/appspecific/com.chrome.devtools.json +WARNING 2025-08-15 21:47:48,832 basehttp 87763 12918534144 "GET /.well-known/appspecific/com.chrome.devtools.json HTTP/1.1" 404 2668 +WARNING 2025-08-15 21:47:48,851 log 87763 12918534144 Not Found: /.well-known/appspecific/com.chrome.devtools.json +WARNING 2025-08-15 21:47:48,851 basehttp 87763 12918534144 "GET /.well-known/appspecific/com.chrome.devtools.json HTTP/1.1" 404 2668 +WARNING 2025-08-15 21:48:00,563 log 87763 12918534144 Not Found: /en/transfers/ +WARNING 2025-08-15 21:48:00,564 basehttp 87763 12918534144 "GET /en/transfers/ HTTP/1.1" 404 29874 +WARNING 2025-08-15 21:48:00,583 log 87763 12918534144 Not Found: /.well-known/appspecific/com.chrome.devtools.json +WARNING 2025-08-15 21:48:00,583 basehttp 87763 12918534144 "GET /.well-known/appspecific/com.chrome.devtools.json HTTP/1.1" 404 2668 +INFO 2025-08-15 21:48:16,825 basehttp 87763 12918534144 "GET /en/inpatients/transfers/ HTTP/1.1" 200 22259 +WARNING 2025-08-15 21:48:16,843 log 87763 12918534144 Not Found: /.well-known/appspecific/com.chrome.devtools.json +WARNING 2025-08-15 21:48:16,844 basehttp 87763 12918534144 "GET /.well-known/appspecific/com.chrome.devtools.json HTTP/1.1" 404 2668 +INFO 2025-08-15 21:48:16,886 basehttp 87763 12918534144 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +WARNING 2025-08-15 21:48:22,532 log 87763 12918534144 Not Found: /en/inpatients/transfers/3 +WARNING 2025-08-15 21:48:22,532 basehttp 87763 12918534144 "GET /en/inpatients/transfers/3 HTTP/1.1" 404 39115 +WARNING 2025-08-15 21:48:22,550 log 87763 12918534144 Not Found: /.well-known/appspecific/com.chrome.devtools.json +WARNING 2025-08-15 21:48:22,550 basehttp 87763 12918534144 "GET /.well-known/appspecific/com.chrome.devtools.json HTTP/1.1" 404 2668 +ERROR 2025-08-15 21:48:38,708 log 87763 12918534144 Internal Server Error: /en/pharmacy/medications/ +Traceback (most recent call last): + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/options.py", line 683, in get_field + return self.fields_map[field_name] + ~~~~~~~~~~~~~~~^^^^^^^^^^^^ +KeyError: 'medication_type' + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 197, in _get_response + response = wrapped_callback(request, *callback_args, **callback_kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/views/generic/base.py", line 105, in view + return self.dispatch(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/contrib/auth/mixins.py", line 73, in dispatch + return super().dispatch(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/views/generic/base.py", line 144, in dispatch + return handler(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/views/generic/list.py", line 178, in get + context = self.get_context_data() + ^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/pharmacy/views.py", line 401, in get_context_data + 'medication_types': Medication._meta.get_field('medication_type').choices, + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/options.py", line 685, in get_field + raise FieldDoesNotExist( +django.core.exceptions.FieldDoesNotExist: Medication has no field named 'medication_type' +ERROR 2025-08-15 21:48:38,709 basehttp 87763 12918534144 "GET /en/pharmacy/medications/ HTTP/1.1" 500 97137 +INFO 2025-08-15 21:48:41,684 basehttp 87763 12918534144 "GET /en/pharmacy/ HTTP/1.1" 200 33888 +INFO 2025-08-15 21:48:41,738 basehttp 87763 12918534144 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +ERROR 2025-08-15 21:48:41,798 log 87763 12935360512 Internal Server Error: /en/pharmacy/stats/ +Traceback (most recent call last): + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 197, in _get_response + response = wrapped_callback(request, *callback_args, **callback_kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/contrib/auth/decorators.py", line 59, in _view_wrapper + return view_func(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/pharmacy/views.py", line 682, in pharmacy_stats + 'low_stock_items': InventoryItem.objects.filter( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/manager.py", line 87, in manager_method + return getattr(self.get_queryset(), name)(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 1493, in filter + return self._filter_or_exclude(False, args, kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 1511, in _filter_or_exclude + clone._filter_or_exclude_inplace(negate, args, kwargs) + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 1518, in _filter_or_exclude_inplace + self._query.add_q(Q(*args, **kwargs)) + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1646, in add_q + clause, _ = self._add_q(q_object, can_reuse) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1678, in _add_q + child_clause, needed_inner = self.build_filter( + ^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1526, in build_filter + lookups, parts, reffed_expression = self.solve_lookup_type(arg, summarize) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1333, in solve_lookup_type + _, field, _, lookup_parts = self.names_to_path(lookup_splitted, self.get_meta()) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1805, in names_to_path + raise FieldError( +django.core.exceptions.FieldError: Cannot resolve keyword 'current_stock' into field. Choices are: bin_location, created_at, created_by, created_by_id, dispense_records, expiration_date, id, inventory_id, last_counted, lot_number, medication, medication_id, purchase_order_number, quality_check_date, quality_checked, quality_notes, quantity_allocated, quantity_available, quantity_on_hand, received_date, reorder_point, reorder_quantity, status, storage_location, supplier, tenant, tenant_id, total_cost, unit_cost, updated_at +ERROR 2025-08-15 21:48:41,802 basehttp 87763 12935360512 "GET /en/pharmacy/stats/ HTTP/1.1" 500 125247 +ERROR 2025-08-15 21:48:41,808 log 87763 12901707776 Internal Server Error: /en/pharmacy/inventory-alerts/ +Traceback (most recent call last): + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 197, in _get_response + response = wrapped_callback(request, *callback_args, **callback_kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/contrib/auth/decorators.py", line 59, in _view_wrapper + return view_func(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/pharmacy/views.py", line 737, in inventory_alerts + low_stock = InventoryItem.objects.filter( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/manager.py", line 87, in manager_method + return getattr(self.get_queryset(), name)(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 1493, in filter + return self._filter_or_exclude(False, args, kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 1511, in _filter_or_exclude + clone._filter_or_exclude_inplace(negate, args, kwargs) + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 1518, in _filter_or_exclude_inplace + self._query.add_q(Q(*args, **kwargs)) + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1646, in add_q + clause, _ = self._add_q(q_object, can_reuse) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1678, in _add_q + child_clause, needed_inner = self.build_filter( + ^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1526, in build_filter + lookups, parts, reffed_expression = self.solve_lookup_type(arg, summarize) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1333, in solve_lookup_type + _, field, _, lookup_parts = self.names_to_path(lookup_splitted, self.get_meta()) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1805, in names_to_path + raise FieldError( +django.core.exceptions.FieldError: Cannot resolve keyword 'current_stock' into field. Choices are: bin_location, created_at, created_by, created_by_id, dispense_records, expiration_date, id, inventory_id, last_counted, lot_number, medication, medication_id, purchase_order_number, quality_check_date, quality_checked, quality_notes, quantity_allocated, quantity_available, quantity_on_hand, received_date, reorder_point, reorder_quantity, status, storage_location, supplier, tenant, tenant_id, total_cost, unit_cost, updated_at +ERROR 2025-08-15 21:48:41,809 basehttp 87763 12901707776 "GET /en/pharmacy/inventory-alerts/ HTTP/1.1" 500 125430 +INFO 2025-08-15 21:48:49,407 basehttp 87763 12901707776 "GET /en/admin/patients/patientprofile/ HTTP/1.1" 200 134437 +INFO 2025-08-15 21:48:54,194 basehttp 87763 12901707776 "GET /en/admin/inpatients/admission/ HTTP/1.1" 200 89420 +INFO 2025-08-15 21:48:54,206 basehttp 87763 12901707776 "GET /en/admin/jsi18n/ HTTP/1.1" 200 3342 +INFO 2025-08-15 21:48:58,831 basehttp 87763 12901707776 "GET /en/admin/inpatients/bed/ HTTP/1.1" 200 161748 +INFO 2025-08-15 21:48:58,846 basehttp 87763 12901707776 "GET /en/admin/jsi18n/ HTTP/1.1" 200 3342 +INFO 2025-08-15 21:48:58,858 basehttp 87763 12901707776 "GET /static/admin/img/sorting-icons.svg HTTP/1.1" 200 1097 +ERROR 2025-08-15 21:49:12,763 log 87763 12901707776 Internal Server Error: /en/pharmacy/stats/ +Traceback (most recent call last): + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 197, in _get_response + response = wrapped_callback(request, *callback_args, **callback_kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/contrib/auth/decorators.py", line 59, in _view_wrapper + return view_func(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/pharmacy/views.py", line 682, in pharmacy_stats + 'low_stock_items': InventoryItem.objects.filter( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/manager.py", line 87, in manager_method + return getattr(self.get_queryset(), name)(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 1493, in filter + return self._filter_or_exclude(False, args, kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 1511, in _filter_or_exclude + clone._filter_or_exclude_inplace(negate, args, kwargs) + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/query.py", line 1518, in _filter_or_exclude_inplace + self._query.add_q(Q(*args, **kwargs)) + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1646, in add_q + clause, _ = self._add_q(q_object, can_reuse) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1678, in _add_q + child_clause, needed_inner = self.build_filter( + ^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1526, in build_filter + lookups, parts, reffed_expression = self.solve_lookup_type(arg, summarize) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1333, in solve_lookup_type + _, field, _, lookup_parts = self.names_to_path(lookup_splitted, self.get_meta()) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/db/models/sql/query.py", line 1805, in names_to_path + raise FieldError( +django.core.exceptions.FieldError: Cannot resolve keyword 'current_stock' into field. Choices are: bin_location, created_at, created_by, created_by_id, dispense_records, expiration_date, id, inventory_id, last_counted, lot_number, medication, medication_id, purchase_order_number, quality_check_date, quality_checked, quality_notes, quantity_allocated, quantity_available, quantity_on_hand, received_date, reorder_point, reorder_quantity, status, storage_location, supplier, tenant, tenant_id, total_cost, unit_cost, updated_at +ERROR 2025-08-15 21:49:12,764 basehttp 87763 12901707776 "GET /en/pharmacy/stats/ HTTP/1.1" 500 125247 +INFO 2025-08-15 21:49:16,647 basehttp 87763 12901707776 "GET /en/admin/inpatients/dischargesummary/ HTTP/1.1" 200 70297 +INFO 2025-08-15 21:49:16,659 basehttp 87763 12901707776 "GET /en/admin/jsi18n/ HTTP/1.1" 200 3342 +INFO 2025-08-15 21:49:21,652 basehttp 87763 12901707776 "GET /en/admin/inpatients/surgeryschedule/ HTTP/1.1" 200 70629 +INFO 2025-08-15 21:49:21,666 basehttp 87763 12901707776 "GET /en/admin/jsi18n/ HTTP/1.1" 200 3342 +INFO 2025-08-15 21:49:31,235 basehttp 87763 12901707776 "GET /en/admin/inpatients/transfer/ HTTP/1.1" 200 104775 +INFO 2025-08-15 21:49:31,248 basehttp 87763 12901707776 "GET /en/admin/jsi18n/ HTTP/1.1" 200 3342 +INFO 2025-08-15 21:50:25,608 autoreload 91895 8601149632 Watching for file changes with StatReloader +INFO 2025-08-15 21:50:27,543 basehttp 91895 6195523584 "GET /en/admin/inpatients/transfer/ HTTP/1.1" 200 139385 +INFO 2025-08-15 21:50:27,560 basehttp 91895 6195523584 "GET /en/admin/jsi18n/ HTTP/1.1" 200 3342 +INFO 2025-08-15 22:00:58,330 autoreload 96591 8601149632 Watching for file changes with StatReloader +INFO 2025-08-15 22:01:01,750 basehttp 96591 6161068032 "GET /en/admin/inpatients/transfer/ HTTP/1.1" 200 364213 +INFO 2025-08-15 22:01:01,766 basehttp 96591 6161068032 "GET /en/admin/jsi18n/ HTTP/1.1" 200 3342 +INFO 2025-08-15 22:01:04,142 basehttp 96591 6161068032 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 22:01:05,682 basehttp 96591 6161068032 "GET / HTTP/1.1" 302 0 +INFO 2025-08-15 22:01:05,705 basehttp 96591 6161068032 "GET /en/ HTTP/1.1" 200 46426 +INFO 2025-08-15 22:01:05,760 basehttp 96591 6161068032 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 22:01:05,783 basehttp 96591 13052751872 "GET /en/htmx/system-health/ HTTP/1.1" 200 1359 +INFO 2025-08-15 22:01:05,787 basehttp 96591 13069578240 "GET /en/htmx/tenant-info/ HTTP/1.1" 200 1093 +INFO 2025-08-15 22:01:05,789 basehttp 96591 13035925504 "GET /en/htmx/dashboard-stats/ HTTP/1.1" 200 2093 +INFO 2025-08-15 22:01:09,484 basehttp 96591 13035925504 "GET /en/inpatients/ HTTP/1.1" 200 72042 +INFO 2025-08-15 22:01:09,526 basehttp 96591 13035925504 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 22:01:09,528 basehttp 96591 13069578240 "GET /en/inpatients/stats/ HTTP/1.1" 200 2998 +INFO 2025-08-15 22:01:09,685 basehttp 96591 13052751872 "GET /en/inpatients/bed-grid/ HTTP/1.1" 200 3171121 +ERROR 2025-08-15 22:01:27,400 log 96591 13052751872 Internal Server Error: /en/inpatients/transfers/ +Traceback (most recent call last): + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 220, in _get_response + response = response.render() + ^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/response.py", line 114, in render + self.content = self.rendered_content + ^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/response.py", line 92, in rendered_content + return template.render(context, self._request) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/backends/django.py", line 107, in render + return self.template.render(context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 171, in render + return self._render(context) + ^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 163, in _render + return self.nodelist.render(context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 1016, in render + return SafeString("".join([node.render_annotated(context) for node in self])) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 977, in render_annotated + return self.render(context) + ^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/loader_tags.py", line 159, in render + return compiled_parent._render(context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 163, in _render + return self.nodelist.render(context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 1016, in render + return SafeString("".join([node.render_annotated(context) for node in self])) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 977, in render_annotated + return self.render(context) + ^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/loader_tags.py", line 65, in render + result = block.nodelist.render(context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 1016, in render + return SafeString("".join([node.render_annotated(context) for node in self])) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 977, in render_annotated + return self.render(context) + ^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/defaulttags.py", line 243, in render + nodelist.append(node.render_annotated(context)) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 977, in render_annotated + return self.render(context) + ^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/defaulttags.py", line 327, in render + return nodelist.render(context) + ^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 1016, in render + return SafeString("".join([node.render_annotated(context) for node in self])) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 977, in render_annotated + return self.render(context) + ^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/defaulttags.py", line 480, in render + url = reverse(view_name, args=args, kwargs=kwargs, current_app=current_app) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/urls/base.py", line 98, in reverse + resolved_url = resolver._reverse_with_prefix(view, prefix, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/urls/resolvers.py", line 831, in _reverse_with_prefix + raise NoReverseMatch(msg) +django.urls.exceptions.NoReverseMatch: Reverse for 'cancel_transfer' not found. 'cancel_transfer' is not a valid view function or pattern name. +ERROR 2025-08-15 22:01:27,401 basehttp 96591 13052751872 "GET /en/inpatients/transfers/ HTTP/1.1" 500 262358 +INFO 2025-08-15 22:06:55,506 basehttp 96591 6161068032 "GET /en/inpatients/transfers/ HTTP/1.1" 200 82022 +INFO 2025-08-15 22:06:55,570 basehttp 96591 6161068032 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +WARNING 2025-08-15 22:07:06,458 log 96591 6161068032 Not Found: /en/inpatients/transfers/4 +WARNING 2025-08-15 22:07:06,459 basehttp 96591 6161068032 "GET /en/inpatients/transfers/4 HTTP/1.1" 404 39115 +INFO 2025-08-15 22:07:32,254 basehttp 96591 6161068032 "GET /en/inpatients/wards/ HTTP/1.1" 200 81224 +INFO 2025-08-15 22:07:32,280 basehttp 96591 6161068032 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 22:07:36,838 basehttp 96591 6161068032 "GET /en/inpatients/beds/?ward=525 HTTP/1.1" 200 3764388 +INFO 2025-08-15 22:07:36,980 basehttp 96591 6161068032 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 22:07:37,207 basehttp 96591 6161068032 "GET /en/inpatients/beds/?ward=525 HTTP/1.1" 200 3764388 +INFO 2025-08-15 22:08:32,291 basehttp 96591 6161068032 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 22:09:32,296 basehttp 96591 6161068032 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 22:09:45,184 basehttp 96591 6161068032 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 22:09:46,084 basehttp 96591 6161068032 "GET /en/inpatients/stats/ HTTP/1.1" 200 2998 +INFO 2025-08-15 22:09:46,090 basehttp 96591 13035925504 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 22:09:46,096 basehttp 96591 6161068032 "GET /en/inpatients/stats/ HTTP/1.1" 200 2998 +INFO 2025-08-15 22:09:46,247 basehttp 96591 13052751872 "GET /en/inpatients/bed-grid/ HTTP/1.1" 200 3171121 +INFO 2025-08-15 22:09:46,378 basehttp 96591 6161068032 "GET /en/inpatients/bed-grid/ HTTP/1.1" 200 3171121 +INFO 2025-08-15 22:09:48,302 basehttp 96591 6161068032 "GET /en/inpatients/beds/ HTTP/1.1" 200 3764388 +INFO 2025-08-15 22:09:48,450 basehttp 96591 6161068032 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-15 22:09:48,703 basehttp 96591 6161068032 "GET /en/inpatients/beds/ HTTP/1.1" 200 3764388 +INFO 2025-08-15 22:09:53,942 basehttp 96591 6161068032 "GET /en/inpatients/bed-grid/ HTTP/1.1" 200 3171121 +ERROR 2025-08-15 22:09:59,237 log 96591 6161068032 Internal Server Error: /en/inpatients/admissions/ +Traceback (most recent call last): + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 220, in _get_response + response = response.render() + ^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/response.py", line 114, in render + self.content = self.rendered_content + ^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/response.py", line 92, in rendered_content + return template.render(context, self._request) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/backends/django.py", line 107, in render + return self.template.render(context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 171, in render + return self._render(context) + ^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 163, in _render + return self.nodelist.render(context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 1016, in render + return SafeString("".join([node.render_annotated(context) for node in self])) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 977, in render_annotated + return self.render(context) + ^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/loader_tags.py", line 159, in render + return compiled_parent._render(context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 163, in _render + return self.nodelist.render(context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 1016, in render + return SafeString("".join([node.render_annotated(context) for node in self])) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 977, in render_annotated + return self.render(context) + ^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/loader_tags.py", line 65, in render + result = block.nodelist.render(context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 1016, in render + return SafeString("".join([node.render_annotated(context) for node in self])) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 977, in render_annotated + return self.render(context) + ^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/defaulttags.py", line 243, in render + nodelist.append(node.render_annotated(context)) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/base.py", line 977, in render_annotated + return self.render(context) + ^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/template/defaulttags.py", line 480, in render + url = reverse(view_name, args=args, kwargs=kwargs, current_app=current_app) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/urls/base.py", line 98, in reverse + resolved_url = resolver._reverse_with_prefix(view, prefix, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/urls/resolvers.py", line 831, in _reverse_with_prefix + raise NoReverseMatch(msg) +django.urls.exceptions.NoReverseMatch: Reverse for 'admission_edit' not found. 'admission_edit' is not a valid view function or pattern name. +ERROR 2025-08-15 22:09:59,238 basehttp 96591 6161068032 "GET /en/inpatients/admissions/?action=new HTTP/1.1" 500 257893 +INFO 2025-08-18 20:07:37,870 autoreload 41752 8601149632 Watching for file changes with StatReloader +INFO 2025-08-18 20:07:38,994 basehttp 41752 6203092992 "GET / HTTP/1.1" 302 0 +INFO 2025-08-18 20:07:39,055 basehttp 41752 6219919360 "GET /en/ HTTP/1.1" 302 0 +INFO 2025-08-18 20:07:39,060 basehttp 41752 6219919360 "GET /accounts/login/?next=/en/ HTTP/1.1" 302 0 +ERROR 2025-08-18 20:07:39,074 log 41752 6203092992 Internal Server Error: /en/accounts/login/ +Traceback (most recent call last): + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 197, in _get_response + response = wrapped_callback(request, *callback_args, **callback_kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/views/generic/base.py", line 105, in view + return self.dispatch(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/utils/decorators.py", line 48, in _wrapper + return bound_method(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/allauth/decorators.py", line 12, in wrap + resp = function(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/utils/decorators.py", line 48, in _wrapper + return bound_method(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/utils/decorators.py", line 48, in _wrapper + return bound_method(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/views/decorators/debug.py", line 143, in sensitive_post_parameters_wrapper + return view(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/utils/decorators.py", line 48, in _wrapper + return bound_method(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/views/decorators/cache.py", line 80, in _view_wrapper + response = view_func(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/allauth/account/views.py", line 95, in dispatch + return super().dispatch(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/utils/decorators.py", line 48, in _wrapper + return bound_method(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/utils/decorators.py", line 48, in _wrapper + return bound_method(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/views/decorators/cache.py", line 80, in _view_wrapper + response = view_func(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/allauth/account/mixins.py", line 53, in dispatch + response = super().dispatch(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/views/generic/base.py", line 144, in dispatch + return handler(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/allauth/account/mixins.py", line 72, in get + response = super().get(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/views/generic/edit.py", line 142, in get + return self.render_to_response(self.get_context_data()) + ^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/allauth/account/views.py", line 121, in get_context_data + signup_url = self.passthrough_next_url(reverse("account_signup")) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/allauth/account/mixins.py", line 191, in passthrough_next_url + return passthrough_next_redirect_url( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/allauth/account/utils.py", line 285, in passthrough_next_redirect_url + next_url = get_next_redirect_url(request, redirect_field_name) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/allauth/account/utils.py", line 43, in get_next_redirect_url + if redirect_to and not get_adapter().is_safe_url(redirect_to): + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/allauth/account/adapter.py", line 587, in is_safe_url + allowed_hosts = {context.request.get_host()} | set(settings.ALLOWED_HOSTS) + ^^^^^^^^^^^^^^^^^^^^^^^^ +AttributeError: 'NoneType' object has no attribute 'get_host' +ERROR 2025-08-18 20:07:39,076 basehttp 41752 6203092992 "GET /en/accounts/login/?next=/en/ HTTP/1.1" 500 160351 +INFO 2025-08-18 20:07:44,921 basehttp 41752 6203092992 "GET /en/admin HTTP/1.1" 301 0 +INFO 2025-08-18 20:07:44,952 basehttp 41752 6203092992 "GET /en/admin/ HTTP/1.1" 302 0 +INFO 2025-08-18 20:07:44,964 basehttp 41752 6203092992 "GET /en/admin/login/?next=/en/admin/ HTTP/1.1" 200 4212 +INFO 2025-08-18 20:07:44,972 basehttp 41752 6219919360 "GET /static/admin/css/dark_mode.css HTTP/1.1" 200 2808 +INFO 2025-08-18 20:07:44,972 basehttp 41752 6236745728 "GET /static/admin/js/theme.js HTTP/1.1" 200 1653 +INFO 2025-08-18 20:07:44,972 basehttp 41752 6203092992 "GET /static/admin/css/base.css HTTP/1.1" 200 22120 +INFO 2025-08-18 20:07:44,974 basehttp 41752 6203092992 "GET /static/admin/css/login.css HTTP/1.1" 200 951 +INFO 2025-08-18 20:07:44,974 basehttp 41752 6236745728 "GET /static/admin/css/nav_sidebar.css HTTP/1.1" 200 2810 +INFO 2025-08-18 20:07:44,974 basehttp 41752 6219919360 "GET /static/admin/css/responsive.css HTTP/1.1" 200 16565 +INFO 2025-08-18 20:07:44,975 basehttp 41752 6236745728 "GET /static/admin/js/nav_sidebar.js HTTP/1.1" 200 3063 +INFO 2025-08-18 20:07:47,319 basehttp 41752 6203092992 "POST /en/admin/login/?next=/en/admin/ HTTP/1.1" 302 0 +INFO 2025-08-18 20:07:47,340 basehttp 41752 6203092992 "GET /en/admin/ HTTP/1.1" 200 87876 +INFO 2025-08-18 20:07:47,353 basehttp 41752 6203092992 "GET /static/admin/css/dashboard.css HTTP/1.1" 200 441 +INFO 2025-08-18 20:07:47,354 basehttp 41752 6203092992 "GET /static/admin/img/icon-addlink.svg HTTP/1.1" 200 331 +INFO 2025-08-18 20:07:47,355 basehttp 41752 6219919360 "GET /static/admin/img/icon-changelink.svg HTTP/1.1" 200 380 +INFO 2025-08-18 20:07:51,169 basehttp 41752 6203092992 "GET / HTTP/1.1" 302 0 +INFO 2025-08-18 20:07:51,199 basehttp 41752 6219919360 "GET /en/ HTTP/1.1" 200 46424 +INFO 2025-08-18 20:07:51,209 basehttp 41752 6203092992 "GET /static/img/user/user-4.jpg HTTP/1.1" 200 5916 +INFO 2025-08-18 20:07:51,214 basehttp 41752 6219919360 "GET /static/css/apple/app.min.css HTTP/1.1" 200 898634 +INFO 2025-08-18 20:07:51,244 basehttp 41752 6203092992 "GET /static/img/theme/transparent.jpg HTTP/1.1" 200 32747 +INFO 2025-08-18 20:07:51,245 basehttp 41752 6253572096 "GET /static/img/theme/material.jpg HTTP/1.1" 200 28774 +INFO 2025-08-18 20:07:51,245 basehttp 41752 6219919360 "GET /static/img/theme/default.jpg HTTP/1.1" 200 26964 +INFO 2025-08-18 20:07:51,245 basehttp 41752 6236745728 "GET /static/img/theme/apple.jpg HTTP/1.1" 200 28822 +INFO 2025-08-18 20:07:51,245 basehttp 41752 6270398464 "GET /static/img/theme/facebook.jpg HTTP/1.1" 200 27881 +INFO 2025-08-18 20:07:51,248 basehttp 41752 6203092992 "GET /static/img/version/html.jpg HTTP/1.1" 200 17325 +INFO 2025-08-18 20:07:51,248 basehttp 41752 6253572096 "GET /static/img/version/ajax.jpg HTTP/1.1" 200 20223 +INFO 2025-08-18 20:07:51,248 basehttp 41752 6287224832 "GET /static/img/theme/google.jpg HTTP/1.1" 200 86013 +INFO 2025-08-18 20:07:51,251 basehttp 41752 6219919360 "GET /static/img/version/angular10x.jpg HTTP/1.1" 200 24580 +INFO 2025-08-18 20:07:51,251 basehttp 41752 6270398464 "GET /static/img/version/angular1x.jpg HTTP/1.1" 200 22869 +INFO 2025-08-18 20:07:51,251 basehttp 41752 6287224832 "GET /static/img/version/vuejs.jpg HTTP/1.1" 200 22518 +INFO 2025-08-18 20:07:51,252 basehttp 41752 6236745728 "GET /static/img/version/laravel.jpg HTTP/1.1" 200 26040 +INFO 2025-08-18 20:07:51,252 basehttp 41752 6203092992 "GET /static/img/version/svelte.jpg HTTP/1.1" 200 25060 +INFO 2025-08-18 20:07:51,253 basehttp 41752 6253572096 "GET /static/img/version/django.jpg HTTP/1.1" 200 20935 +INFO 2025-08-18 20:07:51,254 basehttp 41752 6219919360 "GET /static/img/version/reactjs.jpg HTTP/1.1" 200 26850 +INFO 2025-08-18 20:07:51,254 basehttp 41752 6270398464 "GET /static/img/version/dotnet.jpg HTTP/1.1" 200 24791 +INFO 2025-08-18 20:07:51,254 basehttp 41752 6287224832 "GET /static/img/version/nextjs.jpg HTTP/1.1" 200 20152 +INFO 2025-08-18 20:07:51,256 basehttp 41752 6236745728 "GET /static/img/theme/one-page-parallax.jpg HTTP/1.1" 200 22474 +INFO 2025-08-18 20:07:51,256 basehttp 41752 6203092992 "GET /static/img/theme/e-commerce.jpg HTTP/1.1" 200 37734 +INFO 2025-08-18 20:07:51,256 basehttp 41752 6253572096 "GET /static/img/theme/blog.jpg HTTP/1.1" 200 32334 +INFO 2025-08-18 20:07:51,256 basehttp 41752 6270398464 "GET /static/img/theme/forum.jpg HTTP/1.1" 200 28744 +INFO 2025-08-18 20:07:51,257 basehttp 41752 6287224832 "GET /static/img/theme/corporate.jpg HTTP/1.1" 200 38911 +INFO 2025-08-18 20:07:51,291 basehttp 41752 6203092992 "GET /en/htmx/tenant-info/ HTTP/1.1" 200 1093 +INFO 2025-08-18 20:07:51,292 basehttp 41752 6287224832 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-18 20:07:51,294 basehttp 41752 6253572096 "GET /en/htmx/system-health/ HTTP/1.1" 200 1359 +INFO 2025-08-18 20:07:51,295 basehttp 41752 6270398464 "GET /en/htmx/dashboard-stats/ HTTP/1.1" 200 2093 +WARNING 2025-08-18 20:08:15,321 log 41752 6203092992 Not Found: /notifications/api/recent/ +WARNING 2025-08-18 20:08:15,321 basehttp 41752 6203092992 "GET /notifications/api/recent/ HTTP/1.1" 404 2599 +INFO 2025-08-18 20:08:21,285 basehttp 41752 6203092992 "GET /en/htmx/dashboard-stats/ HTTP/1.1" 200 2093 +INFO 2025-08-18 20:08:51,301 basehttp 41752 6203092992 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4439 +INFO 2025-08-18 20:08:51,301 basehttp 41752 6219919360 "GET /en/htmx/system-health/ HTTP/1.1" 200 1359 +INFO 2025-08-18 20:08:51,303 basehttp 41752 6236745728 "GET /en/htmx/dashboard-stats/ HTTP/1.1" 200 2093 +WARNING 2025-08-18 20:09:15,314 log 41752 6203092992 Not Found: /notifications/api/recent/ +WARNING 2025-08-18 20:09:15,315 basehttp 41752 6203092992 "GET /notifications/api/recent/ HTTP/1.1" 404 2599 +INFO 2025-08-19 16:21:12,676 autoreload 86818 8601149632 Watching for file changes with StatReloader +INFO 2025-08-19 16:21:14,346 basehttp 86818 6170161152 "GET / HTTP/1.1" 302 0 +INFO 2025-08-19 16:21:14,431 basehttp 86818 12901707776 "GET /en/ HTTP/1.1" 302 0 +INFO 2025-08-19 16:21:14,436 basehttp 86818 12901707776 "GET /accounts/login/?next=/en/ HTTP/1.1" 302 0 +ERROR 2025-08-19 16:21:14,452 log 86818 6170161152 Internal Server Error: /en/accounts/login/ +Traceback (most recent call last): + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 197, in _get_response + response = wrapped_callback(request, *callback_args, **callback_kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/views/generic/base.py", line 105, in view + return self.dispatch(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/utils/decorators.py", line 48, in _wrapper + return bound_method(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/allauth/decorators.py", line 12, in wrap + resp = function(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/utils/decorators.py", line 48, in _wrapper + return bound_method(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/utils/decorators.py", line 48, in _wrapper + return bound_method(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/views/decorators/debug.py", line 143, in sensitive_post_parameters_wrapper + return view(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/utils/decorators.py", line 48, in _wrapper + return bound_method(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/views/decorators/cache.py", line 80, in _view_wrapper + response = view_func(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/allauth/account/views.py", line 95, in dispatch + return super().dispatch(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/utils/decorators.py", line 48, in _wrapper + return bound_method(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/utils/decorators.py", line 48, in _wrapper + return bound_method(*args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/views/decorators/cache.py", line 80, in _view_wrapper + response = view_func(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/allauth/account/mixins.py", line 53, in dispatch + response = super().dispatch(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/views/generic/base.py", line 144, in dispatch + return handler(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/allauth/account/mixins.py", line 72, in get + response = super().get(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/django/views/generic/edit.py", line 142, in get + return self.render_to_response(self.get_context_data()) + ^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/allauth/account/views.py", line 121, in get_context_data + signup_url = self.passthrough_next_url(reverse("account_signup")) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/allauth/account/mixins.py", line 191, in passthrough_next_url + return passthrough_next_redirect_url( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/allauth/account/utils.py", line 285, in passthrough_next_redirect_url + next_url = get_next_redirect_url(request, redirect_field_name) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/allauth/account/utils.py", line 43, in get_next_redirect_url + if redirect_to and not get_adapter().is_safe_url(redirect_to): + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/Users/marwanalwali/manus_project/hospital_management_system_v4/.venv/lib/python3.12/site-packages/allauth/account/adapter.py", line 587, in is_safe_url + allowed_hosts = {context.request.get_host()} | set(settings.ALLOWED_HOSTS) + ^^^^^^^^^^^^^^^^^^^^^^^^ +AttributeError: 'NoneType' object has no attribute 'get_host' +ERROR 2025-08-19 16:21:14,453 basehttp 86818 6170161152 "GET /en/accounts/login/?next=/en/ HTTP/1.1" 500 160351 +INFO 2025-08-19 16:21:22,533 basehttp 86818 6170161152 "GET /en/admin/ HTTP/1.1" 302 0 +INFO 2025-08-19 16:21:22,546 basehttp 86818 6170161152 "GET /en/admin/login/?next=/en/admin/ HTTP/1.1" 200 4212 +INFO 2025-08-19 16:21:24,753 basehttp 86818 6170161152 "POST /en/admin/login/?next=/en/admin/ HTTP/1.1" 302 0 +INFO 2025-08-19 16:21:24,796 basehttp 86818 6170161152 "GET /en/admin/ HTTP/1.1" 200 87876 +INFO 2025-08-19 16:21:26,625 basehttp 86818 6170161152 "GET / HTTP/1.1" 302 0 +INFO 2025-08-19 16:21:26,655 basehttp 86818 12901707776 "GET /en/ HTTP/1.1" 200 46425 +INFO 2025-08-19 16:21:26,664 basehttp 86818 12901707776 "GET /static/img/user/user-4.jpg HTTP/1.1" 200 5916 +INFO 2025-08-19 16:21:26,689 basehttp 86818 12969013248 "GET /static/img/theme/transparent.jpg HTTP/1.1" 200 32747 +INFO 2025-08-19 16:21:26,689 basehttp 86818 12952186880 "GET /static/img/theme/default.jpg HTTP/1.1" 200 26964 +INFO 2025-08-19 16:21:26,690 basehttp 86818 12969013248 "GET /static/img/theme/apple.jpg HTTP/1.1" 200 28822 +INFO 2025-08-19 16:21:26,690 basehttp 86818 12952186880 "GET /static/img/theme/material.jpg HTTP/1.1" 200 28774 +INFO 2025-08-19 16:21:26,692 basehttp 86818 12969013248 "GET /static/img/theme/facebook.jpg HTTP/1.1" 200 27881 +INFO 2025-08-19 16:21:26,692 basehttp 86818 12952186880 "GET /static/img/theme/google.jpg HTTP/1.1" 200 86013 +INFO 2025-08-19 16:21:26,694 basehttp 86818 12969013248 "GET /static/img/version/html.jpg HTTP/1.1" 200 17325 +INFO 2025-08-19 16:21:26,695 basehttp 86818 12952186880 "GET /static/img/version/ajax.jpg HTTP/1.1" 200 20223 +INFO 2025-08-19 16:21:26,696 basehttp 86818 12969013248 "GET /static/img/version/angular1x.jpg HTTP/1.1" 200 22869 +INFO 2025-08-19 16:21:26,697 basehttp 86818 12952186880 "GET /static/img/version/angular10x.jpg HTTP/1.1" 200 24580 +INFO 2025-08-19 16:21:26,698 basehttp 86818 12901707776 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4399 +INFO 2025-08-19 16:21:26,698 basehttp 86818 12969013248 "GET /static/img/version/svelte.jpg HTTP/1.1" 200 25060 +INFO 2025-08-19 16:21:26,699 basehttp 86818 12952186880 "GET /static/img/version/laravel.jpg HTTP/1.1" 200 26040 +INFO 2025-08-19 16:21:26,700 basehttp 86818 12952186880 "GET /static/img/version/reactjs.jpg HTTP/1.1" 200 26850 +INFO 2025-08-19 16:21:26,700 basehttp 86818 12969013248 "GET /static/img/version/vuejs.jpg HTTP/1.1" 200 22518 +INFO 2025-08-19 16:21:26,704 basehttp 86818 12969013248 "GET /static/img/version/nextjs.jpg HTTP/1.1" 200 20152 +INFO 2025-08-19 16:21:26,704 basehttp 86818 12952186880 "GET /static/img/version/dotnet.jpg HTTP/1.1" 200 24791 +INFO 2025-08-19 16:21:26,706 basehttp 86818 12901707776 "GET /static/img/version/django.jpg HTTP/1.1" 200 20935 +INFO 2025-08-19 16:21:26,709 basehttp 86818 12969013248 "GET /static/img/theme/one-page-parallax.jpg HTTP/1.1" 200 22474 +INFO 2025-08-19 16:21:26,710 basehttp 86818 12935360512 "GET /en/htmx/tenant-info/ HTTP/1.1" 200 1093 +INFO 2025-08-19 16:21:26,711 basehttp 86818 12901707776 "GET /static/img/theme/blog.jpg HTTP/1.1" 200 32334 +INFO 2025-08-19 16:21:26,712 basehttp 86818 12952186880 "GET /static/img/theme/e-commerce.jpg HTTP/1.1" 200 37734 +INFO 2025-08-19 16:21:26,713 basehttp 86818 12918534144 "GET /en/htmx/system-health/ HTTP/1.1" 200 1359 +INFO 2025-08-19 16:21:26,713 basehttp 86818 12969013248 "GET /static/img/theme/forum.jpg HTTP/1.1" 200 28744 +INFO 2025-08-19 16:21:26,714 basehttp 86818 6170161152 "GET /en/htmx/dashboard-stats/ HTTP/1.1" 200 2093 +INFO 2025-08-19 16:21:26,715 basehttp 86818 12935360512 "GET /static/img/theme/corporate.jpg HTTP/1.1" 200 38911 +INFO 2025-08-19 16:21:50,822 basehttp 86818 12935360512 "GET /en/patients/register/ HTTP/1.1" 200 27336 +INFO 2025-08-19 16:21:50,858 basehttp 86818 12935360512 "GET /en/htmx/system-notifications/ HTTP/1.1" 200 4399 diff --git a/pharmacy/__pycache__/views.cpython-312.pyc b/pharmacy/__pycache__/views.cpython-312.pyc index fcb99572..18af1dd8 100644 Binary files a/pharmacy/__pycache__/views.cpython-312.pyc and b/pharmacy/__pycache__/views.cpython-312.pyc differ diff --git a/pharmacy/views.py b/pharmacy/views.py index 5443e5f6..a778851c 100644 --- a/pharmacy/views.py +++ b/pharmacy/views.py @@ -393,7 +393,7 @@ class MedicationListView(LoginRequiredMixin, ListView): if active_only: queryset = queryset.filter(is_active=True) - return queryset.order_by('name') + return queryset.order_by('brand_name') def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) diff --git a/templates/inpatients/beds/bed_list.html b/templates/inpatients/beds/bed_list.html index b7bf5f18..81ca9639 100644 --- a/templates/inpatients/beds/bed_list.html +++ b/templates/inpatients/beds/bed_list.html @@ -336,33 +336,7 @@ {% if is_paginated %} - + {% include 'partial/pagination.html' %} {% endif %} diff --git a/templates/inpatients/beds/bed_management.html b/templates/inpatients/beds/bed_management.html index 56534ee3..bc1605b0 100644 --- a/templates/inpatients/beds/bed_management.html +++ b/templates/inpatients/beds/bed_management.html @@ -148,8 +148,8 @@ {% endblock %} {% block content %} -
-
+ +
-
+ {% endblock %} {% block js %} diff --git a/templates/inpatients/transfers/transfer_management.html b/templates/inpatients/transfers/transfer_management.html index 46174a08..3cf72533 100644 --- a/templates/inpatients/transfers/transfer_management.html +++ b/templates/inpatients/transfers/transfer_management.html @@ -150,13 +150,13 @@ {% if transfer.status not in 'COMPLETED,CANCELLED,REJECTED' %} - +{# #} {% endif %} diff --git a/templates/pharmacy/inventory/inventory_list.html b/templates/pharmacy/inventory/inventory_list.html index b12734a0..01e4d229 100644 --- a/templates/pharmacy/inventory/inventory_list.html +++ b/templates/pharmacy/inventory/inventory_list.html @@ -300,35 +300,35 @@ - {{ item.location.name }} + {{ item.storage_location }} {% if item.location.description %}
{{ item.location.description }} {% endif %}
- - {{ item.current_stock }} + + {{ item.quantity_available }} - {{ item.get_unit_of_measure_display }} + {{ item.bin_location }}
{% if item.is_low_stock %} Low Stock - {% elif item.current_stock == 0 %} + {% elif item.quantity_available == 0 %} Out of Stock {% endif %} - {{ item.minimum_stock_level }} + {{ item.reorder_point }} {{ item.lot_number }} {% if item.supplier %} -
{{ item.supplier.name }} +
{{ item.supplier }} {% endif %} @@ -347,8 +347,8 @@ {% if item.unit_cost %} -
${{ item.unit_cost|floatformat:2 }}
- Total: ${{ item.total_value|floatformat:2 }} +
ê{{ item.unit_cost|floatformat:'2g' }}
+ Total: ê{{ item.total_cost|floatformat:'2g' }} {% else %} N/A {% endif %} @@ -356,7 +356,7 @@ {% if item.is_expired %} Expired - {% elif item.current_stock == 0 %} + {% elif item.quantity_available == 0 %} Out of Stock {% elif item.is_low_stock %} Low Stock @@ -396,37 +396,9 @@ - {% if page_obj.has_other_pages %} - - {% endif %} + {% if is_paginated %} + {% include 'partial/pagination.html' %} + {% endif %}