def find_nct_by_page(): requestion_dict = request.get_json() working_nct_id_list = requestion_dict['working_nct_id_list'] npag = requestion_dict['npag'] nct_details_for_this_page = qst.find_nct_details(working_nct_id_list,npag) size_of_active_trials = qst.find_size_of_active_trials(working_nct_id_list) return jsonify(working_nct_id_list = working_nct_id_list, npag = npag, nct_details_for_this_page = nct_details_for_this_page, size_of_active_trials = size_of_active_trials)
def get_to_pre_questions(): # # get parameters # locn = request.args.get('locn') # miles = request.args.get('miles') # trial_type = request.args.get('trial_type') # active_restriction = request.args.get('active_restriction') # keyword_search = request.args.get('keyword_search') # retrieve trials within set mile range of given zip code # znct = ctgov.get_nct_list_from_zip(locn, miles) # znct = session.get('nearby_nct_list') # print('rnct: ' + str(znct)) # retrieve trials based on keyword search provided by user # knct = ctgov.get_nct_list_from_keywords(keyword_search) # knct = session.get('keyword_trial_list') # print('knct: ' + str(knct)) # retrieve trials which are of a given trial type and status (based on active restriction checkbox) # anct = qst.find_active_nct_id_list(trial_type, active_restriction) # anct = session.get('trial_type_list') # print('anct: ' + str(anct)) # compare nearby nct list with active list # zanct = [] # nearby_nct_list = [x.split(';')[0] for x in znct] # keyword_nct_list = [x.split(';')[0] for x in knct] # for item in anct: # split_item = item.split(';') # if split_item[1] in nearby_nct_list and split_item[1] in keyword_nct_list: # zanct.append([split_item[0], split_item[1], int(split_item[2])]) # # working_nct_id_list = qst.init_working_nct_id_list(zanct) # session['nearby_active_nct_list'] = zanct working_nct_list_pre_process = session.get('working_nct_list_pre_process') working_nct_id_list = qst.init_working_nct_id_list( working_nct_list_pre_process) unique_nct_ct = qst.find_size_of_active_trials(working_nct_id_list) return jsonify(working_nct_id_list=working_nct_id_list, unique_nct_ct=unique_nct_ct)
def find_nct_by_page(): requestion_dict = request.get_json() working_nct_id_list = requestion_dict['working_nct_id_list'] npag = requestion_dict['npag'] nct_details_for_this_page = qst.find_nct_details(working_nct_id_list, npag) print('find_nct_by_page: ' + str(working_nct_id_list)) size_of_active_trials = qst.find_size_of_active_trials(working_nct_id_list) print('size_of_active_trials: ' + str(size_of_active_trials)) # fengyang nct_loc_for_this_page = qst.find_all_locations_on_current_page( working_nct_id_list, npag)[0] nct_id_rep_for_this_page = qst.find_all_locations_on_current_page( working_nct_id_list, npag)[1] # print('len_of_all_marker: '+ str(len(nct_loc_for_this_page))) # nct_log_nearby input_latlng = requestion_dict['input_zipcode_latlng'] input_miles = requestion_dict['input_miles'] nct_loc_nearby_for_this_page = qst.find_nct_loc_within_range( nct_loc_for_this_page, nct_id_rep_for_this_page, input_latlng, input_miles)[0] nct_id_nearby_for_this_page = qst.find_nct_loc_within_range( nct_loc_for_this_page, nct_id_rep_for_this_page, input_latlng, input_miles)[1] nct_title_nearby_for_this_page = \ qst.find_nct_loc_within_range(nct_loc_for_this_page, nct_id_rep_for_this_page, input_latlng, input_miles)[2] return jsonify( working_nct_id_list=working_nct_id_list, npag=npag, nct_details_for_this_page=nct_details_for_this_page, size_of_active_trials=size_of_active_trials, # fengyang nct_loc_for_this_page=nct_loc_for_this_page, nct_loc_nearby_for_this_page=nct_loc_nearby_for_this_page, nct_id_nearby_for_this_page=nct_id_nearby_for_this_page, nct_title_nearby_for_this_page=nct_title_nearby_for_this_page, )