def six(): if request.method == 'POST': issue = request.form['issue'] authkey = token.getToken() return render_template("disease_information.html", authkey=authkey, issue=issue)
def five(): if request.method == 'POST': gender = request.form['Gender'] age = request.form["Age"] symptoms = request.form['ID'] print(symptoms, age, gender) authkey = token.getToken() return render_template("patient_information.html", authkey=authkey, gender=gender, age=age, symptoms=symptoms)
def three(): authkey = token.getToken() return render_template("disease_information.html", authkey=authkey)
def two(): authkey = token.getToken() return render_template("patient_information.html", authkey=authkey)
def one(): authkey = token.getToken() return render_template("dashboard.html", authkey=authkey)
import ast import urllib.request import tokenGen as token import config authKey = token.getToken() def fetch(symptomMC, gender, year_of_birth): urlMedicalCondition = config.priaid_healthservice_url + "/diagnosis?symptoms=[" + symptomMC + "]&gender=" + gender + "&year_of_birth=" + year_of_birth + "&token=" + authKey + "&format=json&language=en-gb" resultsMC = urllib.request.urlopen( urlMedicalCondition).read() # returns a byte string medicalConditionsList = ast.literal_eval( resultsMC.decode("utf-8") ) # converting the byte string to string and then parsing it into a list medicalConditionsDict = {} index = 1 for issue in medicalConditionsList: medicalConditionsDict[index] = issue['Issue']['Name'] index = index + 1 return medicalConditionsDict