Project

General

Profile

« Previous | Next » 

Revision 428081e0

Added by Jérôme Schneider over 12 years ago

dossiers: rename familly to family and add transport and follow-up forms

View differences:

calebasse/dossiers/forms.py
55 55
class InscriptionForm(ModelForm):
56 56
    class Meta:
57 57
        model = PatientRecord
58
        fields = ('analysemotive', 'famillymotive', 'advicegiver')
58
        fields = ('analysemotive', 'familymotive', 'advicegiver')
59 59
        widgets = {}
60 60

  
61
class FamillyForm(ModelForm):
61
class FamilyForm(ModelForm):
62 62
    class Meta:
63 63
        model = PatientRecord
64 64
        fields = ('sibship_place', 'nb_children_family', 'twinning_rank',
65
                'parental_authority', 'familly_situation', 'child_custody')
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')
66 76

  
calebasse/dossiers/models.py
235 235
    analysemotive = models.ForeignKey('ressources.AnalyseMotive',
236 236
            verbose_name=u"Motif (analysé)",
237 237
            null=True, blank=True, default=None)
238
    famillymotive = models.ForeignKey('ressources.FamillyMotive',
238
    familymotive = models.ForeignKey('ressources.FamilyMotive',
239 239
            verbose_name=u"Motif (famille)",
240 240
            null=True, blank=True, default=None)
241 241
    advicegiver = models.ForeignKey('ressources.AdviceGiver',
242 242
            verbose_name=u"Conseilleur",
243 243
            null=True, blank=True, default=None)
244 244

  
245
    # Familly
245
    # Family
246 246
    sibship_place = models.IntegerField(verbose_name=u"Place dans la fratrie",
247 247
            null=True, blank=True, default=None)
248 248
    nb_children_family = models.IntegerField(verbose_name=u"Nombre d'enfants dans la fratrie",
......
252 252
    parental_authority = models.ForeignKey('ressources.ParentalAuthorityType',
253 253
            verbose_name=u"Autorité parentale",
254 254
            null=True, blank=True, default=None)
255
    familly_situation = models.ForeignKey('ressources.FamilySituationType',
255
    family_situation = models.ForeignKey('ressources.FamilySituationType',
256 256
            verbose_name=u"Situation familiale",
257 257
            null=True, blank=True, default=None)
258 258
    child_custody = models.ForeignKey('ressources.ParentalCustodyType',
......
260 260
            null=True, blank=True, default=None)
261 261

  
262 262
    # Transport
263
    transport_type = models.ForeignKey('ressources.TransportType',
263
    transporttype = models.ForeignKey('ressources.TransportType',
264 264
            verbose_name=u"Type de transport",
265 265
            null=True, blank=True, default=None)
266
    transport_company = models.ForeignKey('ressources.TransportCompany',
266
    transportcompany = models.ForeignKey('ressources.TransportCompany',
267 267
            verbose_name=u"Compagnie de transport",
268 268
            null=True, blank=True, default=None)
269 269

  
270
    # FollowUp
271
    coordinators = models.ManyToManyField('personnes.Worker',
272
            verbose_name=u"Coordinateurs",
273
            null=True, blank=True, default=None)
274
    externaldoctor = models.ForeignKey('personnes.ExternalDoctor',
275
            verbose_name=u"Médecin extérieur",
276
            null=True, blank=True, default=None)
277
    externalintervener = models.ForeignKey('personnes.ExternalIntervener',
278
            verbose_name=u"Intervenant extérieur",
279
            null=True, blank=True, default=None)
280

  
270 281
    def __init__(self, *args, **kwargs):
271 282
        super(PatientRecord, self).__init__(*args, **kwargs)
272 283
        if not hasattr(self, 'service'):
calebasse/dossiers/templates/dossiers/patientrecord_update.html
159 159
                <button type="button" id="traitement-patientrecord">En traitement</button>
160 160
            {% endif %}
161 161
        {% endif %}
162
<!--        <button id="close-patientrecord">Clore</button>-->
163
<!--        <button id="reopen-patientrecord">Ré-accueillir</button>-->
164 162
        <button type="button" id="patientrecord-history">Historique</button><br/>
165 163
        <hr/>
166 164
        <p id="pause-msg" style="display: none; font-size: 10px;">Pause facturation mise à jour</p>
......
232 230
      <p>
233 231
      {% for field in forms.inscription %}
234 232
      {{ field.label_tag  }} : {{ field }}
235
      <button class="dialog-button"
233
      <button type="button"
234
          class="dialog-button"
236 235
          data-url="../../ressources/{{ field.name }}/new/ #form-content"
237 236
          data-default-button="Ajouter"
238 237
          data-next-url="{{ request.get_full_path }}#tab=1"
......
244 243
    </div>
245 244
  </form>
246 245

  
247
    <form method="post" id="inscription-form" class="patientrecordform">
246
    <form method="post" id="family-form" class="patientrecordform">
248 247
    {% csrf_token %}
249 248
    <div class="frame inline">
250 249
        <h3>Famille</h3>
251 250
      <button class="save">✔</button>
252 251
      <p>
253
      {% for field in forms.familly %}
252
      {% for field in forms.family %}
254 253
      {{ field.errors }}
255 254
      {% endfor %}
256 255
      </p>
257 256
      <p>
258
      {{ forms.familly.sibship_place.label_tag  }} : {{ forms.familly.sibship_place }}
259
      {{ forms.familly.nb_children_family.label_tag  }} : {{ forms.familly.nb_children_family }}
260
      {{ forms.familly.twinning_rank.label_tag  }} : {{ forms.familly.twinning_rank }}
257
      {{ forms.family.sibship_place.label_tag  }} : {{ forms.family.sibship_place }}
258
      {{ forms.family.nb_children_family.label_tag  }} : {{ forms.family.nb_children_family }}
259
      {{ forms.family.twinning_rank.label_tag  }} : {{ forms.family.twinning_rank }}
261 260
      </p>
262 261
      <p>
263
      {{ forms.familly.parental_authority.label_tag  }} : {{ forms.familly.parental_authority }}
264
      <button class="dialog-button"
262
      {{ forms.family.parental_authority.label_tag  }} : {{ forms.family.parental_authority }}
263
      <button type="button"
264
          class="dialog-button"
265 265
          data-url="../../ressources/parentalauthoritytype/new/ #form-content"
266 266
          data-default-button="Ajouter"
267 267
          data-next-url="{{ request.get_full_path }}#tab=1"
268 268
          title="Ajouter un type d'autorité parentale"
269 269
          type="button">+</button>
270
      {{ forms.familly.familly_situation.label_tag  }} : {{ forms.familly.familly_situation }}
271
      <button class="dialog-button"
270
      {{ forms.family.family_situation.label_tag  }} : {{ forms.family.family_situation }}
271
      <button type="button"
272
          class="dialog-button"
272 273
          data-url="../../ressources/familysituationtype/new/ #form-content"
273 274
          data-default-button="Ajouter"
274 275
          data-next-url="{{ request.get_full_path }}#tab=1"
275 276
          title="Ajouter un type de situation familiale"
276 277
          type="button">+</button>
277
      {{ forms.familly.child_custody.label_tag  }} : {{ forms.familly.child_custody }}
278
      <button class="dialog-button"
278
      {{ forms.family.child_custody.label_tag  }} : {{ forms.family.child_custody }}
279
      <button type="button"
280
          class="dialog-button"
279 281
          data-url="../../ressources/parentalcustodytype/new/ #form-content"
280 282
          data-default-button="Ajouter"
281 283
          data-next-url="{{ request.get_full_path }}#tab=1"
......
286 288
    </div>
287 289
    </form>
288 290

  
289
    <div class="frame">
291
    <form method="post" id="transport-form" class="patientrecordform">
292
    {% csrf_token %}
293
    <div class="frame inline">
290 294
      <h3>Transport</h3>
291 295
      <button class="save">✔</button>
292 296
      <p>
293
      <label>Type de transport :</label> <select><option>Indéfini</option></select> <button>+</button>
294
      <label>Compagnie de transport :</label> <select><option>Indéfini</option></select> <button>+</button>
297
      {% for field in forms.transport %}
298
      {{ field.label_tag  }} : {{ field }}
299
      <button type="button"
300
          class="dialog-button"
301
          data-url="../../ressources/{{ field.name }}/new/ #form-content"
302
          data-default-button="Ajouter"
303
          data-next-url="{{ request.get_full_path }}#tab=1"
304
          title="Ajouter un {{ field.label.lower }}"
305
          type="button">+</button>
306
      {% endfor %}
295 307
      </p>
296 308
      <table>
297
        <tr><td><button>Attestation</button></td> <td><button>Prescription</td></tr>
309
        <tr><td><button type="button">Attestation</button></td> <td><button type="button">Prescription</td></tr>
298 310
          <tr><td>Dernière attestation le 25/07/2012 <button>Historique</button></td>
299 311
            <td>Dernière prescription le 25/07/2012 <button>Historique</button></td></tr>
300 312
        </table>
301 313
      <input type="hidden"  name="tab"  value="1">
302 314
      </div>
315
    </form>
303 316

  
304 317
      <div class="frame">
305 318
        <h3>Suivi du patient</h3>
calebasse/dossiers/views.py
8 8
from calebasse.agenda.models import Occurrence
9 9
from calebasse.dossiers.models import PatientRecord, Status, FileState, create_patient
10 10
from calebasse.dossiers.forms import (SearchForm, CivilStatusForm, StateForm,
11
        PhysiologyForm, FamillyForm, InscriptionForm, GeneralForm,
12
        NewPatientRecordForm)
11
        PhysiologyForm, FamilyForm, InscriptionForm, GeneralForm,
12
        NewPatientRecordForm, TransportFrom, FollowUpForm)
13 13
from calebasse.dossiers.states import STATES_MAPPING, STATE_CHOICES_TYPE
14 14
from calebasse.ressources.models import Service
15 15

  
......
75 75
            'id': CivilStatusForm,
76 76
            'physiology': PhysiologyForm,
77 77
            'inscription': InscriptionForm,
78
            'familly': FamillyForm,
78
            'family': FamilyForm,
79
            'transport': TransportFrom,
80
            'followup': FollowUpForm
79 81
            }
80 82
    template_name = 'dossiers/patientrecord_update.html'
81 83
    success_url = './view'
calebasse/fixtures/dossiers.json
525 525
        3
526 526
      ], 
527 527
      "nb_children_family": null, 
528
      "familly_situation": null, 
529
      "famillymotive": null, 
528
      "family_situation": null, 
529
      "familymotive": null, 
530 530
      "nationality": "Fran\u00e7ais", 
531 531
      "parental_authority": null, 
532 532
      "school": 1, 
......
562 562
        3
563 563
      ], 
564 564
      "nb_children_family": null, 
565
      "familly_situation": null, 
566
      "famillymotive": null, 
565
      "family_situation": null, 
566
      "familymotive": null, 
567 567
      "nationality": "Fran\u00e7ais", 
568 568
      "parental_authority": null, 
569 569
      "school": 1, 
......
596 596
        2
597 597
      ], 
