@@ -349,15 +349,15 @@ def get_households_profile(geo, session):
349
349
# construction materials
350
350
roofing_dist , _ = get_stat_data (
351
351
'main type of roofing material' , geo = geo , session = session ,
352
- order_by = '- total' )
352
+ order_by = 'total' )
353
353
354
354
wall_dist , _ = get_stat_data (
355
355
'main type of wall material' , geo = geo , session = session ,
356
- order_by = '- total' )
356
+ order_by = 'total' )
357
357
358
358
floor_dist , _ = get_stat_data (
359
359
'main type of floor material' , geo = geo , session = session ,
360
- order_by = '- total' )
360
+ order_by = 'total' )
361
361
except Exception :
362
362
pass
363
363
@@ -852,22 +852,37 @@ def get_causes_of_death_profile(geo, session):
852
852
try :
853
853
causes_of_death_under_five_data , _ = get_stat_data (
854
854
'causes of death under five' , geo = geo , session = session ,
855
- order_by = '-total' )
855
+ order_by = 'total' )
856
+ except Exception :
857
+ pass
858
+ try :
856
859
causes_of_death_over_five_data , _ = get_stat_data (
857
860
'causes of death over five' , geo = geo , session = session ,
858
- order_by = '-total' )
861
+ order_by = 'total' )
862
+ except Exception :
863
+ pass
864
+ try :
859
865
inpatient_diagnosis_over_five_data , _ = get_stat_data (
860
866
'inpatient diagnosis over five' , geo = geo , session = session ,
861
- order_by = '-total' )
867
+ order_by = 'total' )
868
+ except Exception :
869
+ pass
870
+ try :
862
871
outpatient_diagnosis_over_five_data , _ = get_stat_data (
863
872
'outpatient diagnosis over five' , geo = geo , session = session ,
864
- order_by = '-total' )
873
+ order_by = 'total' )
874
+ except Exception :
875
+ pass
876
+ try :
865
877
inpatient_diagnosis_under_five_data , _ = get_stat_data (
866
878
'inpatient diagnosis under five' , geo = geo , session = session ,
867
- order_by = '-total' )
879
+ order_by = 'total' )
880
+ except Exception :
881
+ pass
882
+ try :
868
883
outpatient_diagnosis_under_five_data , _ = get_stat_data (
869
884
'outpatient diagnosis under five' , geo = geo , session = session ,
870
- order_by = '- total' )
885
+ order_by = 'total' )
871
886
except Exception :
872
887
pass
873
888
@@ -905,7 +920,7 @@ def get_family_planning_clients_profile(geo, session):
905
920
try :
906
921
family_planning_clients_data , _ = get_stat_data (
907
922
'family planning clients' , geo = geo , session = session ,
908
- order_by = '- total' )
923
+ order_by = 'total' )
909
924
total = family_planning_clients_data ['Total' ]['numerators' ]['this' ]
910
925
rate = \
911
926
family_planning_clients_data ['New client rate' ]['numerators' ][
@@ -963,7 +978,7 @@ def get_place_of_delivery_profile(geo, session):
963
978
try :
964
979
delivery_data , _ = get_stat_data (
965
980
'place of delivery' , geo = geo , session = session ,
966
- order_by = '- total' )
981
+ order_by = 'total' )
967
982
anc_projection = delivery_data ['ANC projection' ]['numerators' ][
968
983
'this' ]
969
984
facility_birth_rate = \
@@ -999,7 +1014,7 @@ def get_health_workers_distribution_profile(geo, session):
999
1014
with dataset_context (year = '2015' ):
1000
1015
try :
1001
1016
hw_data , total = get_stat_data (
1002
- 'health workers' , geo = geo , session = session , order_by = '- total' )
1017
+ 'health workers' , geo = geo , session = session , order_by = 'total' )
1003
1018
1004
1019
hrh_patient_ratio = hw_data ['HRH patient ratio' ]['numerators' ][
1005
1020
'this' ]
@@ -1039,7 +1054,7 @@ def get_health_centers_distribution_profile(geo, session):
1039
1054
with dataset_context (year = '2015' ):
1040
1055
try :
1041
1056
hc_data , total = get_stat_data (
1042
- 'health centers' , geo = geo , session = session , order_by = '- total' )
1057
+ 'health centers' , geo = geo , session = session , order_by = 'total' )
1043
1058
ho_data , _ = get_stat_data (
1044
1059
'health center ownership' , geo , session )
1045
1060
hiv_centers_data , hiv_c = get_stat_data (
@@ -1078,7 +1093,7 @@ def get_tetanus_vaccine_profile(geo, session):
1078
1093
with dataset_context (year = '2015' ):
1079
1094
try :
1080
1095
tetanus_vaccine_data , _ = get_stat_data (
1081
- 'tetanus vaccine' , geo = geo , session = session , order_by = '- total' )
1096
+ 'tetanus vaccine' , geo = geo , session = session , order_by = 'total' )
1082
1097
number_vaccinated = \
1083
1098
tetanus_vaccine_data ['Vaccinated' ]['numerators' ][
1084
1099
'this' ]
@@ -1171,7 +1186,7 @@ def get_traffic_and_crimes_profile(geo, session):
1171
1186
traffic_and_crimes , _total_tc = get_stat_data ('traffic and crimes' ,
1172
1187
geo = geo ,
1173
1188
session = session ,
1174
- order_by = '- total' )
1189
+ order_by = 'total' )
1175
1190
1176
1191
# total accidents
1177
1192
@@ -1209,7 +1224,7 @@ def get_traffic_and_crimes_profile(geo, session):
1209
1224
only = person_offences , \
1210
1225
geo = geo ,
1211
1226
session = session ,
1212
- order_by = '- total' )
1227
+ order_by = 'total' )
1213
1228
1214
1229
# cattle theft
1215
1230
cattle_theft_only = ["Cattle Thieves" , "Murdered Cattle Owners" ]
@@ -1243,7 +1258,7 @@ def recoder(f, x):
1243
1258
only = cattle_theft_only , \
1244
1259
geo = geo ,
1245
1260
session = session ,
1246
- order_by = '- total' , \
1261
+ order_by = 'total' , \
1247
1262
recode = recoder )
1248
1263
1249
1264
robbery_only = ['Robbery Victims' , 'Robbery Thieves' ]
@@ -1252,7 +1267,7 @@ def recoder(f, x):
1252
1267
only = robbery_only , \
1253
1268
geo = geo ,
1254
1269
session = session ,
1255
- order_by = '- total' ,
1270
+ order_by = 'total' ,
1256
1271
recode = recoder )
1257
1272
1258
1273
superstitious_only = ["Superstitious Beliefs Albino" ,
@@ -1263,7 +1278,7 @@ def recoder(f, x):
1263
1278
only = superstitious_only , \
1264
1279
geo = geo ,
1265
1280
session = session ,
1266
- order_by = '- total' ,
1281
+ order_by = 'total' ,
1267
1282
recode = recoder )
1268
1283
1269
1284
total_cattletheft_robbery = _total_rf + _total_ct
@@ -1278,7 +1293,7 @@ def recoder(f, x):
1278
1293
only = public_fighting_only , \
1279
1294
geo = geo ,
1280
1295
session = session ,
1281
- order_by = '- total' ,
1296
+ order_by = 'total' ,
1282
1297
recode = recoder )
1283
1298
1284
1299
except Exception :
@@ -1372,7 +1387,7 @@ def get_primary_school_teachers_profile(geo, session):
1372
1387
1373
1388
ps_teachers , n_teachers = get_stat_data ('primary school teachers' , \
1374
1389
geo = geo , session = session ,
1375
- order_by = '- total' )
1390
+ order_by = 'total' )
1376
1391
1377
1392
except Exception :
1378
1393
pass
@@ -1477,7 +1492,7 @@ def get_airport_types_profile(geo, session):
1477
1492
1478
1493
airports_dist , n_airports = get_stat_data ('airport types' , \
1479
1494
geo = geo , session = session ,
1480
- order_by = '- total' )
1495
+ order_by = 'total' )
1481
1496
1482
1497
except Exception as e :
1483
1498
pass
0 commit comments