Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 3.1.5 on 2023-04-06 12:10

import django.core.validators
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.CharField(default='0000000000', max_length=10, validators=[django.core.validators.MinLengthValidator(10)]),
),
]
2 changes: 2 additions & 0 deletions FusionIIIT/applications/health_center/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django.db import models
from django.core.validators import MinLengthValidator

from applications.globals.models import ExtraInfo

Expand Down Expand Up @@ -27,6 +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")

def __str__(self):
return self.doctor_name
Expand Down
7 changes: 7 additions & 0 deletions FusionIIIT/applications/health_center/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
23 changes: 17 additions & 6 deletions FusionIIIT/templates/phcModule/history.html
Original file line number Diff line number Diff line change
Expand Up @@ -339,17 +339,23 @@ <h4 class="ui image header">
margin: auto;">
<thead>
<tr>

<th>
Date
</th>

<th class="three wide">
Doctor
</th>

<th>
Description
</th>
Description
</th>

<th>
Prescription
</th>

</tr>
</thead>

Expand All @@ -359,14 +365,19 @@ <h4 class="ui image header">
<td style="white-space:nowrap;">
{{appointment.date}}
</td>

<td>
{{appointment.doctor_id}}
</td>

<td>
{{appointment.description}}
</td>

<td>
{{appointment.prescription_on_appointment}}
</td>


<td>
<input type="button" onclick="rm({{appointment.pk}})" id="{{appointment.pk}}" name="cancel" value="Cancel"class="ui red button" />
Expand All @@ -379,7 +390,7 @@ <h4 class="ui image header">
</div>

<script type="text/javascript">
function rm(id){
function rm(id){

var dis = this;
var d = window.confirm('Are you sure, you want to delete the appointment?');
Expand All @@ -404,7 +415,7 @@ <h4 class="ui image header">


}
</script>
</script>

<div class="ui tab" data-tab="complainthistory">
<div class="ui vertical segment" style="padding: 8px; padding-left: 24px; padding-right: 24px;">
Expand Down
6 changes: 6 additions & 0 deletions FusionIIIT/templates/phcModule/schedule_student.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@
{{count.doctor_count}}
<td style="word-wrap:break-word;">{{d.specialization}}</td>
{% endfor %}
</tr>
<tr>
<td>Emergency Contact No.</td>
{% for d in doctors %}
<td style="word-wrap:break-word;"> {{d.contact_no}} </td>
{% endfor %}
</tr>
{% for p,day in days %}
{{count.empty_fine}}
Expand Down