예제 #1
0
 /**
  * Seed the specialties table.
  *
  * @return void
  * @author PJ
  */
 private function seedTable($data)
 {
     foreach ($data as $lineIndex => $row) {
         $aliases = AggregateReporter::getAliases($row[17]);
         DB::table('physicians')->insert(['aoa_mem_id' => $row[0], 'full_name' => $row[1], 'prefix' => $row[2], 'first_name' => $row[3], 'middle_name' => $row[4], 'last_name' => $row[5], 'suffix' => $row[6], 'designation' => $row[7], 'SortColumn' => $row[8], 'MemberStatus' => $row[9], 'City' => $row[10], 'State_Province' => $row[11], 'Zip' => $row[12], 'Country' => $row[13], 'COLLEGE_CODE' => $row[14], 'YearOfGraduation' => $row[15], 'fellows' => $row[16], 'PrimaryPracticeFocusCode' => $row[17], 'PrimaryPracticeFocusArea' => $row[18], 'SecondaryPracticeFocusCode' => $row[19], 'SecondaryPracticeFocusArea' => $row[20], 'website' => $row[21], 'AOABoardCertified' => $row[22] == 'YES' ? 1 : 0, 'address_1' => $row[23], 'address_2' => $row[24], 'Phone' => $row[25], 'Email' => $row[26], 'ABMS' => $row[27] == 'YES' ? 1 : 0, 'Gender' => $row[28], 'CERT1' => $row[29], 'CERT2' => $row[30], 'CERT3' => $row[31], 'CERT4' => $row[32], 'CERT5' => $row[33], 'lat' => $row[34], 'lon' => $row[35], 'geo_confidence' => $row[36], 'geo_city' => $row[37], 'geo_state' => $row[38], 'geo_matches' => $row[39] == 'True' ? 1 : 0, 'alias_1' => empty($aliases[0]) ? null : $aliases[0]->id, 'alias_2' => empty($aliases[1]) ? null : $aliases[1]->id, 'alias_3' => empty($aliases[2]) ? null : $aliases[2]->id]);
     }
 }
예제 #2
0
 public static function createPhysicianModel($row, Logger $log)
 {
     $locationData = self::getPhysicianLocationData($row, $log);
     if (!$locationData) {
         Log::error('Could not geolocate ' . $row->full_name);
         return;
     }
     $aliases = AggregateReporter::getAliases($row->PrimaryPracticeFocusCode);
     $physician = \App\Physician::create(['aoa_mem_id' => trim($row->id), 'full_name' => trim($row->full_name), 'prefix' => trim($row->prefix), 'first_name' => trim($row->first_name), 'middle_name' => trim($row->middle_name), 'last_name' => trim($row->last_name), 'suffix' => trim($row->suffix), 'designation' => trim($row->designation), 'SortColumn' => trim($row->SortColumn), 'MemberStatus' => trim($row->MemberStatus), 'City' => trim($row->City), 'State_Province' => trim($row->State_Province), 'Zip' => trim($row->Zip), 'Country' => trim($row->Country), 'COLLEGE_CODE' => trim($row->COLLEGE_CODE), 'YearOfGraduation' => trim($row->YearOfGraduation), 'fellows' => trim($row->fellows), 'PrimaryPracticeFocusCode' => trim($row->PrimaryPracticeFocusCode), 'PrimaryPracticeFocusArea' => trim($row->PrimaryPracticeFocusArea), 'SecondaryPracticeFocusCode' => trim($row->SecondaryPracticeFocusCode), 'SecondaryPracticeFocusArea' => trim($row->SecondaryPracticeFocusArea), 'website' => trim($row->website), 'AOABoardCertified' => $row->AOABoardCertified == 'YES' ? 1 : 0, 'address_1' => trim($row->address_1), 'address_2' => trim($row->address_2), 'Phone' => trim($row->Phone), 'Email' => trim($row->Email), 'ABMS' => $row->ABMS == 'YES' ? 1 : 0, 'Gender' => trim($row->Gender), 'CERT1' => trim($row->CERT1), 'CERT2' => trim($row->CERT2), 'CERT3' => trim($row->CERT3), 'CERT4' => trim($row->CERT4), 'CERT5' => trim($row->CERT5), 'lat' => trim($locationData->lat), 'lon' => trim($locationData->lon), 'geo_confidence' => trim($locationData->geo_confidence), 'geo_city' => trim($locationData->geo_city), 'geo_state' => trim($locationData->geo_state), 'geo_matches' => trim($locationData->geo_matches), 'alias_1' => empty($aliases[0]) ? null : $aliases[0]->id, 'alias_2' => empty($aliases[1]) ? null : $aliases[1]->id, 'alias_3' => empty($aliases[2]) ? null : $aliases[2]->id]);
     return !empty($physician) ? true : false;
 }