598 598
      "nb_children_family": null, 
599
      "familly_situation": null, 
600
      "famillymotive": null, 
599
      "family_situation": null, 
600
      "familymotive": null, 
601 601
      "nationality": "Fran\u00e7ais", 
602 602
      "parental_authority": null, 
603 603
      "school": 1, 
......
631 631
        2
632 632
      ], 
633 633
      "nb_children_family": null, 
634
      "familly_situation": null, 
635
      "famillymotive": null, 
634
      "family_situation": null, 
635
      "familymotive": null, 
636 636
      "nationality": "Fran\u00e7ais", 
637 637
      "parental_authority": null, 
638 638
      "school": 1, 
......
666 666
        6
667 667
      ], 
668 668
      "nb_children_family": null, 
669
      "familly_situation": null, 
670
      "famillymotive": null, 
669
      "family_situation": null, 
670
      "familymotive": null, 
671 671
      "nationality": "Fran\u00e7ais", 
672 672
      "parental_authority": null, 
673 673
      "school": 1, 
......
700 700
        5
701 701
      ], 
702 702
      "nb_children_family": null, 
703
      "familly_situation": null, 
704
      "famillymotive": null, 
703
      "family_situation": null, 
704
      "familymotive": null, 
705 705
      "nationality": "Fran\u00e7ais", 
