Exemplo n.º 1
0
def patientFetchPrescriptions():
    patientID = models_common.getIDByEmail(session.get("currentEmail"),
                                           session.get("accType"))
    # print("----------------patientID----------------")
    # print(patientID)
    res = models_patient.patientFetchPrescriptions(patientID)
    return jsonify(res)
Exemplo n.º 2
0
def patientLabRequest():
    if (request.method == "GET"):  #GET all appointments
        patientID = models_common.getIDByEmail(session.get("currentEmail"),
                                               session.get("accType"))
        res = models_patient.patientLabRequest(patientID, None, "GET")
        return jsonify(res)

    elif (request.method == "POST"):  #POST a new appointment
        labID = models_common.getIDByEmail(session.get("currentEmail"),
                                           session.get("accType"))
        payload = request.get_json(
        )  #Converts incoming JSON into Python Dictionary
        print("--------------------------------")
        print(payload)
        res = models_patient.patientLabRequest(labID, payload, "POST")
        return jsonify(res)
Exemplo n.º 3
0
def patientMedicineRequest():
    if (request.method == "GET"):  #GET all Medicine Requests
        patientID = models_common.getIDByEmail(session.get("currentEmail"),
                                               session.get("accType"))
        res = models_patient.patientMedicineRequest(patientID, None,
                                                    "GET")  #None is no payload
        return jsonify(res)

    elif (request.method == "POST"):  #POST a new Medicine Request
        patientID = models_common.getIDByEmail(session.get("currentEmail"),
                                               session.get("accType"))
        payload = request.get_json(
        )  #Converts incoming JSON into Python Dictionary
        # print("--------------------------------")
        # print(payload)
        res = models_patient.patientMedicineRequest(patientID, payload, "POST")
        return jsonify(res)
Exemplo n.º 4
0
def patient():
    if ((not session.get("accType") == "Patient")
            or (not session.get(session.get("accType") + "LoggedIn"))):
        return redirect(url_for("login"), 302)
    return render_template(
        "Patient/patient.html",
        title="Patient",
        user=models_common.getUsernameByEmail(session.get("currentEmail"),
                                              session.get("accType")),
        userID=models_common.getIDByEmail(session.get("currentEmail"),
                                          session.get("accType")),
        userLoggedIn=True)
Exemplo n.º 5
0
def prescriptionResponseUpdate():
    payload = request.get_json()
    ID = models_common.getIDByEmail(session.get("currentEmail"),
                                    session.get("accType"))
    res = models_pharmacy.prescriptionResponseUpdate(payload, ID)
    return jsonify(res)
Exemplo n.º 6
0
def prescriptionRequest():
    ID = models_common.getIDByEmail(session.get("currentEmail"),
                                    session.get("accType"))
    res = models_pharmacy.prescriptionRequest(ID)
    return jsonify(res)
Exemplo n.º 7
0
def patientCalendarReminderUpdate():
    patientID = models_common.getIDByEmail(session.get("currentEmail"),
                                           session.get("accType"))
    res = models_patient.patientCalendarReminderUpdate(patientID)
    return jsonify(res)
Exemplo n.º 8
0
def patientMedicineResponse():
    patientID = models_common.getIDByEmail(session.get("currentEmail"),
                                           session.get("accType"))
    res = models_patient.patientMedicineResponse(patientID)
    return jsonify(res)
Exemplo n.º 9
0
def patientFetchLabDocs():
    patientID = models_common.getIDByEmail(session.get("currentEmail"),
                                           session.get("accType"))
    res = models_patient.patientFetchLabDocs(patientID)
    return jsonify(res)