def test_get_nurse():
    assert NurseUser.get_nurse("1133069") == {
        '_id': '1133069',
        'name': 'צביה כיאב',
        'work_years': '45',
        'role': 'main_nurse',
        'email': '*****@*****.**',
        'id_num': '0',
        'courses': 'מיילדות, על בסיסי, ניהול',
        'employment_percentage': '100%',
        'is_admin': True
    }


#########################################################################################################################
# check this user methods
# print(NurseUser.get_nurse("1133069"))
# print(NurseUser.get_all_nurses_names())
# print(Department.get_hospital_statistic_year("/19"))
# print(NurseStatistics.get_nurse("1133069"))
# print(Department.count_hospital_prognoza("AFTER", "19"))
# print all data in collection
# for doc in my_db.nurese_details_col.find():
#     print(doc)
# nurse = NurseStatistics("1133069")
# print(nurse.cs)
# hospital = Department("19")
# print(hospital.cs)
# print(NurseUser.get_nurse("1133069")._id)

# print(NurseUser().get_nurse('113069')['id_num']
Ejemplo n.º 2
0
def nurse():
    if 'user' in session:
        nurse = []
        nurse.append(NurseUser.get_nurse(session['user']))
        if 'user' in session:
            id = session['user']
        nurse_statistics = NurseStatistics(id)
        return render_template('nurse_screen.html', posts=nurse, posts_nurse=nurse_statistics, url='../static/images/multiple_bar.png')
Ejemplo n.º 3
0
def register_nurse():
    form = RegisterNurseForm()
    if form.validate_on_submit():
        # if NurseUser().register_nurse() == 1:
        #     flash('Register Unsuccessful. Please check the the licence id, nurse is already in the system', 'danger')
        #     return redirect(url_for('register_nurse'))
        if NurseUser().register_nurse():
            flash('You have been Register a Nurse!', 'success')
            return redirect(url_for('nurses'))
        else:
            flash('Register Unsuccessful.', 'danger')
    else:
        return render_template('register_nurse.html', title='register_nurse', form=form)
Ejemplo n.º 4
0
import os
from flask import Flask

from DB.Models.nurse_user import NurseUser
from DB.db import insert_admin_nurse

app = Flask(__name__)
app.config['SECRET_KEY'] = os.getenv('SECRET_KEY')

cwd = os.path.abspath('../')
files = os.listdir(cwd)

import routes
# import tests_app
import visualization

# insert hospital statistic to the my_db
# DBCron().load_from_csv_to_db()

# insert admin nurse to nurse_details_col
if NurseUser().get_nurse("1133069"):
    pass
else:
    insert_admin_nurse('0')
Ejemplo n.º 5
0
def nurses():
    nurses_names = NurseUser.get_all_nurses_names()
    return render_template('nurses_screen.html', posts=nurses_names)
Ejemplo n.º 6
0
def get_all_nurses_name():
    all_nurses_names = NurseUser.get_all_nurses_names()
    return jsonify(all_nurses_names)
Ejemplo n.º 7
0
def get_all_nurses_data():
    all_nurses = NurseUser.get_all_nurses(nurse_details_col)
    return jsonify(all_nurses)
Ejemplo n.º 8
0
def get_nurse_route(id):
    nurse = NurseUser.get_nurse(id)             # the _id is the licence number of the nurse
    return jsonify(nurse)
Ejemplo n.º 9
0
def delete_nurse(id):
    NurseUser.delete_nurse_id(id)
    return redirect(url_for('nurses'))