Revision f3407c83
Added by Jérôme Schneider over 12 years ago
calebasse/dossiers/views.py | ||
---|---|---|
1 | 1 |
|
2 |
from calebasse.cbv import ListView |
|
2 |
from calebasse.cbv import ListView, MultiUpdateView
|
|
3 | 3 |
from calebasse.agenda.models import Occurrence |
4 | 4 |
from calebasse.dossiers.models import PatientRecord |
5 |
from calebasse.dossiers.forms import SearchForm |
|
5 |
from calebasse.dossiers.forms import SearchForm, CivilStatusForm
|
|
6 | 6 |
from calebasse.dossiers.states import STATES_MAPPING, STATE_CHOICES_TYPE |
7 | 7 |
|
8 |
class DossiersHomepageView(ListView): |
|
8 |
|
|
9 |
class PatientRecordView(MultiUpdateView): |
|
10 |
""" |
|
11 |
""" |
|
12 |
model = PatientRecord |
|
13 |
forms_classes = {'civil_status': CivilStatusForm} |
|
14 |
template_name = 'dossiers/patientrecord_update.html' |
|
15 |
success_url = './' |
|
16 |
|
|
17 |
def get_context_data(self, **kwargs): |
|
18 |
ctx = super(PatientRecordView, self).get_context_data(**kwargs) |
|
19 |
return ctx |
|
20 |
|
|
21 |
patient_record = PatientRecordView.as_view() |
|
22 |
|
|
23 |
class PatientRecordsHomepageView(ListView): |
|
9 | 24 |
model = PatientRecord |
10 | 25 |
template_name = 'dossiers/index.html' |
11 | 26 |
|
12 | 27 |
def get_queryset(self): |
13 |
qs = super(DossiersHomepageView, self).get_queryset()
|
|
28 |
qs = super(PatientRecordsHomepageView, self).get_queryset()
|
|
14 | 29 |
first_name = self.request.GET.get('first_name') |
15 | 30 |
last_name = self.request.GET.get('last_name') |
16 | 31 |
paper_id = self.request.GET.get('paper_id') |
... | ... | |
32 | 47 |
return qs |
33 | 48 |
|
34 | 49 |
def get_context_data(self, **kwargs): |
35 |
ctx = super(DossiersHomepageView, self).get_context_data(**kwargs)
|
|
50 |
ctx = super(PatientRecordsHomepageView, self).get_context_data(**kwargs)
|
|
36 | 51 |
ctx['search_form'] = SearchForm(data=self.request.GET or None) |
37 | 52 |
ctx['patient_records'] = [] |
38 | 53 |
ctx['stats'] = {"dossiers": 0, |
Also available in: Unified diff
dossiers: begin patient record edition