Revision e20cf07a
Added by Mikaël Ates over 12 years ago
calebasse/dossiers/forms.py | ||
---|---|---|
196 | 196 |
def clean(self): |
197 | 197 |
cleaned_data = super(PatientContactForm, self).clean() |
198 | 198 |
health_org = cleaned_data.get('health_org') |
199 |
other_health_center = cleaned_data.get('other_health_center') |
|
199 | 200 |
if health_org: |
200 | 201 |
msg = None |
201 | 202 |
lr = None |
... | ... | |
213 | 214 |
msg = u"Caisse %s inconnue." % health_org[2:5] |
214 | 215 |
elif len(hcs) == 1: |
215 | 216 |
hc = hcs[0] |
217 |
if not other_health_center and len(health_org) == 9: |
|
218 |
other_health_center = health_org[5:9] |
|
216 | 219 |
else: |
217 | 220 |
if len(health_org) == 9: |
218 | 221 |
hcs = hcs.filter(code=health_org[5:9]) |
... | ... | |
231 | 234 |
else: |
232 | 235 |
cleaned_data['large_regime'] = lr.code |
233 | 236 |
cleaned_data['health_center'] = hc |
237 |
cleaned_data['other_health_center'] = other_health_center |
|
234 | 238 |
return cleaned_data |
235 | 239 |
|
236 | 240 |
|
Also available in: Unified diff
dossiers: automatically set specific center field if needed.