def hospComparison(): if request.method == 'POST': if 'btnHospComp' in request.form: ## 地區 county = request.form.get('hospCounty') township = request.form.get("hospTownship") ## 醫療機構名稱 name1 = request.form.get('hospName1') name2 = request.form.get('hospName2') name3 = request.form.get('hospName3') names = [name1, name2, name3] ## 醫院層級 types = request.values.getlist('hospType') ## Google星等 star = request.form.get("hospStar") if star == None: star = '' return Comp().comp_hosp(county, township, names, types, star) elif 'btnSearchHosp' in request.form: ## 地區 county = request.form.get('hospCounty') township = request.form.get("hospTownship") ## 醫療機構名稱 name1 = request.form.get('hospName1') name2 = request.form.get('hospName2') name3 = request.form.get('hospName3') names = [name1, name2, name3] ## 醫院層級 types = request.values.getlist('hospType') ## Google星等 star = request.form.get("hospStar") if star == None: star = '' return Hosp().search_hosp(county, township, names, types, star)
def hospSubjResult(): if request.method == 'POST': for id in range(8071): ## 按鈕【主觀指標】 if ('btnSubj'+str(id)) in request.form: hosp_info = SelectData().hosp_info(id) return render_template('hospSubjResult.html', hosp_info=hosp_info) ## 按鈕【客觀指標】 if ('btnObj'+str(id)) in request.form: hosp_info = SelectData().hosp_info(id) return render_template('hospObjResult.html', hosp_info=hosp_info) ## 按鈕【搜尋】 if ('btnSearch'+str(id)) in request.form: subjectives = request.values.getlist('subjective') return Hosp().search_subj(id, subjectives)