Add Room field to patient.

This commit is contained in:
Mikaël Ates 2016-01-15 15:12:24 +01:00
parent 9b67630c37
commit 21d8daaa9f
4 changed files with 6 additions and 3 deletions

View File

@ -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):

View File

@ -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'),

View File

@ -14,6 +14,7 @@
<span id="critical_alert_count" class="critical"></span>
<span id="dangerous_alert_count" class="dangerous"></span>
{% if patient.monitoring_place %}<br/><span id="monitoring_place">{{ patient.monitoring_place}}</span>{% endif %}
<br/><span id="room">{% trans "Room" %} : {% if patient.room %}{{ patient.room}}{% else %}{% trans "Missing room" %}{% endif %}</span>
</div>
<div id="tabs">
<div id="tab-selector">

View File

@ -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):