def _compare_vardecentraler_with_hitta (self): for vrow_h in self.vardcentraler_reader: #------------------------------------------------------------------------------- # Special Case if vrow_h['PARENT_WORKPLACE_NAME'] == 'Familjeläkarna i Sverige AB': vrow_h['PARENT_WORKPLACE_NAME'] = 'Familjeläkarna' #------------------------------------------------------------------------------- hitta_results_rows_h = self.hitta_results_h.get (vrow_h['PARENT_WORKPLACE_NAME'], []) eniro_results_rows_h = self.eniro_results_h.get (vrow_h['PARENT_WORKPLACE_NAME'], []) hitta_eniro_results_rows_h = hitta_results_rows_h + eniro_results_rows_h row_h = self._get_best_matching_row_h (vrow_h, hitta_eniro_results_rows_h) if row_h: if not row_h['FOUND_NAME']: row_h['VARDCENTRAL'] = "NO" elif self.primary_clinic_results_h.get (row_h['FOUND_NAME'], []): row_h['VARDCENTRAL'] = "YES" else: row_h['VARDCENTRAL'] = "NO" self._set_color (row_h) csv_hitta_vardcentraler.write_row_h(row_h)
def parse(self): """def: parse""" for row_h in self.doctor_match_result_reader: if not row_h["FOUND_DOCTORS_URL"]: csv_hitta_vardcentraler.write_row_h(row_h) continue if row_h["FOUND_DOCTORS_URL"] == "": csv_hitta_vardcentraler.write_row_h(row_h) continue home_urls = row_h["FOUND_DOCTORS_URL"] self.doctor_tag = row_h["FOUND_DOCTOR_TAG"] all_names = [] for home_url in row_h["FOUND_DOCTORS_URL"].split("|"): names = self.get_all_names(home_url) all_names = all_names + names all_names_str = "|".join(all_names) row_h["FOUND_ALL_NAMES"] = cp1252(all_names_str) csv_hitta_vardcentraler.write_row_h(row_h)
def parse (self): """def: parse""" for row_h in self.doctor_match_result_reader: if not row_h ['FOUND_DOCTORS_URL']: csv_hitta_vardcentraler.write_row_h(row_h) continue if row_h ['FOUND_DOCTORS_URL'] == "": csv_hitta_vardcentraler.write_row_h(row_h) continue home_urls = row_h ['FOUND_DOCTORS_URL'] self.doctor_tag = row_h ['FOUND_DOCTOR_TAG'] all_names = [] for home_url in row_h['FOUND_DOCTORS_URL'].split("|"): names = self.get_all_names (home_url) all_names = all_names + names all_names_str = '|'.join(all_names) row_h["FOUND_ALL_NAMES"] = cp1252(all_names_str) row_h ['DATE'] = datetime.datetime.today().strftime('%Y%m%d') csv_hitta_vardcentraler.write_row_h(row_h)