Exemple #1
0
def newprovider():
    if checkSession() == False:
        return redirect('login')
    if request.form.get('PCPID') is None:
        pr = providerList()
        pr.set('PCPID', '')
        pr.set('DOH', '')
        pr.set('Name', '')
        pr.set('SSN', '')
        pr.set('Specialty', '')
        pr.add()
        return render_template('provider/newprovider.html',
                               title='New Provider',
                               providers=pr.data[0])
    else:
        pr = providerList()
        pr.set('PCPID', request.form.get('PCPID'))
        pr.set('DOH', request.form.get('DOH'))
        pr.set('Name', request.form.get('Name'))
        pr.set('SSN', request.form.get('SSN'))
        pr.set('Specialty', request.form.get('Specialty'))
        pr.add()
        if pr.verifyNew():
            pr.insert()
            print(pr.data)
            return render_template('provider/savedprovider.html',
                                   title='Provider Saved',
                                   providers=pr.data[0])
        else:
            return render_template('provider/newprovider.html',
                                   title='Provider Not Saved',
                                   providers=pr.data[0])
Exemple #2
0
def newtransaction():
    if checkSession() == False:
        return redirect('login')
    AllPatients = patientList()
    AllPatients.getAll()
    #print(AllPatients.data)
    AllProviders = providerList()
    AllProviders.getAll()
    #print(AllProviders.data)
    AllAdmins = adminList()
    AllAdmins.getAll()
    #print(AllAdmins.data)
    if request.form.get('TransactionID') is None:
        t = transactionList()
        t.set('TransactionID', '')
        t.set('Date', '')
        t.set('Amount', '')
        t.set('Status', '')
        t.set('Insurance', '')
        t.set('Notes', '')
        t.set('AdminID', '')
        t.set('PatientID', '')
        t.set('PCPID', '')
        t.add()
        return render_template('transaction/newtransaction.html',
                               title='New Transaction',
                               transaction=t.data[0],
                               pl=AllPatients.data,
                               prl=AllProviders.data,
                               al=AllAdmins.data)
    else:
        t = transactionList()
        t.set('TransactionID', request.form.get('TransactionID'))
        t.set('Date', request.form.get('Date'))
        t.set('Amount', request.form.get('Amount'))
        t.set('Status', request.form.get('Status'))
        t.set('Insurance', request.form.get('Insurance'))
        t.set('Notes', request.form.get('Notes'))
        t.set('AdminID', request.form.get('AdminID'))
        t.set('PatientID', request.form.get('PatientID'))
        t.set('PCPID', request.form.get('PCPID'))
        t.add()
        if t.verifyNew():
            t.insert()
            print(t.data)
            return render_template('transaction/savedtransaction.html',
                                   title='Transaction Saved',
                                   transaction=t.data[0],
                                   pl=AllPatients.data,
                                   prl=AllProviders.data,
                                   al=AllAdmins.data)
        else:
            return render_template('Transaction/newtransaction.html',
                                   title='Transaction Not Saved',
                                   transaction=t.data[0],
                                   msg=t.errorList,
                                   pl=AllPatients.data,
                                   prl=AllProviders.data,
                                   al=AllAdmins.data)
Exemple #3
0
def providers():
    if checkSession() == False:
        return redirect('login')
    pr = providerList()
    pr.getAll()

    print(pr.data)
    #return ''
    return render_template('provider/providers.html',
                           title='List of Providers',
                           providers=pr.data)
Exemple #4
0
def provider():
    if checkSession() == False:
        return redirect('login')
    pr = providerList()
    if request.args.get(pr.pk) is None:
        return render_template('error.html', msg='No Provider ID given.')

    pr.getById(request.args.get(pr.pk))
    if len(pr.data) <= 0:
        return render_template('error.html', msg='Provider not found.')

    print(pr.data)
    return render_template('provider/provider.html',
                           title='Provider ',
                           providers=pr.data[0])
Exemple #5
0
def saveprovider():
    if checkSession() == False:
        return redirect('login')
    pr = providerList()
    pr.set('PCPID', request.form.get('PCPID'))
    pr.set('DOH', request.form.get('DOH'))
    pr.set('Name', request.form.get('Name'))
    pr.set('SSN', request.form.get('SSN'))
    pr.set('Specialty', request.form.get('Specialty'))
    pr.add()
    pr.update()
    #print(pr.data)
    #return ''
    return render_template('provider/savedprovider.html',
                           title='Provider Saved',
                           provider=pr.data[0],
                           msg=pr.errorList)
Exemple #6
0
def newpatient():
    if checkSession() == False:
        return redirect('login')
    AllProviders = providerList()
    AllProviders.getAll()
    if request.form.get('PatientID') is None:
        p = patientList()
        p.set('PatientID', '')
        p.set('fname', '')
        p.set('lname', '')
        p.set('DOB', '')
        p.set('SSN', '')
        p.set('Notes', '')
        p.set('PCPID', '')
        p.add()
        return render_template('patient/newpatient.html',
                               title='New Patient',
                               patient=p.data[0],
                               prl=AllProviders.data)
    else:
        p = patientList()
        p.set('PatientID', request.form.get('PatientID'))
        p.set('fname', request.form.get('fname'))
        p.set('lname', request.form.get('lname'))
        p.set('DOB', request.form.get('DOB'))
        p.set('SSN', request.form.get('SSN'))
        p.set('Notes', request.form.get('Notes'))
        p.set('PCPID', request.form.get('PCPID'))
        p.add()
        if p.verifyNew():
            p.insert()
            print(p.data)
            return render_template('patient/savedpatient.html',
                                   title='Patient Saved',
                                   patient=p.data[0],
                                   prl=AllProviders.data)
        else:
            return render_template('patient/newpatient.html',
                                   title='Patient Not Saved',
                                   patient=p.data[0],
                                   msg=t.errorList,
                                   prl=AllProviders.data)