From 362b18aae96c4b4fc44187a98ab367fad70e6d61 Mon Sep 17 00:00:00 2001 From: Divyansh Khetan Date: Sat, 11 Feb 2023 10:10:21 +0530 Subject: [PATCH 1/5] emergency contact number and presciption in appointment history --- .../applications/health_center/models.py | 1 + .../applications/health_center/views.py | 7 +++++ FusionIIIT/templates/phcModule/history.html | 27 ++++++++++--------- .../templates/phcModule/schedule_student.html | 6 +++++ 4 files changed, 29 insertions(+), 12 deletions(-) diff --git a/FusionIIIT/applications/health_center/models.py b/FusionIIIT/applications/health_center/models.py index 4daaae0de..262fa39f8 100644 --- a/FusionIIIT/applications/health_center/models.py +++ b/FusionIIIT/applications/health_center/models.py @@ -27,6 +27,7 @@ class Doctor(models.Model): doctor_phone = models.CharField(max_length=10) specialization = models.CharField(max_length=100) active = models.BooleanField(default=True) + contact_no = models.IntegerField(default=0) def __str__(self): return self.doctor_name diff --git a/FusionIIIT/applications/health_center/views.py b/FusionIIIT/applications/health_center/views.py index cd2bba84f..b10414f47 100644 --- a/FusionIIIT/applications/health_center/views.py +++ b/FusionIIIT/applications/health_center/views.py @@ -145,6 +145,13 @@ def student_view(request): doctors=Doctor.objects.filter(active=True) count=Counter.objects.all() + # Snippet to add prescription for an appointment + for pres in prescription: + for appointment in appointments: + if pres.appointment.pk == appointment.pk: + appointment['prescription_on_appointment'] = pres + break + if count: Counter.objects.all().delete() Counter.objects.create(count=0,fine=0) diff --git a/FusionIIIT/templates/phcModule/history.html b/FusionIIIT/templates/phcModule/history.html index 1231b6a54..be5630b27 100755 --- a/FusionIIIT/templates/phcModule/history.html +++ b/FusionIIIT/templates/phcModule/history.html @@ -340,27 +340,32 @@

+ + Date + + Doctor - Description + Description - + - Date + Prescription - - - {% for appointment in appointments %} + + {{appointment.date}} + + {{appointment.doctor_id}} @@ -369,15 +374,13 @@

{{appointment.description}} - - {{appointment.date}} + + {{appointment.prescription_on_appointment}} - - {% endfor %} @@ -387,7 +390,7 @@

