def updateAcountInfo(): type=request.args.get('type') if type: type=string.atoi(type) #医生:1 病人:2 else: type=2 userId=None if session.has_key('userId'): userId=session['userId'] if userId is None: return redirect(LOGIN_URL) form=UserUpdateForm(request.form) paraRs=form.validate() if rs.SUCCESS.status==paraRs.status: User.update(userId,form.name,form.account,form.mobile,form.address,form.email,form.identityCode,form.yibaoCard) if type==1: doctor=Doctor(userId) doctor.identityPhone=form.identityPhone hospitalId=Doctor.update(doctor) if hospitalId: hospital=Hospital(form.hospitalName) hospital.id=hospitalId Hospital.updateHospital(hospital) return json.dumps(rs.SUCCESS.__dict__,ensure_ascii=False) return json.dumps(rs.FAILURE.__dict__,ensure_ascii=False)
def test_add_hospital(self): new_hospital_1 = Hospital("西11安西京医院", "地址——西11安西京医院", "描述-西22安西京医院", "11") Skill.save(new_hospital_1) new_hospital_2 = Hospital("西22安西京医院", "地址——西22安西京医院", "描述-西22安西京医院", "22") Skill.save(new_hospital_2) new_hospital_3 = Hospital("西33安西京医院", "地址——西33安西京医院", "描述-西22安西京医院", "33") Skill.save(new_hospital_3)
def applyDiagnose(): if session.has_key('userId'): userId = session['userId'] if userId is None: return redirect('/loginPage') data = {} hospitals = Hospital.getAllHospitals(db_session) hospitalsDict = object2dict.objects2dicts(hospitals) data['hospitals'] = hospitalsDict positions = Position.getPositions() positionsDict = object2dict.objects2dicts(positions) data['positions'] = positionsDict locations = Location.getAllLocations(db_session) locationsDict = object2dict.objects2dicts(locations) data['locations'] = locationsDict #hospital user if 'type' in request.args.keys(): data['type'] = int(request.args.get('type')) if 'edit' in request.args.keys() and 'diagnoseid' in request.args.keys(): new_diagnose = Diagnose.getDiagnoseById(request.args['diagnoseid']) data['edit'] = 1 else: new_diagnose = Diagnose.getNewDiagnoseByStatus(ModelStatus.Draft, session['userId']) if new_diagnose is not None: data['doctor'] = new_diagnose.doctor data['patient'] = new_diagnose.patient data['pathology'] = new_diagnose.pathology new_file = File.getFiles(new_diagnose.pathologyId, constant.FileType.Dicom) data['dicomfile'] = new_file new_files = File.getFiles(new_diagnose.pathologyId, constant.FileType.FileAboutDiagnose) data['fileAboutDiagnose'] = new_files pathologyPositions = [] if hasattr(new_diagnose, 'pathology') and hasattr( new_diagnose.pathology, 'pathologyPostions'): pathologyPositions = object2dict.objects2dicts( new_diagnose.pathology.pathologyPostions) data['pathologyPositions'] = pathologyPositions patients = Patient.get_patient_by_user(session['userId']) if patients is None or len(patients) < 1: patientdict = [] else: patientdict = object2dict.objects2dicts(patients) data['patientdict'] = patientdict return render_template("applyDiagnose.html", result=data)
def doctor_list(): result = {} hospitals = Hospital.getAllHospitals(db_session) hospitalsDict = object2dict.objects2dicts(hospitals) result['hospitals'] = hospitalsDict skills = Skill.getSkills() skillsDict = object2dict.objects2dicts(skills) result['skills'] = skillsDict return render_template("doctorList.html", result=result)
def doctor_list(): result = {} hospitals = Hospital.getAllHospitals(db_session) hospitalsDict = object2dict.objects2dicts(hospitals) result['hospitals'] = hospitalsDict skills = Skill.getSkills() skillsDict = object2dict.objects2dicts(skills) result['skills'] = skillsDict result['isdoctorlist'] = True return render_template("doctorList.html", data=result)
def applyDiagnose(): if session.has_key('userId'): userId=session['userId'] if userId is None: return redirect('/loginPage') data = {} hospitals = Hospital.getAllHospitals(db_session) hospitalsDict = object2dict.objects2dicts(hospitals) data['hospitals'] = hospitalsDict positions = Position.getPositions() positionsDict = object2dict.objects2dicts(positions) data['positions'] = positionsDict locations = Location.getAllLocations(db_session) locationsDict = object2dict.objects2dicts(locations) data['locations'] = locationsDict if 'edit' in request.args.keys() and 'diagnoseid' in request.args.keys(): new_diagnose = Diagnose.getDiagnoseById(request.args['diagnoseid']) data['edit'] = 1 else: new_diagnose = Diagnose.getNewDiagnoseByStatus(ModelStatus.Draft, session['userId']) if new_diagnose is not None: data['doctor'] = new_diagnose.doctor data['patient'] = new_diagnose.patient data['pathology'] = new_diagnose.pathology new_file = File.getFiles(new_diagnose.pathologyId, constant.FileType.Dicom) data['dicomfile'] = new_file new_files = File.getFiles(new_diagnose.pathologyId, constant.FileType.FileAboutDiagnose) data['fileAboutDiagnose'] = new_files pathologyPositions = [] if hasattr(new_diagnose, 'pathology') and hasattr(new_diagnose.pathology, 'pathologyPostions'): pathologyPositions = object2dict.objects2dicts(new_diagnose.pathology.pathologyPostions) data['pathologyPositions'] = pathologyPositions patients = Patient.get_patient_by_user(session['userId']) if patients is None or len(patients) < 1: patientdict = [] else: patientdict = object2dict.objects2dicts(patients) data['patientdict'] = patientdict return render_template("applyDiagnose.html", result=data)
def test_add_hospital(self): new_hospital_1 = Hospital("西安西京医院", "地址——西安西京医院", "描述-西安西京医院", 1) Skill.save(new_hospital_1) new_hospital_2 = Hospital("榆林市第二医院", "地址——榆林市第二医院", "描述-榆林市第二医院", 2) Skill.save(new_hospital_2) new_hospital_3 = Hospital("榆林市中医医院", "地址——榆林市中医医院", "描述-榆林市中医医院", 2) Skill.save(new_hospital_3) new_hospital_4 = Hospital("榆林市第一医院", "地址——榆林市第一医院", "描述-榆林市第一医院", 2) Skill.save(new_hospital_4) new_hospital_5 = Hospital("榆林市星元医院", "地址——榆林市星元医院", "描述-榆林市星元医院", 2) Skill.save(new_hospital_5) new_hospital_6 = Hospital("榆林市榆阳区人民医院", "地址——榆林市榆阳区人民医院", "描述-榆林市榆阳区人民医院", 2) Skill.save(new_hospital_6) new_hospital_7 = Hospital("其他", "地址——其他", "描述-其他", 5) Skill.save(new_hospital_7)
def test_add_doctor(self): new_location_1 = Location("西安_1") Skill.save(new_location_1) new_location_2 = Location("西安_2") Skill.save(new_location_2) new_location_3 = Location("西安_3") Skill.save(new_location_3) new_skill_1 = Skill("头部") Skill.save(new_skill_1) new_skill_2 = Skill("颈部") Skill.save(new_skill_2) new_skill_3 = Skill("胸部") Skill.save(new_skill_3) new_skill_1 = Position("头部") Skill.save(new_skill_1) new_skill_2 = Position("颈部") Skill.save(new_skill_2) new_skill_3 = Position("胸部") Skill.save(new_skill_3) new_hospital = Hospital("西22安西京医院", "地址——西22安西京医院", "描述-西22安西京医院", "22") Hospital.save(new_hospital) new_department_1 = Department("影像科") Skill.save(new_department_1) new_department_2 = Department("内科") Skill.save(new_department_2) new_department_3 = Department("外科") Skill.save(new_department_3) new_user_1 = User("18511134676", "123456") new_user_1.email = "*****@*****.**" new_user_1.phone = "18511134676" new_user_1.type = UserStatus.doctor User.save(new_user_1) new_doctor_1 = Doctor(new_user_1.id) new_doctor_1.identityPhone = "010-12345567" new_doctor_1.username = "******" new_doctor_1.diagnoseCount = 777 new_doctor_1.feedbackCount = 888 new_doctor_1.hospitalId = new_hospital.id new_doctor_1.departmentId = new_department_1.id new_doctor_1.title = "副主任医师1" Doctor.save(new_doctor_1) new_doctor2skill_1_1 = Doctor2Skill(new_doctor_1.id, new_skill_1.id) Doctor2Skill.save(new_doctor2skill_1_1) new_doctor2skill_1_2 = Doctor2Skill(new_doctor_1.id, new_skill_3.id) Doctor2Skill.save(new_doctor2skill_1_2) new_userrole = UserRole(new_user_1.id, RoleId.Doctor) UserRole.save(new_userrole) new_user_2 = User("18511122567", "123456") new_user_2.email = "*****@*****.**" new_user_2.phone = "18511122567" new_user_2.type = UserStatus.doctor User.save(new_user_2) new_doctor_2 = Doctor(new_user_2.id) new_doctor_2.identityPhone = "010-12345667" new_doctor_2.username = "******" new_doctor_2.diagnoseCount = 666 new_doctor_2.feedbackCount = 777 new_doctor_2.hospitalId = new_hospital.id new_doctor_2.departmentId = new_department_2.id new_doctor_2.title = "副主任医师2" Doctor.save(new_doctor_2) new_doctor2skill_2_1 = Doctor2Skill(new_doctor_2.id, new_skill_2.id) Doctor2Skill.save(new_doctor2skill_2_1) new_doctor2skill_2_2 = Doctor2Skill(new_doctor_2.id, new_skill_3.id) Doctor2Skill.save(new_doctor2skill_2_2) new_userrole = UserRole(new_user_2.id, RoleId.Doctor) UserRole.save(new_userrole) new_user_3 = User("18511142567", "123456") new_user_3.email = "*****@*****.**" new_user_3.phone = "18511142567" new_user_3.type = UserStatus.doctor User.save(new_user_3) new_doctor_3 = Doctor(new_user_3.id) new_doctor_3.identityPhone = "020-12346678" new_doctor_3.username = "******" new_doctor_3.hospitalId = new_hospital.id new_doctor_3.departmentId = new_department_3.id new_doctor_3.title = "副主任医师2" new_doctor_3.diagnoseCount = 999 new_doctor_3.feedbackCount = 1000 Doctor.save(new_doctor_3) new_doctor2skill_3_1 = Doctor2Skill(new_doctor_3.id, new_skill_1.id) Doctor2Skill.save(new_doctor2skill_3_1) new_doctor2skill_3_2 = Doctor2Skill(new_doctor_3.id, new_skill_2.id) Doctor2Skill.save(new_doctor2skill_3_2) new_userrole = UserRole(new_user_3.id, RoleId.Doctor) UserRole.save(new_userrole) new_user_1 = User("18511114676", "123456") new_user_1.email = "*****@*****.**" new_user_1.phone = "18511234676" new_user_1.type = UserStatus.doctor User.save(new_user_1) new_doctor_1 = Doctor(new_user_1.id) new_doctor_1.identityPhone = "020-12345567" new_doctor_1.username = "******" new_doctor_1.diagnoseCount = 775 new_doctor_1.feedbackCount = 788 new_doctor_1.hospitalId = new_hospital.id new_doctor_1.departmentId = new_department_1.id new_doctor_1.title = "副主任医师2" Doctor.save(new_doctor_1) new_doctor2skill_1_1 = Doctor2Skill(new_doctor_1.id, new_skill_1.id) Doctor2Skill.save(new_doctor2skill_1_1) new_doctor2skill_1_2 = Doctor2Skill(new_doctor_1.id, new_skill_3.id) Doctor2Skill.save(new_doctor2skill_1_2) new_userrole = UserRole(new_user_1.id, RoleId.Doctor) UserRole.save(new_userrole) new_user_1 = User("18511114676", "123456") new_user_1.email = "*****@*****.**" new_user_1.phone = "18511234676" new_user_1.type = UserStatus.doctor User.save(new_user_1) new_doctor_1 = Doctor(new_user_1.id) new_doctor_1.identityPhone = "020-12345567" new_doctor_1.username = "******" new_doctor_1.diagnoseCount = 775 new_doctor_1.feedbackCount = 788 new_doctor_1.hospitalId = new_hospital.id new_doctor_1.departmentId = new_department_1.id new_doctor_1.title = "副主任医师2" Doctor.save(new_doctor_1) new_doctor2skill_1_1 = Doctor2Skill(new_doctor_1.id, new_skill_1.id) Doctor2Skill.save(new_doctor2skill_1_1) new_doctor2skill_1_2 = Doctor2Skill(new_doctor_1.id, new_skill_3.id) Doctor2Skill.save(new_doctor2skill_1_2) new_userrole = UserRole(new_user_1.id, RoleId.Doctor) UserRole.save(new_userrole) new_user_1 = User("18511114676", "123456") new_user_1.email = "*****@*****.**" new_user_1.phone = "18511234676" new_user_1.type = UserStatus.doctor User.save(new_user_1) new_doctor_1 = Doctor(new_user_1.id) new_doctor_1.identityPhone = "020-12345567" new_doctor_1.username = "******" new_doctor_1.diagnoseCount = 775 new_doctor_1.feedbackCount = 788 new_doctor_1.hospitalId = new_hospital.id new_doctor_1.departmentId = new_department_1.id new_doctor_1.title = "副主任医师2" Doctor.save(new_doctor_1) new_doctor2skill_1_1 = Doctor2Skill(new_doctor_1.id, new_skill_1.id) Doctor2Skill.save(new_doctor2skill_1_1) new_doctor2skill_1_2 = Doctor2Skill(new_doctor_1.id, new_skill_3.id) Doctor2Skill.save(new_doctor2skill_1_2) new_userrole = UserRole(new_user_1.id, RoleId.Doctor) UserRole.save(new_userrole) new_user_1 = User("18511114676", "123456") new_user_1.email = "*****@*****.**" new_user_1.phone = "18511234676" new_user_1.type = UserStatus.doctor User.save(new_user_1) new_doctor_1 = Doctor(new_user_1.id) new_doctor_1.identityPhone = "020-12345567" new_doctor_1.username = "******" new_doctor_1.diagnoseCount = 775 new_doctor_1.feedbackCount = 788 new_doctor_1.hospitalId = new_hospital.id new_doctor_1.departmentId = new_department_1.id new_doctor_1.title = "副主任医师2" Doctor.save(new_doctor_1) new_doctor2skill_1_1 = Doctor2Skill(new_doctor_1.id, new_skill_1.id) Doctor2Skill.save(new_doctor2skill_1_1) new_doctor2skill_1_2 = Doctor2Skill(new_doctor_1.id, new_skill_3.id) Doctor2Skill.save(new_doctor2skill_1_2) new_userrole = UserRole(new_user_1.id, RoleId.Doctor) UserRole.save(new_userrole) new_user_1 = User("18511114676", "123456") new_user_1.email = "*****@*****.**" new_user_1.phone = "18511234676" new_user_1.type = UserStatus.doctor User.save(new_user_1) new_doctor_1 = Doctor(new_user_1.id) new_doctor_1.identityPhone = "020-12345567" new_doctor_1.username = "******" new_doctor_1.diagnoseCount = 775 new_doctor_1.feedbackCount = 788 new_doctor_1.hospitalId = new_hospital.id new_doctor_1.departmentId = new_department_1.id new_doctor_1.title = "副主任医师2" Doctor.save(new_doctor_1) new_doctor2skill_1_1 = Doctor2Skill(new_doctor_1.id, new_skill_1.id) Doctor2Skill.save(new_doctor2skill_1_1) new_doctor2skill_1_2 = Doctor2Skill(new_doctor_1.id, new_skill_3.id) Doctor2Skill.save(new_doctor2skill_1_2) new_userrole = UserRole(new_user_1.id, RoleId.Doctor) UserRole.save(new_userrole)
def getAllHospitalList(): hospitals = Hospital.getAllHospitals(db_session) hospitalsDict = dataChangeService.getAllHospital(hospitals) result = rs.ResultStatus(rs.SUCCESS.status, rs.SUCCESS.msg, hospitalsDict) return json.dumps(result.__dict__, ensure_ascii=False)
def getDiagnosePage(): hospitals=Hospital.getAllHospitals(db_session) hospitalsDict=object2dict.objects2dicts(hospitals) return render_template("adminFenzhen.html", datas=hospitalsDict)
def getAllHospitalList(): hospitals=Hospital.getAllHospitals(db_session) hospitalsDict=dataChangeService.getAllHospital(hospitals) result=rs.ResultStatus(rs.SUCCESS.status,rs.SUCCESS.msg,hospitalsDict) return json.dumps(result.__dict__,ensure_ascii=False)
def getDiagnosePage(): hospitals = Hospital.getAllHospitals(db_session) hospitalsDict = object2dict.objects2dicts(hospitals) return render_template("adminFenzhen.html", datas=hospitalsDict)