本文整理汇总了Python中DoctorSpring.models.User.type方法的典型用法代码示例。如果您正苦于以下问题:Python User.type方法的具体用法?Python User.type怎么用?Python User.type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DoctorSpring.models.User
的用法示例。
在下文中一共展示了User.type方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_add_patient
# 需要导入模块: from DoctorSpring.models import User [as 别名]
# 或者: from DoctorSpring.models.User import type [as 别名]
def test_add_patient(self):
new_user = User("[email protected]", "123456")
new_user.type = UserStatus.patent
User.save(new_user)
new_patient = Patient(new_user.id)
Patient.save(new_patient)
new_userrole = UserRole(new_user.id, RoleId.Patient)
UserRole.save(new_userrole)
示例2: test_addKefu
# 需要导入模块: from DoctorSpring.models import User [as 别名]
# 或者: from DoctorSpring.models.User import type [as 别名]
def test_addKefu(self):
user=User('kefu','77777777777','123456')
user.sex=0
user.status=0
user.email='[email protected]'
user.address='四川省 通江县'
user.phone = '77777777777'
user.type = UserStatus.doctor
user.name = "客服人员"
User.save(user)
new_userrole2 = UserRole(user.id, RoleId.Kefu)
UserRole.save(new_userrole2)
示例3: test_addFenzhen
# 需要导入模块: from DoctorSpring.models import User [as 别名]
# 或者: from DoctorSpring.models.User import type [as 别名]
def test_addFenzhen(self):
user=User('fenzhen','13426026573','123456')
user.sex=0
user.status=0
user.email='[email protected]'
user.address='四川省 通江县'
user.phone = '13426026573'
user.type = UserStatus.doctor
user.name = "分诊医生"
User.save(user)
new_userrole2 = UserRole(user.id, RoleId.Admin)
UserRole.save(new_userrole2)
示例4: register_patient
# 需要导入模块: from DoctorSpring.models import User [as 别名]
# 或者: from DoctorSpring.models.User import type [as 别名]
def register_patient():
form = RegisterFormPatent(request.form)
form_result = form.validate()
if form_result.status == rs.SUCCESS.status:
new_user = User(form.nickname, form.name, form.password)
new_user.type = UserStatus.patent
User.save(new_user)
new_userrole = UserRole(new_user.id, RoleId.Patient)
UserRole.save(new_userrole)
login_session(new_user)
form_result.msg = request.host_url + "homepage"
return jsonify(form_result.__dict__, ensure_ascii=False)
return jsonify(form_result.__dict__, ensure_ascii=False)
示例5: test_addHospitalUser
# 需要导入模块: from DoctorSpring.models import User [as 别名]
# 或者: from DoctorSpring.models.User import type [as 别名]
def test_addHospitalUser(self):
new_user_1 = User('医院用户',"44444444444", "123456")
new_user_1.email = "[email protected]"
new_user_1.phone = "44444444444"
new_user_1.name = "医院用户"
new_user_1.type = UserStatus.doctor
User.save(new_user_1)
new_doctor_1 = Doctor(new_user_1.id)
new_doctor_1.username = "医院用户"
new_doctor_1.hospitalId = 1
new_doctor_1.status = 0
new_doctor_1.type = DoctorType.HospitalUser
Doctor.save(new_doctor_1)
new_userrole = UserRole(new_user_1.id, RoleId.HospitalUser)
UserRole.save(new_userrole)
示例6: test_addSuperUser
# 需要导入模块: from DoctorSpring.models import User [as 别名]
# 或者: from DoctorSpring.models.User import type [as 别名]
def test_addSuperUser(self):
user=User('zhoufan','13426026573','123456')
user.sex=0
user.status=0
user.email='[email protected]'
user.address='四川省 通江县'
user.phone = '13426026573'
user.type = UserStatus.doctor
user.name = "张西"
User.save(user)
patient=Patient()
patient.gender=0
patient.Name='zf'
patient.status=0
patient.userID=user.id
Patient.save(patient)
new_userrole = UserRole(user.id, RoleId.Patient)
UserRole.save(new_userrole)
new_doctor_1 = Doctor(user.id)
new_doctor_1.identityPhone = "029-12345567"
new_doctor_1.username = "张西"
new_doctor_1.diagnoseCount = 10
new_doctor_1.feedbackCount = 5
new_doctor_1.goodFeedbackCount = 5
new_doctor_1.hospitalId = 1
new_doctor_1.departmentId = 1
new_doctor_1.title = "副主任医师"
new_doctor_1.status = 0
Doctor.save(new_doctor_1)
new_doctor2skill_1_1 = Doctor2Skill(new_doctor_1.id,1)
Doctor2Skill.save(new_doctor2skill_1_1)
new_userrole1 = UserRole(user.id, RoleId.Doctor)
UserRole.save(new_userrole1)
new_userrole2 = UserRole(user.id, RoleId.Admin)
UserRole.save(new_userrole2)
示例7: register_doctor
# 需要导入模块: from DoctorSpring.models import User [as 别名]
# 或者: from DoctorSpring.models.User import type [as 别名]
def register_doctor():
form = RegisterFormDoctor(request.form)
form_result = form.validate()
if form_result.status == rs.SUCCESS.status:
new_user = User(form.real_name, form.username, form.password)
new_user.email = form.email
new_user.phone = form.cellphone
new_user.type = UserStatus.doctor
new_user.status = ModelStatus.Draft
User.save(new_user)
new_doctor = Doctor(new_user.id)
new_doctor.username = form.real_name
new_doctor.identityPhone = form.identity_phone
Doctor.save(new_doctor)
new_doctor2skill = Doctor2Skill(new_doctor.id, 1)
Doctor2Skill.save(new_doctor2skill)
new_userrole = UserRole(new_user.id, RoleId.Doctor)
UserRole.save(new_userrole)
return jsonify(form_result.__dict__)
示例8: test_addDoctor
# 需要导入模块: from DoctorSpring.models import User [as 别名]
# 或者: from DoctorSpring.models.User import type [as 别名]
def test_addDoctor(self):
new_user_1 = User('印弘',"1111111111", "123456")
new_user_1.email = "[email protected]"
new_user_1.phone = "111111111111"
new_user_1.type = UserStatus.doctor
new_user_1.imagePath = config.AVATAR_PREFIX+'avatar/yinhong-xj.png'
User.save(new_user_1)
new_doctor_1 = Doctor(new_user_1.id)
new_doctor_1.identityPhone = "029-12345567"
new_doctor_1.username = "印弘"
new_doctor_1.diagnoseCount = 10
new_doctor_1.feedbackCount = 5
new_doctor_1.goodFeedbackCount = 5
new_doctor_1.hospitalId = 1
new_doctor_1.departmentId = 1
new_doctor_1.title = "主任医师"
new_doctor_1.status = 0
Doctor.save(new_doctor_1)
new_doctor2skill_1_1 = Doctor2Skill(new_doctor_1.id,1)
Doctor2Skill.save(new_doctor2skill_1_1)
new_userrole = UserRole(new_user_1.id, RoleId.Doctor)
UserRole.save(new_userrole)
new_user_2 = User('宦怡',"22222222222", "123456")
new_user_2.email = "[email protected]"
new_user_2.phone = "22222222222"
new_user_2.imagePath = config.AVATAR_PREFIX+'avatar/huanyi-xj.jpg'
new_user_2.type = UserStatus.doctor
User.save(new_user_2)
new_doctor_2 = Doctor(new_user_2.id)
new_doctor_2.identityPhone = "029-12345567"
new_doctor_2.username = "宦怡"
new_doctor_2.diagnoseCount = 8
new_doctor_2.feedbackCount = 3
new_doctor_2.hospitalId = 1
new_doctor_2.departmentId = 1
new_doctor_2.title = "主任医师"
new_doctor_2.status = 0
new_doctor_2.goodFeedbackCount = 2
Doctor.save(new_doctor_2)
new_doctor2skill_1_2 = Doctor2Skill(new_doctor_2.id,2)
Doctor2Skill.save(new_doctor2skill_1_2)
new_userrole2 = UserRole(new_user_2.id, RoleId.Doctor)
UserRole.save(new_userrole2)
new_user_3 = User('张劲松',"33333333333", "123456")
new_user_3.email = "[email protected]"
new_user_3.phone = "33333333333"
new_user_3.type = UserStatus.doctor
new_user_3.imagePath = config.AVATAR_PREFIX+'avatar/zhangjinsong-xj.jpg'
User.save(new_user_3)
new_doctor_3 = Doctor(new_user_3.id)
new_doctor_3.identityPhone = "029-12345567"
new_doctor_3.username = "张劲松"
new_doctor_3.diagnoseCount = 9
new_doctor_3.feedbackCount = 4
new_doctor_3.hospitalId = 1
new_doctor_3.departmentId = 1
new_doctor_3.title = "副主任医师"
new_doctor_3.status = 0
new_doctor_3.goodFeedbackCount = 3
Doctor.save(new_doctor_3)
new_doctor2skill_1_3 = Doctor2Skill(new_doctor_3.id,3)
Doctor2Skill.save(new_doctor2skill_1_3)
new_userrole3 = UserRole(new_user_3.id, RoleId.Doctor)
UserRole.save(new_userrole3)
#doctor 4
new_user_4 = User('孙立军',"88888888888", "123456")
new_user_4.email = "[email protected]"
new_user_4.phone = "88888888888"
new_user_4.type = UserStatus.doctor
new_user_4.imagePath = config.AVATAR_PREFIX+'avatar/sunlijun-xj.jpg'
User.save(new_user_4)
new_doctor_4 = Doctor(new_user_4.id)
new_doctor_4.identityPhone = "029-12345567"
new_doctor_4.username = "孙立军"
new_doctor_4.diagnoseCount = 9
new_doctor_4.feedbackCount = 4
new_doctor_4.hospitalId = 1
new_doctor_4.departmentId = 1
new_doctor_4.title = "主任医师"
new_doctor_4.status = 0
#.........这里部分代码省略.........
示例9: test_add_doctor
# 需要导入模块: from DoctorSpring.models import User [as 别名]
# 或者: from DoctorSpring.models.User import type [as 别名]
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 = "[email protected]"
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 = "[email protected]"
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 = "[email protected]"
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
#.........这里部分代码省略.........
示例10: applyDiagnoseForm
# 需要导入模块: from DoctorSpring.models import User [as 别名]
# 或者: from DoctorSpring.models.User import type [as 别名]
def applyDiagnoseForm(formid):
if (int(formid) == 1) :
form = DiagnoseForm3(request.form)
form_result = form.validate()
if form_result.status == rs.SUCCESS.status:
if(form.diagnoseId):
new_diagnose = Diagnose.getDiagnoseById(form.diagnoseId)
else:
new_diagnose = Diagnose.getNewDiagnoseByStatus(DiagnoseStatus.Draft, session['userId'])
if(new_diagnose is None):
new_diagnose = Diagnose()
new_diagnose.status = DiagnoseStatus.Draft
new_diagnose.doctorId = form.doctorId
new_diagnose.uploadUserId = session['userId']
Diagnose.save(new_diagnose)
form_result.data = {'formId': 2, 'diagnoseId': new_diagnose.id}
return jsonify(form_result.__dict__)
elif (int(formid) == 2) :
form = DiagnoseForm1(request.form)
form_result = form.validate()
if form_result.status == rs.SUCCESS.status:
if form.diagnoseId is not None:
new_diagnose = Diagnose.getDiagnoseById(form.diagnoseId)
else:
new_diagnose = Diagnose.getNewDiagnoseByStatus(DiagnoseStatus.Draft, int(session['userId']))
if(new_diagnose is not None):
# 去拿没有draft的用户
if(form.exist):
new_patient = Patient.get_patient_by_id(form.patientid)
else:
new_patient = Patient.get_patient_draft(new_diagnose.patientId)
if new_patient is None:
new_patient = Patient()
new_patient.type = PatientStatus.diagnose
new_patient.userID = session['userId']
new_patient.realname = form.patientname
new_patient.gender = form.patientsex
new_patient.birthDate = datetime.strptime(form.birthdate, "%Y-%m-%d")
new_patient.identityCode = form.identitynumber
new_patient.locationId = form.locationId
new_patient.identityPhone = form.phonenumber
new_patient.status = ModelStatus.Draft
# new_patient.locationId = form.location
Patient.save(new_patient)
new_diagnose.patientId = new_patient.id
Diagnose.save(new_diagnose)
# Hospital User 注册用户
if(form.isHospitalUser):
new_user = User(form.phonenumber, random.sample('zyxwvutsrqponmlkjihgfedcba1234567890',6), False)
new_user.type = UserStatus.patent
new_user.status = ModelStatus.Draft
User.save(new_user)
new_patient.userID = new_user.id
Patient.save(new_patient)
new_userrole = UserRole(new_user.id, RoleId.Patient)
UserRole.save(new_userrole)
form_result.data = {'formId': 3, }
else:
form_result = ResultStatus(FAILURE.status, "找不到第一步草稿")
return jsonify(form_result.__dict__)
elif (int(formid) == 3):
form = DiagnoseForm2(request.form)
form_result = form.validate()
if form_result.status == rs.SUCCESS.status:
if form.diagnoseId is not None:
new_diagnose = Diagnose.getDiagnoseById(form.diagnoseId)
else:
new_diagnose = Diagnose.getNewDiagnoseByStatus(DiagnoseStatus.Draft, int(session['userId']))
if new_diagnose is not None:
if form.exist:
new_pathology = Pathology.getById(form.pathologyId)
elif new_diagnose.pathologyId:
new_pathology = Pathology.getById(new_diagnose.pathologyId)
else:
new_pathology = Pathology.getByPatientStatus(session['userId'], ModelStatus.Draft)
if new_pathology is None:
new_pathology = Pathology(new_diagnose.patientId)
new_pathology.diagnoseMethod = form.dicomtype
new_pathology.status = ModelStatus.Draft
new_pathology.save(new_pathology)
PathologyPostion.deleteByPathologyId(new_pathology.id)
for position in form.patientlocation:
new_position_id = PathologyPostion(new_pathology.id, position)
PathologyPostion.save(new_position_id)
File.cleanDirtyFile(form.fileurl, new_pathology.id, FileType.Dicom)
for fileurl in form.fileurl:
new_file = File.getFilebyId(int(fileurl))
new_file.pathologyId = new_pathology.id
File.save(new_file)
#.........这里部分代码省略.........
示例11: test_addDoctor
# 需要导入模块: from DoctorSpring.models import User [as 别名]
# 或者: from DoctorSpring.models.User import type [as 别名]
def test_addDoctor(self):
new_user_1 = User('印弘',"11111111111", "123456")
new_user_1.email = "[email protected]"
new_user_1.phone = "111111111111"
new_user_1.type = UserStatus.doctor
User.save(new_user_1)
new_doctor_1 = Doctor(new_user_1.id)
new_doctor_1.identityPhone = "029-12345567"
new_doctor_1.username = "印弘"
new_doctor_1.diagnoseCount = 10
new_doctor_1.feedbackCount = 5
new_doctor_1.goodFeedbackCount = 5
new_doctor_1.hospitalId = 1
new_doctor_1.departmentId = 1
new_doctor_1.title = "主任医师"
new_doctor_1.status = 0
Doctor.save(new_doctor_1)
new_doctor2skill_1_1 = Doctor2Skill(new_doctor_1.id,1)
Doctor2Skill.save(new_doctor2skill_1_1)
new_userrole = UserRole(new_user_1.id, RoleId.Doctor)
UserRole.save(new_userrole)
new_user_2 = User('宦怡',"22222222222", "123456")
new_user_2.email = "[email protected]"
new_user_2.phone = "22222222222"
new_user_2.type = UserStatus.doctor
User.save(new_user_2)
new_doctor_2 = Doctor(new_user_2.id)
new_doctor_2.identityPhone = "029-12345567"
new_doctor_2.username = "宦怡"
new_doctor_2.diagnoseCount = 8
new_doctor_2.feedbackCount = 3
new_doctor_2.hospitalId = 1
new_doctor_2.departmentId = 1
new_doctor_2.title = "主任医师"
new_doctor_2.status = 0
new_doctor_2.goodFeedbackCount = 2
Doctor.save(new_doctor_2)
new_doctor2skill_1_2 = Doctor2Skill(new_doctor_2.id,2)
Doctor2Skill.save(new_doctor2skill_1_2)
new_userrole2 = UserRole(new_user_2.id, RoleId.Doctor)
UserRole.save(new_userrole2)
new_user_3 = User('张劲松',"33333333333", "123456")
new_user_3.email = "[email protected]"
new_user_3.phone = "33333333333"
new_user_3.type = UserStatus.doctor
User.save(new_user_3)
new_doctor_3 = Doctor(new_user_3.id)
new_doctor_3.identityPhone = "029-12345567"
new_doctor_3.username = "张劲松"
new_doctor_3.diagnoseCount = 9
new_doctor_3.feedbackCount = 4
new_doctor_3.hospitalId = 1
new_doctor_3.departmentId = 1
new_doctor_3.title = "主任医师"
new_doctor_3.status = 0
new_doctor_3.goodFeedbackCount = 3
Doctor.save(new_doctor_3)
new_doctor2skill_1_3 = Doctor2Skill(new_doctor_3.id,3)
Doctor2Skill.save(new_doctor2skill_1_3)
new_userrole3 = UserRole(new_user_3.id, RoleId.Doctor)
UserRole.save(new_userrole3)
dp=DoctorProfile()
dp.type=DoctorProfileType.Intro
dp.description='从事影像诊断多年,对普通放射、CT以及血管造影的影像诊断有丰富的经验,能够综合各种诊断手段进行诊断。对磁共振的影像诊断有丰富的经验,尤其侧重神经系统疑难疾病的诊断,采用磁共振波谱等多项先进技术,对神经系统肿瘤,肌萎缩性侧索硬化、癫痫以及先天性发育异常、变性疾病等神经系统疾病进行诊断及预后评估,有独到的诊断特色。与神经外科合作,开展肿瘤术前功能定位定向,确保了手术的安全性以及有效性;与身心科合作,开展了精神疾病诊断及临床研究工作。'
dp.userId= new_user_1.id
DoctorProfile.save(dp)
dp=DoctorProfile()
dp.type=DoctorProfileType.Resume
dp.userId= new_user_1.id
dp.description='印弘, 西京医院放射科主任,教授,主任医师,博士,硕士研究生导师。 毕业于第四军医大学。先后在新加坡国立神经科学研究所及美国加州大学旧金山分校作为访问学者工作。承担或参加北京市自然科学基金,新加坡国家医学基金,国家十一五科技支撑项目等多项科研基金,任职期间发表学术论文20余篇,其中SCI 5篇。'
DoctorProfile.save(dp)
dp=DoctorProfile()
dp.type=DoctorProfileType.Award
dp.userId= new_user_1.id
dp.description='担任国家自然科学基金委主办杂志《自然》杂志以及《实用放射学杂志》特约审稿专家'
DoctorProfile.save(dp)
dp=DoctorProfile()
dp.type=DoctorProfileType.Other
dp.userId= new_user_1.id
#.........这里部分代码省略.........