706 706
      "parental_authority": null, 
707 707
      "school": 1, 
......
734 734
        2
735 735
      ], 
736 736
      "nb_children_family": null, 
737
      "familly_situation": null, 
738
      "famillymotive": null, 
737
      "family_situation": null, 
738
      "familymotive": null, 
739 739
      "nationality": "Fran\u00e7ais", 
740 740
      "parental_authority": null, 
741 741
      "school": null, 
......
764 764
      "service": 3, 
765 765
      "contacts": [], 
766 766
      "nb_children_family": 5, 
767
      "familly_situation": null, 
768
      "famillymotive": null, 
767
      "family_situation": null, 
768
      "familymotive": null, 
769 769
      "nationality": "FR", 
770 770
      "parental_authority": null, 
771 771
      "school": null, 
......
794 794
      "service": 2, 
795 795
      "contacts": [], 
796 796
      "nb_children_family": null, 
797
      "familly_situation": null, 
798
      "famillymotive": null, 
797
      "family_situation": null, 
798
      "familymotive": null, 
799 799
      "nationality": null, 
800 800
      "parental_authority": null, 
801 801
      "school": null, 
......
824 824
      "service": 2, 
825 825
      "contacts": [], 
826 826
      "nb_children_family": null, 
827
      "familly_situation": null, 
