Project

General

Profile

« Previous | Next » 

Revision 5fce3dc9

Added by Mikaël Ates over 12 years ago

scripts: import dossiers update.

View differences:

scripts/import_dossiers.py
618 618
                else:
619 619
                    if old_id in tables_data['pcs'].keys():
620 620
                        pcs = tables_data['pcs'][old_id]
621
                        last_pc = pcs(len(pcs)-1)
622
                        if last_pc['genre_pc'] == 2:
621
                        last_pc = pcs[len(pcs)-1]
622
                        if last_pc['genre_pc'] == '2':
623 623
                            status, date, msg = fss[len(fss)-1]
624 624
                            last_date = date + relativedelta(days=1)
625 625
                            fss.append((status_traitement, last_date, "Date à préciser."))
......
919 919
            other_health_center = None
920 920
            if old_id in tables_data['pcs'].keys():
921 921
                pcs = tables_data['pcs'][old_id]
922
                i = len(pcs)-1
922
                j = len(pcs)-1
923 923
                found = False
924 924
                last_pc = None
925
                while not found and i >= 0:
926
                    last_pc = pcs[i]
925
                while not found and j >= 0:
926
                    last_pc = pcs[j]
927 927
                    if 'contact_id' in last_pc.keys():
928 928
                        found = True
929
                    i = i -1
929
                    j -= 1
930 930
                if not found:
931 931
                    writer2.writerow([dossier[c].encode('utf-8') for c in d_cols] + [service.name, 'Oui', "Pas de pc, le patient est l'assure sans caisse"])
932 932
#                    print "Pas de d'assure pour le patient %s" % old_id
......
960 960
                                            last_pc['centre'] = ''.join(last_pc['centre'])
961 961
                                        other_health_center = last_pc['centre']
962 962
                                elif health_centers and len(health_centers.all()) > 1:
963
                                    print lg
964
                                    print caisse
965 963
                                    health_centers = None
966 964
                                    if last_pc['centre']:
967 965
                                        while len(last_pc['centre']) < 4:
968 966
                                            last_pc['centre'] = ['0', last_pc['centre']]
969 967
                                            last_pc['centre'] = ''.join(last_pc['centre'])
970
                                        print "centre 1 %s" % last_pc['centre']
968
#                                        print "centre 1 %s" % last_pc['centre']
971 969
                                        health_centers = HealthCenter.objects.filter(large_regime__code=lg, health_fund=caisse,
972 970
                                            code = last_pc['centre'])
973 971
                                    elif centre:
974
                                        print "centre 2 %s" % centre
972
#                                        print "centre 2 %s" % centre
975 973
                                        health_centers = HealthCenter.objects.filter(large_regime__code=lg, health_fund=caisse,
976 974
                                            code = centre)
977 975
                                    if health_centers and len(health_centers.all()) == 1:

Also available in: Unified diff