def post(self, *args): doctor = Doctor() user = User() order = Order() self.set_header("Content-Type", "application/json") if args[0] == 'addorderpeople': self.write(user.update_order_people_info( self.current_user, self.get_argument('name'), self.get_argument('id_card'), self.get_argument('telephone'), self.get_argument('hospital_card') )) elif args[0] == 'getordersize': self.write(doctor.get_ordersize_by_date(self.get_argument("date"), self.get_argument("doctor_id"))) elif args[0] == 'createorder': order_info = { 'user_id': self.current_user, 'doctor_id': self.get_argument('doctor_id'), 'community': self.get_argument('community'), 'doctor': self.get_argument('doctor'), 'hospital_card': self.get_argument('hospital_card'), 'id_card': self.get_argument('id_card'), 'name': self.get_argument('name'), 'telephone': self.get_argument('telephone'), 'time': self.get_argument('time') } self.write(order.create_order(order_info))
def get(self, *args): doctor = Doctor() user = User() order = Order() if args[0] == '': self.render('doctor/index.html') elif args[0] == 'neworder': self.render('doctor/choose-doctor.html', doctor_info=doctor.get_all_doctors()) elif args[0] == 'choosetime': self.render('doctor/choose-time.html') elif args[0] == 'createorder': self.render('doctor/create-order.html', doctor_info=doctor.get_doctor_by_id( self.get_argument("doctor_id")), order_people_info=user.get_order_people_info( self.current_user)) elif args[0] == 'addorderpeople': self.render('doctor/add-order-people.html') elif args[0] == 'listorder': self.render('doctor/list-order.html', order_info=order.get_all_order_by_user( self.current_user)) elif args[0] == 'orderdetail': self.render('doctor/order-detail.html', order_info=order.get_order_by_id( self.get_argument('order_id'))) else: self.write('<h1>功能正在开发,请耐心等待</h1>')
def post(self, *args): doctor = Doctor() user = User() order = Order() self.set_header("Content-Type", "application/json") if args[0] == 'addorderpeople': self.write( user.update_order_people_info( self.current_user, self.get_argument('name'), self.get_argument('id_card'), self.get_argument('telephone'), self.get_argument('hospital_card'))) elif args[0] == 'getordersize': self.write( doctor.get_ordersize_by_date(self.get_argument("date"), self.get_argument("doctor_id"))) elif args[0] == 'createorder': order_info = { 'user_id': self.current_user, 'doctor_id': self.get_argument('doctor_id'), 'community': self.get_argument('community'), 'doctor': self.get_argument('doctor'), 'hospital_card': self.get_argument('hospital_card'), 'id_card': self.get_argument('id_card'), 'name': self.get_argument('name'), 'telephone': self.get_argument('telephone'), 'time': self.get_argument('time') } self.write(order.create_order(order_info))
def view_Booking_Page(): bookings = root.child('bookings').get() list = [] #store booking objects for typeid in bookings: eachbooking = bookings[typeid] if eachbooking['type'] == 'idoctor': doctor = Doctor(eachbooking['name'], eachbooking['age'], eachbooking['phoneNumber'], eachbooking['email'], eachbooking['startingDateAndTime'], eachbooking['type'], eachbooking['specialization1']) doctor.set_typeid(typeid) print(doctor.get_typeid()) list.append(doctor) elif eachbooking['type'] == 'iinstructor': instructor = Instructor(eachbooking['name'], eachbooking['age'], eachbooking['phoneNumber'], eachbooking['email'], eachbooking['startingDateAndTime'], eachbooking['type'], eachbooking['specialization2']) instructor.set_typeid(typeid) print(instructor.get_typeid()) list.append(instructor) else: flash("You have no appointments.") return render_template('viewBookingPage.html', bookings=list)
def parseDoctor(self): doc = xml.dom.minidom.parse(self.filename) doctors = doc.getElementsByTagName("doctor") for doctor in doctors: id = doctor.getAttribute("id") name = doctor.getAttribute("first_name") surname = doctor.getAttribute("last_name") father_name = doctor.getAttribute("father_name") cat = doctor.getAttribute("category") sp = doctor.getAttribute("specialty") newDoctor = Doctor(name,surname,father_name,cat,sp) newDoctor.setId(id) self.doctorsList[id] = newDoctor print(self.doctorsList)
def addDoctors(self): d1 = Doctor('Daniel', 'Hagan', 'Opthalmologist', []) d2 = Doctor('Bravo', 'Gilbert', 'Radiologist', []) d3 = Doctor('Steven', 'Seagal', 'Cardiologist', []) d4 = Doctor('Igor', 'Dondon', 'Oncologist', []) self.doctors.append(d1) self.doctors.append(d2) self.doctors.append(d3) self.doctors.append(d4) # generating schedule for doctors for doctor in self.doctors: for day in range(1): # set number of days of program for hour in range(1, 8): # set number of hours per day today = date.today() schedule = Schedule(today, 8 + hour, 9 + hour, doctor) doctor.addSchedule(schedule)
def populate_world(self, population, initial_infection_rate, closeness): for person in range(population): self.objectList.append( Zombie(self.speed, initial_infection_rate, closeness, self.dimensions, self.length_of_immunity)) for doctor in range(self.no_doctors): self.doctorsList.append( Doctor(self.speed, closeness, self.dimensions))
def load_json(cls): rec = loads("app_rec.json") for i in rec: cls.__rec.append(Appointment(patient=Patient(name=i["Patient"]["Name"], illness=i["Patient"]["Illness"], age=i["Patient"]["Age"], gender=i["Patient"]["Gender"]), doctor=Doctor(name=i["Doctor"]["Name"], gender=i["Doctor"]["Gender"], qualification=i["Doctor"]["Qualification"], age=i["Doctor"]["Age"]), date=i["Date"]))
def __init__(self, x_doctor_id, x_name, x_surname, x_prof): self.db_helper = DbHelper.DbHelper() self.doctor_id = x_doctor_id self.name = x_name self.surname = x_surname self.prof = x_prof self.spec = Doctor() # self.insert_record() self.get_record(x_doctor_id)
def doctor(): surname = input('surname: ') name = input('name: ') fname = input('father name: ') birth = input('birth (enter year-month-day): ') specialty = input('specialty: ') salary = int(input('salary: ')) patient_count = int(input('patient count: ')) return Doctor(surname, name, fname, birth, specialty, salary, patient_count)
def create_doctor(_soup): """Helper function to extract information from soup and create the Doctor object""" # name_select = _soup.select("div.unified-doctor-header-info div.unified-doctor-header-info__name span")[:2] name_select = _soup.select_one("div.unified-doctor-header-info div.unified-doctor-header-info__name")\ .find(itemprop="name") name = name_select.text image_select = _soup.select("div.unified-doctor-header-info a.avatar") image_link = image_select[0]["href"] if len(image_select) > 0 else "" specialization = ", ".join( map(lambda x: x.text, _soup.select("div.unified-doctor-header-info h2 a"))) experiences_select = _soup.find("span", text='Experiência em:') if experiences_select is not None: experiences_select = experiences_select.parent.parent.parent.parent.find_all( "li") experiences = ", ".join(map(lambda x: x.text, experiences_select)) else: experiences = "" address_select = _soup.select_one("div.calendar-address") if address_select is not None: city_select = address_select.select_one("span.city") city = city_select['content'] if city_select is not None else "" state_select = address_select.select_one("span.region") state = state_select['content'] if state_select is not None else "" address_select = address_select.select_one("span.street") address = address_select.text if address_select is not None else "" else: city = "" state = "" address = "" telephone_select = soup.select_one( "div.calendar-address div.modal i.svg-icon__phone") if telephone_select is not None: telephone = telephone_select.parent.find("b").text.strip() else: telephone = "" _doctor = Doctor(name=name, image_link=image_link, specialization=specialization, experiences=experiences, city=city, state=state, address=address, telephone=telephone) print(_doctor) return _doctor
def cargar_doctores(): cuerpo = request.get_json() contenido = cuerpo['contenido'] filas = contenido.split("\n") global doctores for fila in filas: print(fila) columnas = fila.split(",") doctor = Doctor(columnas[0],columnas[1],columnas[2],columnas[3],columnas[4],columnas[5],columnas[6],columnas[7]) doctores.append(doctor) return jsonify({"mensaje":"Carga masiva exitosa"})
def init(): for i in range(bac_num): bacteria.add( VirusNode( (random.randint(50, width - 50), random.randint( 50, height - 50)), split_time)) for i in range(doc_num): doctors.add( Doctor( (random.randint(50, width - 50), random.randint(50, height - 50))))
def __init__(self, ID_num, num_docs, doc_front_rate, doc_back_rate, patient_rate, department_size, waiting_size, admit_rate, labs_enabled=True, lab_rate=20, CT_enabled=True, num_CTs=1, CT_rate=15, verbose=True): self.ID_num = ID_num self.erack = queue.PriorityQueue() self.rads_queue = queue.PriorityQueue() self.time = 0 self.num_CTs = num_CTs self.CT_rate = CT_rate self.lab_rate = lab_rate self.num_docs = num_docs self.labs_enabled = labs_enabled self.CT_enabled = CT_enabled self.DoctorList = [] self.CTList = [] self.DispoList = [] self.AdmitList = [] self.patient_rate = patient_rate ## patient rate in terms of new patients per hour self.department_size = department_size self.waiting_size = waiting_size self.WR = queue.PriorityQueue(waiting_size) self.admit_rate = admit_rate ## average time in minutes to admit a patient self.doc_front_rate = doc_front_rate self.doc_back_rate = doc_back_rate self.verbose = verbose ## use debug / status messages for i in range(self.num_docs): self.DoctorList.append( Doctor(self, 1, self.doc_front_rate, self.doc_back_rate, 8)) if self.CT_enabled: for j in range(self.num_CTs): self.CTList.append(CT(self, self.CT_rate)) if self.labs_enabled: self.Laboratory = Laboratory(self, self.lab_rate) self.stats = Stats(num_docs, patient_rate, department_size, waiting_size)
def ObtenerUsuarioD(usuario): global Doctores for Doctor in Doctores: if Doctor.getUsuario() == usuario: cdoctor = { 'Nombre': Doctor.getNombre(), 'Apellido': Doctor.getApellido(), 'Fecha': Doctor.getFecha(), 'Sexo': Doctor.getSexo(), 'Usuario': Doctor.getUsuario(), 'Contrasena': Doctor.getContra(), 'Especialidad': Doctor.getSpecialty(), 'Telefono': Doctor.getTel() } return (jsonify(cdoctor)) salida = {'Mensaje': 'No existe ese usuario'} return (jsonify(salida))
def get(self, *args): doctor = Doctor() user = User() order = Order() if args[0] == '': self.render('doctor/index.html') elif args[0] == 'neworder': self.render('doctor/choose-doctor.html', doctor_info=doctor.get_all_doctors()) elif args[0] == 'choosetime': self.render('doctor/choose-time.html') elif args[0] == 'createorder': self.render('doctor/create-order.html', doctor_info=doctor.get_doctor_by_id(self.get_argument("doctor_id")), order_people_info=user.get_order_people_info(self.current_user)) elif args[0] == 'addorderpeople': self.render('doctor/add-order-people.html') elif args[0] == 'listorder': self.render('doctor/list-order.html', order_info=order.get_all_order_by_user(self.current_user)) elif args[0] == 'orderdetail': self.render('doctor/order-detail.html', order_info=order.get_order_by_id(self.get_argument('order_id'))) else: self.write('<h1>功能正在开发,请耐心等待</h1>')
def AgregarDoctor(): global Doctores nombre = request.json['Nombre'] nombre=nombre.replace(" ","") apellido= request.json['Apellido'] nacimiento = request.json['Fecha'] sexo = request.json['Sexo'] username = request.json['Usuario'] contra = request.json['Contraseña'] especialidad = request.json['Especialidad'] nuevo = Doctor(nombre,apellido,nacimiento,sexo,username,contra,especialidad) Doctores.append(nuevo) return jsonify({'Mensaje':'Se agrego el Doctor exitosamente',})
def create_employees(self): config = self.config['Q'] id = 1 amount = int(config['MED'][0]) for _ in range(amount): self.doctors.add(Doctor(id)) id += 1 amount = int(config['ENF'][0]) for _ in range(amount): self.nurses.add(Nurse(id)) id += 1 amount = int(config['ATD'][0]) for _ in range(amount): self.secretaries.add(Secretary(id)) id += 1
def AgregarDoctor(): global Doctores nombre = request.json['nombre'] apellido = request.json['apellido'] fecha = request.json['fecha'] sexo = request.json['sexo'] usuario = request.json['usuario'] contrasena = request.json['contrasena'] especialidad = request.json['especialidad'] telefono = request.json['telefono'] NuevoDoctor = Doctor(nombre, apellido, fecha, sexo, usuario, contrasena, especialidad, telefono) Doctores.append(NuevoDoctor) for i in range(len(Doctores)): print(Doctores[i].getNombre()) return jsonify({'Mensaje':'Usuario creado con éxito.'})
def ObtenerDoctor(): global Doctores Datos = [] for Doctor in Doctores: cdoctor = { 'Nombre': Doctor.getNombre(), 'Apellido': Doctor.getApellido(), 'Fecha': Doctor.getFecha(), 'Sexo': Doctor.getFecha(), 'Usuario': Doctor.getUsuario(), 'Contraseña': Doctor.getContra(), 'Especialidad': Doctor.getSpecialty(), 'Teléfono': Doctor.getTel() } Datos.append(cdoctor) return (jsonify(Datos))
def __makeDoctorsList(self, file): docList = {} with open(file, 'r') as docF: data = docF.readlines() for x in range(0, len(data)): line = data[x] infos = line.split(",") name = infos[0].strip() contact = infos[1].strip() depart = infos[2].strip() avail = infos[3].strip() # print(name,contact,depart,avail) doctor = Doctor(name, contact, depart, self, avail) docList[name] = doctor return docList
def startChat(self): # greets patient and creates patient object Doctor.greet_user() patient = Doctor.get_basic_info() # Loop to get symptoms, right now breaks on "none" while True: symptom = Doctor.new_symptom() if (symptom == False): break patient.addSymptom(symptom) print("Okay, I will remember that...") Doctor.diagnose(patient)
def registerDoctor(): print('***************** Registro Doctor *******************') nombre = input('Digita tu nombre') documento = int(input('Digita tu documento')) doctorExiste = False for doctor in doctores: if doctor.documento == documento: doctorExiste = True if doctorExiste == False: print('ENTRO') id = autoIncrement('doctores') doctor = Doctor(id=id, nombre=nombre, documento=documento) data.get('doctores').append(doctor) data_sesion['role'] = 0 data_sesion['id'] = doctor.id data_sesion['documento'] = doctor.documento data_sesion['nombre'] = doctor.nombre welcome() else: print('Este doctor ya existe') registerDoctor()
def cargaMasivaDoctores(): global Doctores contador_doctores = len(Doctores) docs = request.json["doctores"] # print (usuariosCM) for doctor in docs: contador_doctores += 1 nombre = doctor['nombre'] apellido = doctor['apellido'] fechaNacimiento = doctor['fecha'] sexo = doctor['genero'] username = doctor['usuario'] password = doctor['password'] especialidad = doctor['especialidad'] telefono = doctor['telefono'] Users.append( User(contador_doctores, nombre, apellido, fechaNacimiento, sexo, username, password, telefono, 1)) Doctores.append( Doctor(contador_doctores, nombre, apellido, fechaNacimiento, sexo, username, password, especialidad, telefono)) return jsonify({"mensaje": "OK"})
from patient import patient from Doctor import Doctor Doctor = Doctor() class Chatbot: def __init__(self): self.startChat() def startChat(self): # greets patient and creates patient object Doctor.greet_user() patient = Doctor.get_basic_info() # Loop to get symptoms, right now breaks on "none" while True: symptom = Doctor.new_symptom() if (symptom == False): break patient.addSymptom(symptom) print("Okay, I will remember that...") Doctor.diagnose(patient) bot = Chatbot()
def train_doctor(self): self.doctorsList.append( Doctor(self.speed, self.closeness, self.dimensions))
''', (username, password, )) result = cursor.fetchall() if not result: print "Invalid login" else: break return result[0][0] if __name__ == "__main__": conn = sqlite3.connect('hospital.db') cursor = conn.cursor() username = "" role = login(cursor) if role == 'D': print "You are a doctor" doctor = Doctor(username, conn, cursor) doctor.doctor_menu() elif role == 'N': print "You are a nurse" nurse = Nurse(username, conn, cursor) nurse.nurse_menu() elif role == 'A': print "You are an admin" admin = Admin(username, conn, cursor) admin.admin_menu()
print("4: Display Patients") print("5: Display Doctors") print("6: Display appointments") print("7: Search") print("8: QUIT") option = eval(input("Enter the option:")) if option == 1: patnt = Patient() patnt.name = input("Enter the patient name:") # name iherited from person patnt.age = eval(input("Enter the age of a pateint:")) # age inherited from person patnt.idnumber = input("Enter the id number of the patient:") # the patient is given the id number patnt.adress = input("Enter the address of a patient:") patnt.visit = input("Enter the number of visit:") patient.append(str(patnt)) # The whole patient class is appended into the list elif option == 2: doc = Doctor() doc.name = input("Enter the doctor's name:") # The doctor is given the name,address and Id number doc.address = input("Enter the address of the doctor:") doc.Id = input("Enter the Doctor's ID:") doctor.append(str(doc)) # The whole doctor class is aasigned into the list elif option == 3: appoint = Appointment() appoint.pid = input( "Enter the patient's ID:" ) # The appointment is assigned doctor's id, when the appointment is and is also assigne the discription of the appointment appoint.did = input("Enter the Doctor's ID:") # did=Doctor's id appoint.memo = input("Enter the memo:") appoint.day = input("Enter the day of the appointment:") appointment.append(str(appoint)) # The whole appointment class is assigned to the list elif option == 4: for i in patient: # Going throught Patient list
def main(): input_file=open('Outputs.txt','wb') #opens file to save input while True: intro() #calls options option=int(input('>')) if option== 0: #ceases operation data_files=[doctors,patients,appointments,doctor_appointments,patient_appointments] dump(data_files, input_file) input_file.close() break elif option== 1: #inputs patient's info patient=Patient() patient.id_input() patients[patient.pat_id_number]=patient elif option== 2: #inputs for doctor's info doctor=Doctor() doctor.input() doctors[doctor.doc_id_number]=doctor elif option== 3: #inputs appointment info Appointment_number+=1 appointment=Appointment() appointment.input() appointments[Appointment_number]=appointment elif option== 4: #searchs for patient pat_id_number=input('Enter Patient\'s Id number: ') appointment=Appointment() appointment.input() if len(patient.pat_id_number)>0: for i in patients: if pat_id_number == i: patient_appointments[pat_id_number]=appointment print('Could not find a patient with that Id number.') else: print('Could not find a patient with that student number.') elif option== 5: #searchs for doctor doc_id_number=input('Enter Doctor\'s Id number: ') appointment=Appointment() appointment.input() if len(doctor.doc_id_number)>0: for i in doctors: if doc_id_number == i: doctor_appointments[doc_id_number]=appointment print('Could not find a doctor with that Id number.') else: print('Could not find a doctor with that id number.') elif option== 6: #searchs for appointment Appointment_number=int(input('Enter Appointment number: ')) appointment=Appointment() appointment.input() if len(appintment_number)>0: for i in appointments: if Appointment_number == i: appointments[Appointment_number]=appointment print('Could not find an appointment with that appointment number.') else: print('Could not find an appointment with that appointment number.') elif option== 7: #finds doctor doc_id_number=input('Enter Doctor\'s Id number: ') if doc_id_number in doctors: print(doctors[doc_id_number]) else: print('Could not find a doctor with that id number.') elif option== 8: #finds patient patient_id_number=input('Enter Patient\'s Id number: ') if len(patient_id_number)>0: for ptt in patients: if patient_id_number==ptt: print(patients[patient_id_number]) print('Could not find a patient with that id number.') else: print('Could not find a patient with that id number.') elif option== 9: #displays all appointments display_dictionary_values(appointments) elif option== 10: #displays all doctors display_dictionary_values(doctors) elif option== 11: #displays all patients display_dictionary_values(patients) else: #printed when option is not found print('That selection was not recognised.')
from Doctor import Doctor from Patient import Patient from Appeal import Appeal doctor = Doctor("Gleb", "Nazemnov", "Andreevich", "TOP", "Urologiy") patient = Patient("Egor", "Maxsimov", "Urkovich", "20-11-1998") appeal = Appeal(doctor, patient, "bolen", 25.5) print(doctor) print(patient) print(appeal.get_Doctor().get_first_name())
print("Could not find a doctor with that identity number.") elif user_input == 8: # option to find appointments app = input("Enter the date of the appointment (yy-mm-dd hours:minutes:00): ") for s in Appointments_1: if s ==appointment: app.append(s) pickle.dump(app,AppointmentFile) elif user_input == 9: a = Patient() # create object a.name = patient_name a.age = age a.patient_address = address a.patient_identity_no = ID_number a.display() for i in Patients_1: # take dictionary keys to make them one list pp.append(i) pickle.dump(pp,PatientFile) elif user_input == 10: b = Doctor() # create object b.name = doctor_name b.age = age b.doctor_address = address b.doctor_identity_no = dr_ID_number b.display() for k in Doctors_1: drr.append(k) pickle.dump(drr,DoctorFile) PatientFile.close() DoctorFile.close() AppointmentFile.close()
def update_bookings(id): form = bookingPage(request.form) if request.method == 'POST' and form.validate(): if form.type.data == "idoctor": name = form.name.data age = form.age.data phoneNumber = form.phoneNumber.data email = form.email.data specialization1 = form.specialization1.data startingDateAndTime = form.startingDateAndTime.data type = form.type.data doctor = Doctor(name, age, phoneNumber, email, startingDateAndTime, type, specialization1) book_db = root.child('bookings/' + id) book_db.set({ 'name': doctor.get_name(), 'age': doctor.get_age(), 'phoneNumber': doctor.get_phoneNumber(), 'email': doctor.get_email(), 'startingDateAndTime': doctor.get_startingDateAndTime(), 'type': doctor.get_type(), 'specialization1': doctor.get_specialization1(), }) flash("Your appointment has been rescheduled", 'success') elif form.type.data == "iinstructor": name = form.name.data age = form.age.data phoneNumber = form.phoneNumber.data email = form.email.data specialization2 = form.specialization2.data startingDateAndTime = form.startingDateAndTime.data type = form.type.data instructor = Instructor(name, age, phoneNumber, email, startingDateAndTime, type, specialization2) book_db = root.child('bookings/' + id) book_db.set({ 'name': instructor.get_name(), 'age': instructor.get_age(), 'phoneNumber': instructor.get_phoneNumber(), 'email': instructor.get_email(), 'startingDateAndTime': instructor.get_startingDateAndTime(), 'type': instructor.get_type(), 'specialization2': instructor.get_specialization2(), }) flash('Your appointment has been rescheduled.', 'success') return redirect(url_for('view_Booking_Page')) else: url = 'bookings/' + id eachbook = root.child(url).get() if eachbook['type'] == 'idoctor': doctor = Doctor(eachbook['name'], eachbook['age'], eachbook['phoneNumber'], eachbook['email'], eachbook['startingDateAndTime'], eachbook['type'], eachbook['specialization1']) doctor.set_typeid(id) form.name.data = doctor.get_name() form.age.data = doctor.get_age() form.phoneNumber.data = doctor.get_phoneNumber() form.email.data = doctor.get_email() form.specialization1.data = doctor.get_specialization1() form.startingDateAndTime.data = doctor.get_startingDateAndTime() form.type.data = doctor.get_type() else: instructor = Instructor(eachbook['name'], eachbook['age'], eachbook['phoneNumber'], eachbook['email'], eachbook['startingDateAndTime'], eachbook['type'], eachbook['specialization2']) instructor.set_typeid(id) form.name.data = instructor.get_name() form.age.data = instructor.get_age() form.phoneNumber.data = instructor.get_phoneNumber() form.email.data = instructor.get_email() form.specialization2.data = instructor.get_specialization2() form.startingDateAndTime.data = instructor.get_startingDateAndTime( ) form.type.data = instructor.get_type() return render_template('updateBookingPage.html', form=form)
def bookingpage(): form = bookingPage(request.form) if request.method == 'POST' and form.validate(): if form.type.data == "idoctor": name = form.name.data age = form.age.data phoneNumber = form.phoneNumber.data email = form.email.data specialization1 = form.specialization1.data startingDateAndTime = form.startingDateAndTime.data type = form.type.data doctor = Doctor(name, age, phoneNumber, email, startingDateAndTime, type, specialization1) book_db = root.child('bookings') book_db.push({ 'name': doctor.get_name(), 'age': doctor.get_age(), 'phoneNumber': doctor.get_phoneNumber(), 'email': doctor.get_email(), 'startingDateAndTime': doctor.get_startingDateAndTime(), 'type': doctor.get_type(), 'specialization1': doctor.get_specialization1(), }) flash("Your appointment is registered.", 'success') elif form.type.data == "iinstructor": name = form.name.data age = form.age.data phoneNumber = form.phoneNumber.data email = form.email.data specialization2 = form.specialization2.data startingDateAndTime = form.startingDateAndTime.data type = form.type.data instructor = Instructor(name, age, phoneNumber, email, startingDateAndTime, type, specialization2) book_db = root.child('bookings') book_db.push({ 'name': instructor.get_name(), 'age': instructor.get_age(), 'phoneNumber': instructor.get_phoneNumber(), 'email': instructor.get_email(), 'startingDateAndTime': instructor.get_startingDateAndTime(), 'type': instructor.get_type(), 'specialization2': instructor.get_specialization2() }) flash('Your appointment is registered.', 'success') return redirect(url_for('view_Booking_Page')) # return render_template('view_Booking_Page.html',form=form) return render_template('BookingPage.html', form=form)
def main(): r1 = Receptionist(id=1) r2 = Receptionist(id=2) ch1 = Chair(_id=1) ch2 = Chair(_id=2) statistics = Statistics() r_list = [r1, r2] ch_list = [ch1, ch2] p1 = Patient(id=1, hp=85, name="Patric", receptionists=r_list, chairs=ch_list, statistics=statistics) p2 = Patient(id=2, hp=93, name="Danil", receptionists=r_list, chairs=ch_list, statistics=statistics) p3 = Patient(id=3, hp=30, name="Bernard", receptionists=r_list, chairs=ch_list, statistics=statistics) p4 = Patient(id=4, hp=41, name="Stefan", receptionists=r_list, chairs=ch_list, statistics=statistics) p5 = Patient(id=5, hp=12, name="Carl", receptionists=r_list, chairs=ch_list, statistics=statistics) p6 = Patient(id=6, hp=92, name="Joe", receptionists=r_list, chairs=ch_list, statistics=statistics) p7 = Patient(id=7, hp=55, name="Anna", receptionists=r_list, chairs=ch_list, statistics=statistics) p_list = [p1, p2, p3, p4, p5, p6, p7] coffee1 = CoffeeMachine(id=1) coffee2 = CoffeeMachine(id=2) surgeryRoom1 = SurgeryRoom(id=1) surgeryRoom2 = SurgeryRoom(id=2) coffee_list = [coffee1, coffee2] surgery_rooms = [surgeryRoom1, surgeryRoom2] d1 = Doctor(id=1, name="Dr Nowacka", energy_points=35, chairs=ch_list, location=Location.CORRIDOR, coffee_machines=coffee_list, surgery_rooms=surgery_rooms) d2 = Doctor(id=2, name="Dr Kowalski", energy_points=15, chairs=ch_list, location=Location.CORRIDOR, coffee_machines=coffee_list, surgery_rooms=surgery_rooms) d3 = Doctor(id=3, name="Dr Wozniak", energy_points=5, chairs=ch_list, location=Location.CORRIDOR, coffee_machines=coffee_list, surgery_rooms=surgery_rooms) d4 = Doctor(id=4, name="Profesor Kowalczyk", energy_points=45, chairs=ch_list, location=Location.CORRIDOR, coffee_machines=coffee_list, surgery_rooms=surgery_rooms) d5 = Doctor(id=5, name="Dr Wojtasik", energy_points=65, chairs=ch_list, location=Location.CORRIDOR, coffee_machines=coffee_list, surgery_rooms=surgery_rooms) doctor_list = [d1, d2, d3, d4, d5] interface = UserInterface(chairs=ch_list, coffee_machines=coffee_list, doctors=doctor_list, patients=p_list, receptionists=r_list, surgery_rooms=surgery_rooms) patient_manager = Patient_Finished(patients=p_list, receptionists=r_list, chairs=ch_list, statistics=statistics) for doctor in doctor_list: doctor.start() for patient in p_list: patient.start() patient_manager.start() interface.start() killer = threading.Thread(target=killer_run, args=(p_list, doctor_list, patient_manager, interface)) killer.start() killer.join() for doctor in doctor_list: doctor.join() for patient in p_list: patient.join() patient_manager.join() interface.join()
option=eval(input("Enter the option: ")) if option==0: pickle.dump(patient,c) # Dumping the patient's list in to the clinic file pickle.dump(doctor,c) # Dumping the Doctor's list into the clinic file pickle.dump(appointment,c) # writing the appointment's list into the clinic file break elif option==1: patnt=Patient() patnt.name=input("Enter the patient name:") patnt.age=eval(input("Enter the age of a pateint:")) patnt.idnumber=input("Enter the id number of the patient:") patnt.adress=input("Enter the address of a patient:") patnt.visit=input("Enter the number of visit:") patient.append(str(patnt)) elif option==2: doc=Doctor() doc.name=input("Enter the doctor's name:") doc.address=input("Enter the address of the doctor:") doc.Id=input("Enter the Doctor's ID:") doctor.append(str(doc)) elif option==3: appoint=Appointment() appoint.pid=input("Enter the patient's ID:") appoint.did=input("Enter the Doctor's ID:") appoint.memo=input("Enter the memo:") appoint.day=input("Enter the day of the appointment:") appointment.append(str(appoint)) elif option==4: for i in patient: print(i) elif option==5:
pickle_to_file(getfilename_,getstring_,getfilename_2) elif selection == 2: #Create Person Object: Doctor_Name = input("Enter Doctor Name : ") Doctor_Age = eval(input("Enter Doctor Age : ")) Person_ = Person(Doctor_Name,Doctor_Age) #Create Doctor Doctor_ID = input("Enter Doctor ID Number : ") Doctor_Address = input("Enter the Doctor's Address : ") Doctor_ = Doctor(Doctor_ID,Doctor_Address) #pickle to file: getfilename_ = "doctor.txt" getfilename_2 = "doctor_unpickled.txt" getstring_ = Person_.__str__()+','+Doctor_.__str__() pickle_to_file(getfilename_,getstring_,getfilename_2) elif selection == 3: #Create Appointment Object: Patient_ID = input("Enter Patient ID Number : ") Doctor_ID = input("Enter Doctor ID Number : ") Appointment_time = input("Enter Appointment time dd/mm/yyyy: ") Appointment_Memo = input("Enter Appointment Memo : ") Appointment_ = Appointment(Patient_ID, Doctor_ID, Appointment_time, Appointment_Memo)
def main(): patients,doctors,appointments=[],[],[] while True: print("Welcome to the Clinic. Please select an option:\n") option=int(input("1.Add a doctor, patient or create an appointment.\n2.Search and dispay all patients, doctors or appointments.\n3.Search all appointments for a patient or a doctor.\n0.Quit.\n")) if option==0:break elif option==1: option1=int(input("1.Add a doctor.\n2.Add Patient.\n3.Create appointment.\n")) if option1==1: #Adding a doctor d=Doctor() d.name=input("Please enter doctor's name.\n") d.age=input("Please enter doctor's age.\n") d.doctor_id_no=input("Please enter doctor's I.D number.\n") d.doctor_address=input("Please enter doctor's address.\n") doctors.append(d) elif option1==2: #Adding patient p=Patient() p.name=input("Please enter patient's name.\n") p.age=input("Please enter patient's age.\n") p.patient_id_no=input("Please enter patient's I.D number.\n") p.patient_address=input("Please enter patient's address.\n") patients.append(p) elif option1==3: #creating an appointment a=Appointment() a.doc_id=input("Please enter doctor's I.D number.\n") a.pat_id=input("Please enter patient's I.D number.\n") a.time=input("Please enter date and time for the appointment(yyyy/mm/dd hh:mm)\n") a.memo() appointments.append(a) elif option==2: option2=int(input("1.Display doctors.\n2.Display patients.\n3.Display appointments.\n")) if option2==1: for i in doctors: print(i.display()) elif option2==2: for i in patients: print(i.display()) elif option2==3: for i in appointments: print(i.display()) elif option==3: option3=int(input("1.Search for doctor's appointments.\n2.Search for patient's appointments")) if option3==1: doctor_id=input("Enter doctor's I.D number") for i in doctors: if i.doctor_id_no==doctor_id: print(i.name) break for j in doctors: for k in appointments: if j.doctor_id_no==k.doc_id: print(k.display()) elif option3==2: patient_id=input("Enter patient's I.D number") for i in doctors: if i.patient_id_no==patient_id: print(i.name) break for j in patients: for k in appointments: if j.patient_id_no==k.pat_id: print(k.display())
def main(): """ three lists to store patients, doctors and appointments """ patients = [] doctors = [] appointments = [] while True: print() """ options choose from """ print("*****Clinic******") print("1. To add a patient") print("2. To add a doctor") print("3. To make an appointment") print("4. To display all patients") print("5. To display all doctors") print("6. To display all appointments") print("7. To display appointments for a specific individual (doctor or patient)") print("0. To quit") print() response = input() # getting an input from the user if response == "0": break elif response == "1": patient = Patient() patient.name = input("Enter the name of the patient? \n") patient.age = input("Enter age of the patient? \n") patient.identity = input("The patients ID number? \n") patient.address = input("The patients address? \n") patient.number_of_visits = input("The patients number of visits? \n") patients.append(patient) elif response == "2": doctor = Doctor() # creating an object variable doctor """ getting object variables """ doctor.name = input("Enter the name of the doctor? \n") doctor.age = input("Enter age of the doctor? \n") doctor.identity = input("The doctors ID number? \n") doctor.address = input("The doctors address? \n") doctors.append(doctor) # appending the object doctor to a list doctors elif response == "3": appointment = Appointment() appointment.patients_identity = input("Enter patient's ID number? \n") appointment.doctors_identity = input("Enter doctor's ID number? \n") appointment.timestamp = input("Enter date and time? \n") appointment.memo = input("Enter memorundum of the appointment? \n") appointments.append(appointment) # adding the oject appointment to list appointments elif response == "4": control = 1 for item in patients: print("Patient No.", control) item.display() control +=1 print() elif response == "5": control = 1 for item in doctors: print("Doctor No.", control) item.display() control +=1 print() elif response == "6": for item in appointments: print(item) print() elif response == "7": user_id = input("Enter ID number for which you want to check appointments scheduled? \n ") print("Scheduled appointment(s) for", user_id, "are as follows: ") """ looping through the list appointment and comparing id's""" for item in appointments: if user_id == item.patients_identity: print(item.timestamp) elif user_id == item.doctors_identity: print(item) else: print("The value entered is not in the option manu.") print("Please enter value available in the menu")
def __init__(self, pidn="unknown", didn="unknown", ts="unknown", m="unknown"): Patient.__init__(self, pidn) Doctor.__init__(self, didn) self.timestamp = ts self.memo = m
from Person import Person from Student import Student from Teacher import Teacher from Doctor import Doctor s=Student('may') s.SayMyWork() t=Teacher('tom') t.SayMyWork() d=Doctor('tomas') d.SayMyWork()