@@ -1084,9 +1084,9 @@ public function InitSurveys()
1084
1084
//
1085
1085
// Load survey data.
1086
1086
//
1087
- $ data_points = $ this ->loadSurveyData ( $ line [ 'SurveyId ' ] );
1088
- if ( count ( $ data_points ) )
1089
- $ document [ kTAG_DATA ] = $ data_points ;
1087
+ // $data_points = $this->loadSurveyData( $line[ 'SurveyId' ] );
1088
+ // if( count( $data_points ) )
1089
+ // $document[ kTAG_DATA ] = $data_points;
1090
1090
1091
1091
//
1092
1092
// Save document.
@@ -1135,9 +1135,9 @@ public function InitSurveys()
1135
1135
*==================================================================================*/
1136
1136
1137
1137
/**
1138
- * <h4>Initialise surveys .</h4>
1138
+ * <h4>Initialise survey data .</h4>
1139
1139
*
1140
- * This method will load the surveys.
1140
+ * This method will load the surveys data at sub-national level .
1141
1141
*/
1142
1142
public function InitData ()
1143
1143
{
@@ -1146,8 +1146,8 @@ public function InitData()
1146
1146
//
1147
1147
$ collection = $ this ->mDatabase ->NewDataCollection ();
1148
1148
$ page = 1 ;
1149
- $ lines = 100 ;
1150
- $ url = self ::kDHS_URL_DATA . "&page= $ page&perpage= $ lines " ;
1149
+ $ lines = 600 ;
1150
+ $ url = self ::kDHS_URL_DATA . "subnational?f=json &page=$ page&perpage= $ lines " ;
1151
1151
1152
1152
//
1153
1153
// Read data.
@@ -1185,8 +1185,11 @@ public function InitData()
1185
1185
//
1186
1186
// Set identifiers.
1187
1187
//
1188
- $ document [ $ collection ->KeyOffset () ]
1189
- = $ line [ 'SurveyId ' ] . ': ' . $ line [ 'DataId ' ];
1188
+ $ document [ $ collection ->KeyOffset () ] = (int )$ line [ 'DataId ' ];
1189
+ // $document[ $collection->KeyOffset() ]
1190
+ // = $line[ 'SurveyId' ] . ':'
1191
+ // . $line[ 'RegionId' ] . ':'
1192
+ // . $line[ 'DataId' ];
1190
1193
1191
1194
//
1192
1195
// Set other data.
@@ -1252,7 +1255,7 @@ public function InitData()
1252
1255
// Get next.
1253
1256
//
1254
1257
$ page ++;
1255
- $ url = self ::kDHS_URL_DATA . "&page= $ page&perpage= $ lines " ;
1258
+ $ url = self ::kDHS_URL_DATA . "subnational?f=json &page=$ page&perpage= $ lines " ;
1256
1259
$ retries = self ::kRETRIES;
1257
1260
while ( $ retries -- )
1258
1261
{
0 commit comments