-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add view and allow for duplicate hostpital numbers
- Loading branch information
1 parent
6f52606
commit faf101f
Showing
4 changed files
with
60 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
plugins/appointments/templates/appointments/clinic_list.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{% extends 'app_layouts/layout_base.html' %} | ||
{% block ngapp %}{% endblock %} | ||
{% block loading %}{% endblock %} | ||
|
||
{% block content %} | ||
<div class="row content-offset"> | ||
<div class="col-md-10 col-md-offset-1"> | ||
<h2 >Upcoming TB Clinic Appointments</h2> | ||
</div> | ||
</div> | ||
{% for appointment in object_list %} | ||
<div class="row"> | ||
<div class="col-md-3"> | ||
{{ appointment.start_datetime }} | ||
<br /> | ||
{{ appointment.duration}} | ||
</div> | ||
<div class="col-md-3"> | ||
{{ appointment.derived_appointment_type }} | ||
</div> | ||
<div class="col-md-3"> | ||
{{ appointment.patient.demographics.name }} | ||
</div> | ||
<div class="col-md-3"> | ||
{{ appointment.patient.demographics.hospital_number }} | ||
{{ appointment.patient.demographics.date_of_birth }} | ||
</div> | ||
</div> | ||
{% endfor %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
""" | ||
Views for the Appointment plugin | ||
""" | ||
import datetime | ||
|
||
from django.views.generic import ListView | ||
|
||
from plugins.appointments.models import Appointment | ||
|
||
|
||
class ClinicListView(ListView): | ||
""" | ||
Show a list of all future appointments | ||
""" | ||
model = Appointment | ||
template_name = 'appointments/clinic_list.html' | ||
|
||
def get_queryset(self): | ||
return Appointment.objects.filter( | ||
start_datetime__gte=datetime.date.today() | ||
).exclude(status_code='Canceled') |