From 21d8daaa9fac3ba74d3034827967a7d1c3bc5f08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Ates?= Date: Fri, 15 Jan 2016 15:12:24 +0100 Subject: [PATCH] Add Room field to patient. --- src/biomon/forms.py | 2 +- src/biomon/models.py | 2 ++ src/biomon/templates/biomon/patient_detail.html | 1 + src/biomon/views.py | 4 ++-- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/biomon/forms.py b/src/biomon/forms.py index d7bb59b..8761929 100644 --- a/src/biomon/forms.py +++ b/src/biomon/forms.py @@ -33,7 +33,7 @@ class MainForm(forms.ModelForm): class Meta: model = models.Patient fields = ['firstname', 'lastname', 'sex', 'birthdate', 'monitoring_place', - 'emergency_contact', 'regular_doctor', 'medical_comment'] + 'room', 'emergency_contact', 'regular_doctor', 'medical_comment'] class SimpleAlertProfileForm(forms.ModelForm): diff --git a/src/biomon/models.py b/src/biomon/models.py index a53f0a3..db7524c 100644 --- a/src/biomon/models.py +++ b/src/biomon/models.py @@ -117,6 +117,8 @@ class Person(TimestampedAbstractModel): class Patient(Person): monitoring_place = models.TextField(_(u'Monitoring place'), blank=True, null=True) + room = models.CharField(_(u'Room'), max_length=512, + null=True, blank=True) emergency_contact = models.TextField(_(u'Emergency contact'), null=True, blank=True) regular_doctor = models.TextField(_(u'Regular doctor'), diff --git a/src/biomon/templates/biomon/patient_detail.html b/src/biomon/templates/biomon/patient_detail.html index dcd3bb5..adb0245 100644 --- a/src/biomon/templates/biomon/patient_detail.html +++ b/src/biomon/templates/biomon/patient_detail.html @@ -14,6 +14,7 @@ {% if patient.monitoring_place %}
{{ patient.monitoring_place}}{% endif %} +
{% trans "Room" %} : {% if patient.room %}{{ patient.room}}{% else %}{% trans "Missing room" %}{% endif %}
diff --git a/src/biomon/views.py b/src/biomon/views.py index 12f86e6..c3451c6 100644 --- a/src/biomon/views.py +++ b/src/biomon/views.py @@ -89,7 +89,7 @@ class PatientList(ListView): class PatientCreate(CreateView): model = models.Patient fields = ['firstname', 'lastname', 'sex', 'birthdate', 'monitoring_place', - 'emergency_contact', 'regular_doctor', 'medical_comment', + 'room', 'emergency_contact', 'regular_doctor', 'medical_comment', 'enabled'] def form_valid(self, form): @@ -108,7 +108,7 @@ class PatientCreate(CreateView): class PatientUpdate(UpdateView): model = models.Patient fields = ['firstname', 'lastname', 'sex', 'birthdate', 'monitoring_place', - 'emergency_contact', 'regular_doctor', 'medical_comment'] + 'room', 'emergency_contact', 'regular_doctor', 'medical_comment'] class PatientDetail(cbv.MultiUpdateView):