Exemplo n.º 1
0
def guest_index(request):
    doctors = DoctorDb().select();
    patients = PatientDb().select();
    context={
        'menu':1,
        'section':'guest_index.html',
        'doctNum':doctors.index(doctors[-1]) + 1,
        'patNum':patients.index(patients[-1]) + 1,
    };
    return render(request, 'guest_base.html', context);
Exemplo n.º 2
0
def index(request):
    doctors = DoctorDb().select();
    patients = PatientDb().select();
    context={
        'menu':1,
        'section':'index.html',
        'doctNum':doctors.index(doctors[-1]) + 1,
        'patNum':patients.index(patients[-1]) + 1,
        'loginuser': DoctorDb().selectone(request.session['suser']),
    };
    return render(request, 'base.html', context);
Exemplo n.º 3
0
def guest_hospitalstructure(request):
    patients = PatientDb().select();
    context={
        'menu':2,
        'patient': patients,
        'section':'guest_hospitalstructure.html' ,
    };
    return render(request, 'guest_base.html', context);
Exemplo n.º 4
0
def hospitalstructure(request):
    patients = PatientDb().select();
    context={
        'patient': patients,
        'menu':2,
        'section':'hospitalstructure.html' ,
        'loginuser': DoctorDb().selectone(request.session['suser']),
    };
    return render(request, 'base.html', context);
Exemplo n.º 5
0
def guest_thirdfloor(request):
    patients = PatientDb().select();
    context = {
        'menu': 2,
        'patient': patients,
        'section': 'guest_hospitalstructure.html',
        'content1':'guest_thirdfloor.html'
    }
    return render(request, "guest_base.html", context);
Exemplo n.º 6
0
def thirdfloor(request):
    patients = PatientDb().select();
    context = {
        'menu': 2,
        'patient': patients,
        'section': 'hospitalstructure.html',
        'content1':'thirdfloor.html',
        'loginuser': DoctorDb().selectone(request.session['suser']),
    }
    return render(request, "base.html", context)
Exemplo n.º 7
0
def patients(request):
    spatientlist = PatientDb().select();
    context={
        'menu':4,
        'section':'patients.html',
        'patientlist.html':'patientlsit.html',
        'rsusers':spatientlist,
        'loginuser': DoctorDb().selectone(request.session['suser']),
    };
    return render(request, 'base.html',context);
Exemplo n.º 8
0
def doc_patientlist(request):
    did = request.GET['id'];
    docplist = DoctorDb().selectone(did);
    chartinfo = ChartDb().select();
    cpatient = PatientDb().select();
    context={
        'doc_patient': docplist,
        'chartinfo': chartinfo,
        'cpatient': cpatient
    };
    return render(request, 'doc_patientlist.html',context);
Exemplo n.º 9
0
def add_treatment(request):
    did = request.GET['id'];
    doc = DoctorDb().selectone(did);
    spatientlist = PatientDb().select();
    context={
        'menu': 3,
        'section': 'add_treatment.html',
        'doc': doc,
        'rsusers': spatientlist,
        'loginuser': DoctorDb().selectone(request.session['suser']),
    };
    return render(request, 'base.html',context);
Exemplo n.º 10
0
def graph(request):
    beds = 19;
    patients = PatientDb().select();
    patNum = patients[-1].pid;
    print(patNum);
    datas= [
            ['Empty beds', beds - patNum],
            ['Patients', patNum],
        ]
    context = {
      'datas':datas
    };
    return JsonResponse(context);
Exemplo n.º 11
0
def chart(request):
    pid = request.GET['id'];
    cpatient = PatientDb().selectone(int(pid));
    chartinfo = ChartDb().selectone(int(pid));
    allchartinfo = ChartDb().select();
    alltreat = TreatmentDb().select();
    context = {
        'chartpatient': cpatient,
        'chartinfo': chartinfo,
        'allchartinfo': allchartinfo,
        'alltreat': alltreat,
    };
    return render(request,'chart.html',context);
Exemplo n.º 12
0
def patientaddimpl(request):
    name = request.POST['name'];
    roomno = request.POST['roomno'];
    roombed = request.POST['roombed'];
    phone = request.POST['phone'];
    home = request.POST['home'];
    try:
        PatientDb().insert(roomno, int(roombed), name, phone, home);
    except:
        context={
            'section':'pat_insert_error.html'
        };
        return render(request,'patients',context);
    return redirect('patients');
Exemplo n.º 13
0
def add_chart(request):
    did = request.GET['id']
    doc = DoctorDb().selectone(did)
    spatientlist = PatientDb().select()
    atreatment = TreatmentDb().select()
    adisease = DiseaseDb().select()
    context = {
        'menu': 3,
        'section': 'add_chart.html',
        'doc': doc,
        'rsusers': spatientlist,
        'treat': atreatment,
        'diseasecode': adisease,
        'loginuser': DoctorDb().selectone(request.session['suser']),
    }
    return render(request, 'base.html', context)
Exemplo n.º 14
0
def guest_popup302(request):
    patients = PatientDb().select();
    context = {
        'patient': patients
    };
    return render(request, 'guest_popup302.html', context);
Exemplo n.º 15
0
def popup302(request):
    patients = PatientDb().select()
    context = {
        'patient': patients
    }
    return render(request, 'popup302.html', context)
Exemplo n.º 16
0
def guest_popup301(request):
    patients = PatientDb().select()
    context = {
        'patient': patients
    }
    return render(request, 'guest_popup301.html', context)
Exemplo n.º 17
0
def popup301(request):
    patients = PatientDb().select();
    context = {
        'patient': patients
    };
    return render(request, 'popup301.html', context);