def find_match(): for i in file.iterrows(): name = str(i[1]['hosp_name']).split(',')[0] out = Hospital.find_by_name(_name=name) out = out.order_by(Hospital.hosp_name).all() found = False if out: for one_id in out: if str(str(i[1]['hosp_name']).split(',') [-1]).upper() in one_id.hosp_addr: print('sor') print('\t', one_id.hosp_id, one_id.hosp_name, one_id.hosp_addr) found = True print('eor')
def serach_for_hosp(search_term): results1 = Hospital.find_by_name(_name=search_term).all() results2 = Hospital.find_by_addr(_addr=search_term).all() results = results1 + results2 return list(set(results))