コード例 #1
0
 private function createPhysicianModels()
 {
     DB::table('physicians')->truncate();
     $rows = DB::select(DB::raw('select * from imis_raw'));
     foreach ($rows as $row) {
         $locationData = $this->getPhysicianLocationData($row);
         if (!$locationData) {
             Log::error('Could not geolocate ' . $row->full_name);
             continue;
         }
         $physician = \App\Physician::create(['aoa_mem_id' => $row->id, 'full_name' => $row->full_name, 'prefix' => $row->prefix, 'first_name' => $row->first_name, 'middle_name' => $row->middle_name, 'last_name' => $row->last_name, 'suffix' => $row->suffix, 'designation' => $row->designation, 'SortColumn' => $row->SortColumn, 'MemberStatus' => $row->MemberStatus, 'City' => $row->City, 'State_Province' => $row->State_Province, 'Zip' => $row->Zip, 'Country' => $row->Country, 'COLLEGE_CODE' => $row->COLLEGE_CODE, 'YearOfGraduation' => $row->YearOfGraduation, 'fellows' => $row->fellows, 'PrimaryPracticeFocusCode' => $row->PrimaryPracticeFocusCode, 'PrimaryPracticeFocusArea' => $row->PrimaryPracticeFocusArea, 'SecondaryPracticeFocusCode' => $row->SecondaryPracticeFocusCode, 'SecondaryPracticeFocusArea' => $row->SecondaryPracticeFocusArea, 'website' => $row->website, 'AOABoardCertified' => $row->AOABoardCertified == 'YES' ? 1 : 0, 'address_1' => $row->address_1, 'address_2' => $row->address_2, 'Phone' => $row->Phone, 'Email' => $row->Email, 'ABMS' => $row->ABMS == 'YES' ? 1 : 0, 'Gender' => $row->Gender, 'CERT1' => $row->CERT1, 'CERT2' => $row->CERT2, 'CERT3' => $row->CERT3, 'CERT4' => $row->CERT4, 'CERT5' => $row->CERT5, 'lat' => $locationData->lat, 'lon' => $locationData->lon, 'geo_confidence' => $locationData->geo_confidence, 'geo_city' => $locationData->geo_city, 'geo_state' => $locationData->geo_state, 'geo_matches' => $locationData->geo_matches]);
     }
 }
コード例 #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;
 }
コード例 #3
0
 /**
  * Show a physician
  *
  * @return void
  * @author PJ
  */
 public function show($id)
 {
     $physician = Physician::find($id);
     return $this->response->withItem($physician, new PhysicianTransformer());
 }
コード例 #4
0
ファイル: ResultsController.php プロジェクト: pjsinco/lookup
 /**
  * Show a list of results.
  *
  * @return void
  * @author PJ
  */
 public function index(Request $request)
 {
     $input = $request->input();
     $results = Physician::where('City', '=', $input['city'])->where('State_Province', '=', $input['state'])->get();
     dd($results->all());
 }
コード例 #5
0
 /**
  * Show a physician
  *
  * @return void
  * @author PJ
  */
 public function show($id)
 {
     $physician = Physician::find($id);
     if ($physician) {
         return $this->response->withItem($physician, new PhysicianTransformer());
     }
     $errorMeta = ['error' => ['code' => 'GEN-NOT-FOUND', 'http_code' => 404, 'message' => 'Physician not found']];
     return $this->response->withArray($errorMeta);
     //$resource = new Fractal\Resource\Item($phys, new PhysicianTransformer);
     //$output = $this->manager->createData($resource)->toArray();
     //return $output;
     //return $this->respond([
     //'data' => $this->physicianTransformer->transform($physician)
     //]);
 }
コード例 #6
0
 public function edit($id)
 {
     $physician = Physician::findOrFail($id);
     return view('physician.edit')->with('physician', $physician);
 }