Skip to content

Commit c512fea

Browse files
committed
Fix health data loading dams
1 parent 0938f9c commit c512fea

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

local_units/management/commands/import_health_data.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ def numerize(value):
5555
facilitytype_id_map["hospitals"] = facilitytype_id_map["hospital"]
5656
facilitytype_id_map["pharmacies"] = facilitytype_id_map["pharmacy"]
5757
facilitytype_id_map["bloodcentres"] = facilitytype_id_map["bloodcenter"]
58+
facilitytype_id_map["bloodcentre"] = facilitytype_id_map["bloodcenter"]
59+
# facilitytype_id_map["blood"] = facilitytype_id_map["bloodcenter"]
5860
specializedmedicalservice_id_map["surgicalspecialties"] = specializedmedicalservice_id_map["surgicalspecialities"]
5961

6062
primaryhcc_id_map[""] = None
@@ -167,6 +169,8 @@ def numerize(value):
167169
health.specialized_medical_beyond_primary_level.add(specializedmedicalservice_id_map[f])
168170
if f_bls:
169171
for f in f_bls.split(" "):
172+
if f == "blood":
173+
print(i, row)
170174
if bloodservice_id_map[f]:
171175
health.blood_services.add(bloodservice_id_map[f])
172176
if f_ptf:

local_units/management/commands/import_local_units_health.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def parse_date(date):
6565
except ValueError:
6666
pass
6767
validated = True
68-
level_id = int(row["COVERAGECODE"]) + 1
68+
level_id = int(row["COVERAGECODE"]) # + 1
6969
local_branch_name = row["NAME_LOC"]
7070
english_branch_name = row["NAME_EN"]
7171
postcode = row["POSTCODE"]
@@ -89,19 +89,19 @@ def parse_date(date):
8989
type_id=type,
9090
# is_public=is_public,
9191
validated=validated,
92-
local_branch_name=local_branch_name,
93-
english_branch_name=english_branch_name,
94-
focal_person_loc=focal_person_loc,
95-
focal_person_en=focal_person_en,
92+
local_branch_name=local_branch_name[:255],
93+
english_branch_name=english_branch_name[:255],
94+
focal_person_loc=focal_person_loc[:255],
95+
focal_person_en=focal_person_en[:255],
9696
location=location,
9797
postcode=postcode,
9898
address_loc=address_loc,
9999
address_en=address_en,
100-
city_loc=city_loc,
101-
city_en=city_en,
100+
city_loc=city_loc[:255],
101+
city_en=city_en[:255],
102102
phone=phone,
103-
email=email,
104-
link=link,
103+
email=email[:255],
104+
link=link[:255],
105105
source_loc=source_loc,
106106
source_en=source_en,
107107
date_of_data=date_of_data,

0 commit comments

Comments
 (0)