828
      "famillymotive": null, 
827
      "family_situation": null, 
828
      "familymotive": null, 
829 829
      "nationality": "Fran\u00e7aise", 
830 830
      "parental_authority": null, 
831 831
      "school": null, 
......
854 854
      "service": 2, 
855 855
      "contacts": [], 
856 856
      "nb_children_family": null, 
857
      "familly_situation": null, 
858
      "famillymotive": null, 
857
      "family_situation": null, 
858
      "familymotive": null, 
859 859
      "nationality": null, 
860 860
      "parental_authority": null, 
861 861
      "school": null, 
......
884 884
      "service": 2, 
885 885
      "contacts": [], 
886 886
      "nb_children_family": null, 
887
      "familly_situation": null, 
888
      "famillymotive": null, 
887
      "family_situation": null, 
888
      "familymotive": null, 
889 889
      "nationality": null, 
890 890
      "parental_authority": null, 
891 891
      "school": null, 
......
914 914
      "service": 3, 
915 915
      "contacts": [], 
916 916
      "nb_children_family": null, 
917
      "familly_situation": null, 
918
      "famillymotive": null, 
917
      "family_situation": null, 
918
      "familymotive": null, 
919 919
      "nationality": "Fran\u00e7aise", 
920 920
      "parental_authority": null, 
921 921
      "school": null, 
......
944 944
      "service": 4, 
945 945
      "contacts": [], 
946 946
      "nb_children_family": null, 
947
      "familly_situation": null, 
948
      "famillymotive": null, 
947
      "family_situation": null, 
948
      "familymotive": null, 
949 949
      "nationality": null, 
950 950
      "parental_authority": null, 
951 951
      "school": null, 
......
974 974
      "service": 4, 
975 975
      "contacts": [], 
976 976
      "nb_children_family": null, 
977
      "familly_situation": null, 
978
      "famillymotive": null, 
977
      "family_situation": null, 
978
      "familymotive": null, 
979 979
      "nationality": "Fran\u00e7aise", 
980 980
      "parental_authority": null, 
981 981
      "school": null, 
calebasse/personnes/models.py
277 277
                    date_filter(self.start_date, 'j F'),
278 278
                    date_filter(self.end_date, 'j F Y'))
279 279
        return ret
280

  
281
class ExternalDoctor(People):
282
    class Meta:
283
        verbose_name = u'Médecin extérieur'
284
        verbose_name_plural = u'Médecins extérieurs'
285

  
286
class ExternalIntervener(People):
287
    class Meta:
288
        verbose_name = u'Intervenant extérieur'
289
        verbose_name_plural = u'Intervenants extérieurs'
290

  
calebasse/ressources/models.py
173 173
        verbose_name = u"Motif analysé"
174 174
        verbose_name_plural = u"Motifs analysés"
175 175

  
176
class FamillyMotive(NamedAbstractModel, ServiceLinkedAbstractModel):
176
class FamilyMotive(NamedAbstractModel, ServiceLinkedAbstractModel):
177 177
    class Meta:
178 178
        verbose_name = u"Motif familiale"
179 179
        verbose_name_plural = u"Motifs familiaux"
......
248 248
    class Meta:
249 249
        verbose_name = u'Type de personnel'
250 250
        verbose_name_plural = u'Types de personnel'
251

  
calebasse/static/css/style.css
1042 1042
  vertical-align: top;
1043 1043
}
1044 1044

  
1045
#id_familly-sibship_place, #id_familly-nb_children_family, #id_familly-twinning_rank {
1045
#id_family-sibship_place, #id_family-nb_children_family, #id_family-twinning_rank {
1046 1046
    width: 4em;
1047 1047
}
1048 1048

  

Also available in: Unified diff