Skip to content
Snippets Groups Projects
Commit f24981d0 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

appoointment list contains visit number and nd number

parent 355f58fd
No related branches found
No related tags found
1 merge request!2Appointments dev
......@@ -205,11 +205,8 @@ class Visit(models.Model):
return "%s %s" % (self.subject.first_name, self.subject.last_name)
def follow_up_title(self):
visits = Visit.objects.filter(subject=self.subject, datetime_begin__lt =self.datetime_begin)
if len(visits)==0:
return "First visit"
else:
return "Follow up "+str(len(visits))
count = Visit.objects.filter(subject=self.subject, datetime_begin__lt =self.datetime_begin).count()
return "Visit " + str(count + 1)
def mark_as_finished(self):
self.is_finished = True
......
......@@ -67,6 +67,7 @@
<thead>
<tr>
<th>Subject</th>
<th>Visit</th>
<th>Type</th>
<th>Date</th>
<th>Details</th>
......@@ -76,13 +77,19 @@
{% for approach in approaching_list %}
<tr>
<td>
{% if approach.visit.subject.screening_number == "---" %}
N/A
<td>
</td>
<td>
</td>
{% else %}
{{ approach.visit.subject.first_name }} {{ approach.visit.subject.last_name }}
<td>
{{ approach.visit.subject.first_name }} {{ approach.visit.subject.last_name }} ({{ approach.visit.subject.nd_number }})
</td>
<td>
{{ approach.visit.follow_up_title }}
</td>
{% endif %}
</td>
<td>
{% for type in approach.appointment_types.all %}
{{ type.code }},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment