1
|
# -*- coding: utf-8 -*-
|
2
|
|
3
|
from datetime import date
|
4
|
|
5
|
from django import forms
|
6
|
from django.forms import ModelForm, Form
|
7
|
|
8
|
from calebasse.dossiers.models import PatientRecord
|
9
|
from calebasse.dossiers.states import STATE_CHOICES
|
10
|
|
11
|
class EditPatientRecordForm(ModelForm):
|
12
|
class Meta:
|
13
|
model = PatientRecord
|
14
|
|
15
|
class SearchForm(Form):
|
16
|
last_name = forms.CharField(label=u'Nom', required=False)
|
17
|
first_name = forms.CharField(label=u'Prénom', required=False)
|
18
|
folder_id = forms.CharField(label=u'Numéro de dossier', required=False)
|
19
|
social_security_id = forms.CharField(label=u"Numéro d'assuré social", required=False)
|
20
|
states = forms.MultipleChoiceField(
|
21
|
widget=forms.CheckboxSelectMultiple(attrs={'class':'checkbox_state'}),
|
22
|
choices=STATE_CHOICES, initial=(0,1,2,3,4))
|
23
|
|
24
|
class StateForm(Form):
|
25
|
patient_id = forms.IntegerField()
|
26
|
service_id = forms.IntegerField()
|
27
|
state_type = forms.CharField(max_length=40)
|
28
|
date = forms.DateField(label=u'Date')
|
29
|
comment = forms.CharField(label='Commentaire',
|
30
|
required=False, widget=forms.Textarea)
|
31
|
|
32
|
class NewPatientRecordForm(ModelForm):
|
33
|
class Meta:
|
34
|
model = PatientRecord
|
35
|
fields = ('first_name', 'last_name')
|
36
|
|
37
|
class GeneralForm(ModelForm):
|
38
|
class Meta:
|
39
|
model = PatientRecord
|
40
|
fields = ('comment', 'pause')
|
41
|
widgets = {
|
42
|
'comment': forms.Textarea(attrs={'cols': 50, 'rows': 5}),
|
43
|
}
|
44
|
|
45
|
class CivilStatusForm(ModelForm):
|
46
|
class Meta:
|
47
|
model = PatientRecord
|
48
|
fields = ('first_name', 'last_name', 'birthdate', 'gender', 'nationality')
|
49
|
|
50
|
class PhysiologyForm(ModelForm):
|
51
|
class Meta:
|
52
|
model = PatientRecord
|
53
|
fields = ('size', 'weight', 'pregnancy_term')
|
54
|
|
55
|
class InscriptionForm(ModelForm):
|
56
|
class Meta:
|
57
|
model = PatientRecord
|
58
|
fields = ('analysemotive', 'familymotive', 'advicegiver')
|
59
|
widgets = {}
|
60
|
|
61
|
class FamilyForm(ModelForm):
|
62
|
class Meta:
|
63
|
model = PatientRecord
|
64
|
fields = ('sibship_place', 'nb_children_family', 'twinning_rank',
|
65
|
'parental_authority', 'family_situation', 'child_custody')
|
66
|
|
67
|
class TransportFrom(ModelForm):
|
68
|
class Meta:
|
69
|
model = PatientRecord
|
70
|
fields = ('transporttype', 'transportcompany')
|
71
|
|
72
|
class FollowUpForm(ModelForm):
|
73
|
class Meta:
|
74
|
model = PatientRecord
|
75
|
fields = ('coordinators', 'externaldoctor', 'externalintervener')
|
76
|
|