+
diff --git a/FusionIIIT/templates/phcModule/schedule_student.html b/FusionIIIT/templates/phcModule/schedule_student.html index 305352fe4..a8dc09e8b 100644 --- a/FusionIIIT/templates/phcModule/schedule_student.html +++ b/FusionIIIT/templates/phcModule/schedule_student.html @@ -112,6 +112,12 @@ {{count.doctor_count}} {{d.specialization}} {% endfor %} + + + Emergency Contact No. + {% for d in doctors %} + {{d.contact_no}} + {% endfor %} {% for p,day in days %} {{count.empty_fine}} From b57086d7788645f6d5a2af4ad8ec039b9747e023 Mon Sep 17 00:00:00 2001 From: Divyansh Khetan Date: Thu, 6 Apr 2023 11:58:04 +0530 Subject: [PATCH 2/5] migration file --- .../migrations/0002_doctor_contact_no.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 FusionIIIT/applications/health_center/migrations/0002_doctor_contact_no.py diff --git a/FusionIIIT/applications/health_center/migrations/0002_doctor_contact_no.py b/FusionIIIT/applications/health_center/migrations/0002_doctor_contact_no.py new file mode 100644 index 000000000..815a3de2e --- /dev/null +++ b/FusionIIIT/applications/health_center/migrations/0002_doctor_contact_no.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.5 on 2023-04-06 11:57 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('health_center', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='doctor', + name='contact_no', + field=models.IntegerField(default=0), + ), + ] From 87939b58a1aad94dbaf3da7ccf7ce64a329a5f4b Mon Sep 17 00:00:00 2001 From: Divyansh Khetan Date: Thu, 6 Apr 2023 12:13:06 +0530 Subject: [PATCH 3/5] model changes --- .../health_center/migrations/0002_doctor_contact_no.py | 5 +++-- FusionIIIT/applications/health_center/models.py | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/FusionIIIT/applications/health_center/migrations/0002_doctor_contact_no.py b/FusionIIIT/applications/health_center/migrations/0002_doctor_contact_no.py index 815a3de2e..5b01fb796 100644 --- a/FusionIIIT/applications/health_center/migrations/0002_doctor_contact_no.py +++ b/FusionIIIT/applications/health_center/migrations/0002_doctor_contact_no.py @@ -1,5 +1,6 @@ -# Generated by Django 3.1.5 on 2023-04-06 11:57 +# Generated by Django 3.1.5 on 2023-04-06 12:10 +import django.core.validators from django.db import migrations, models @@ -13,6 +14,6 @@ class Migration(migrations.Migration): migrations.AddField( model_name='doctor', name='contact_no', - field=models.IntegerField(default=0), + field=models.CharField(default=0, max_length=10, validators=[django.core.validators.MinLengthValidator(10)]), ), ] diff --git a/FusionIIIT/applications/health_center/models.py b/FusionIIIT/applications/health_center/models.py index 262fa39f8..91b506185 100644 --- a/FusionIIIT/applications/health_center/models.py +++ b/FusionIIIT/applications/health_center/models.py @@ -1,4 +1,5 @@ from django.db import models +from django.core.validators import MinLengthValidator from applications.globals.models import ExtraInfo @@ -27,7 +28,7 @@ class Doctor(models.Model): doctor_phone = models.CharField(max_length=10) specialization = models.CharField(max_length=100) active = models.BooleanField(default=True) - contact_no = models.IntegerField(default=0) + contact_no = models.CharField(max_length=10, validators=[MinLengthValidator(10)], default=0000000000) def __str__(self): return self.doctor_name From 2ffc46092275131361a4435b47615e6b2712585b Mon Sep 17 00:00:00 2001 From: Divyansh Khetan Date: Mon, 10 Apr 2023 15:56:02 +0530 Subject: [PATCH 4/5] converted default to string --- FusionIIIT/applications/health_center/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FusionIIIT/applications/health_center/models.py b/FusionIIIT/applications/health_center/models.py index 91b506185..298c1aa9d 100644 --- a/FusionIIIT/applications/health_center/models.py +++ b/FusionIIIT/applications/health_center/models.py @@ -28,7 +28,7 @@ class Doctor(models.Model): doctor_phone = models.CharField(max_length=10) specialization = models.CharField(max_length=100) active = models.BooleanField(default=True) - contact_no = models.CharField(max_length=10, validators=[MinLengthValidator(10)], default=0000000000) + contact_no = models.CharField(max_length=10, validators=[MinLengthValidator(10)], default="0000000000") def __str__(self): return self.doctor_name From 547209eb80a81d3e4e667e3cd2fdab4cd27b717f Mon Sep 17 00:00:00 2001 From: Divyansh Khetan Date: Mon, 10 Apr 2023 16:10:28 +0530 Subject: [PATCH 5/5] migration file changes --- .../health_center/migrations/0002_doctor_contact_no.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FusionIIIT/applications/health_center/migrations/0002_doctor_contact_no.py b/FusionIIIT/applications/health_center/migrations/0002_doctor_contact_no.py index 5b01fb796..82f1570aa 100644 --- a/FusionIIIT/applications/health_center/migrations/0002_doctor_contact_no.py +++ b/FusionIIIT/applications/health_center/migrations/0002_doctor_contact_no.py @@ -14,6 +14,6 @@ class Migration(migrations.Migration): migrations.AddField( model_name='doctor', name='contact_no', - field=models.CharField(default=0, max_length=10, validators=[django.core.validators.MinLengthValidator(10)]), + field=models.CharField(default='0000000000', max_length=10, validators=[django.core.validators.MinLengthValidator(10)]), ), ]