Ejemplo n.º 1
0
def six():
    if request.method == 'POST':
        issue = request.form['issue']
        authkey = token.getToken()
        return render_template("disease_information.html",
                               authkey=authkey,
                               issue=issue)
Ejemplo n.º 2
0
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)
Ejemplo n.º 3
0
def three():
    authkey = token.getToken()
    return render_template("disease_information.html", authkey=authkey)
Ejemplo n.º 4
0
def two():
    authkey = token.getToken()
    return render_template("patient_information.html", authkey=authkey)
Ejemplo n.º 5
0
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