Пример #1
0
def dispensePing():
    pin = request.args.get('pin')
    pdb = PatientDBHelper()
    data = pdb.getDataForPatient(str(pin))
    dis = DispenseDBHelper()
    dis.toggleDispense()
    msg = "Your prescription is "
    for prescription in data['prescription']:
        msg += prescription['dosage'] + \
            ' of ' + prescription['name'] + \
            ' ' + prescription['instruction']
    msg += ' You will get a text for your next pickup!'
    res = {'num_prescriptions': len(data['prescription']), 'message': msg}
    return jsonify(res)
Пример #2
0
def verification():
    digits = request.form['Digits']
    patientDB = PatientDBHelper()
    resp = VoiceResponse()
    patient = patientDB.getDataForPatient(pin=digits,
                                          phone=request.form['Caller'])
    if (patient):
        resp.say("Welcome back to Pillar, {}. Please "
                 " describe your symptoms after the beep. When you are done,"
                 "please press the pound key. Thank you.".format(
                     patient['name']))
        resp.record(finish_on_key="#",
                    action="https://pillarrestapi.herokuapp.com/endcall",
                    method="POST",
                    transcribe_callback=
                    "https://pillarrestapi.herokuapp.com/transcribe/" + digits)
    else:
        resp.say("Sorry, we were unable to verify you. Goodbye.")

    return str(resp)
Пример #3
0
def patientData():
    p = PatientDBHelper()
    return jsonify(p.getAllPatients())
Пример #4
0
def getPatientDataFor():
    p = PatientDBHelper()
    name = request.args.get("name")
    return p.getDataForPatientName(name)
Пример #5
0
def getPatientDataFor(name):
    p = PatientDBHelper()
    return jsonify(p.getDataForPatientName(name))
Пример #6
0
def transcribe(digits):
    dbHelper = PatientDBHelper()
    dbHelper.addMedicalDataForPatient(digits,
                                      request.form['TranscriptionText'])
    return "Transcription added to Patient Database."