Exemplo n.º 1
0
def hospital_details():
    selected_id = str(request.args.get('hosp_id'))
    hosp = Hospital.find_by_id(selected_id)
    specs_up = hosp.hosp_spec_upgraded
    specs_emp = hosp.hosp_spec_empanl
    dec_specs_up = decodeSpecialties(specs_up)
    dec_specs_emp = decodeSpecialties(specs_emp)
    # from views import AddScheme
    # form = AddScheme()
    # if form.is_submitted():
    #     sch_id = form.sch.data
    #     print(sch_id)
    #     scheme = Scheme.find_by_scheme_id(sch_id)
    #     print(scheme.name)
    #     hosp.Schemes.append(scheme)
    #     hosp.save_to_db()
    #     return render_template('hospitalDetails.html', title='Hospital Details', data=hosp, specs_up=dec_specs_up,
    #                        specs_emp=dec_specs_emp, auth=is_auth())
    return render_template('hospitalDetails.html', title='Hospital Details', data=hosp, specs_up=dec_specs_up,
                           specs_emp=dec_specs_emp, auth=is_auth())
Exemplo n.º 2
0
def add_scheme_by_hosp_id(hosp_id, scheme_id):
    from models import Hospital, Scheme
    hosp = Hospital.find_by_id(int(hosp_id))
    scheme = Scheme.find_by_scheme_id(scheme_id)
    hosp.Schemes.append(scheme)
    hosp.save_to_db()