├── .config.ini ├── .config.sample.ini ├── .gitignore ├── Back.py ├── Backup ├── 1_Main.ui ├── 2_Add.ui ├── MessageBox.py ├── way.py └── 深度截图_Control.py_20181107190137.png ├── Control.py ├── Data ├── 20190607191157.bak ├── 20190607191434.bak ├── Main.db ├── Main.py ├── final.db └── init.sql ├── Document ├── API.md ├── Dev.md ├── Usage.md ├── sqlite简单使用说明.md ├── 一次反馈记录.txt ├── 录入活动图.pdf ├── 录入活动图.vsdx ├── 问诊活动图.pdf └── 问诊活动图.vsdx ├── Front.py ├── LICENSE ├── README.md ├── UI ├── MessageBox.py ├── UI.py ├── UI.ui ├── __init__.py ├── final.py ├── final.ui ├── information.py ├── information.ui ├── inquire.py ├── inquire.ui ├── login.py ├── login.ui ├── logwrong.py ├── logwrong.ui ├── missPhone.py ├── missPhone.ui ├── property.py ├── property.ui ├── quantity.py ├── quantity.ui ├── relationDelete.py ├── relationDelete.ui ├── reminder.py ├── reminder.ui ├── result.py ├── result.ui ├── wrong.py ├── wrong.ui ├── yes.py └── yes.ui ├── __init__.py ├── books ├── 仲景全书.docx ├── 本草纲目.docx ├── 汤头歌决.docx ├── 药王全书.docx └── 黄帝内经.docx ├── searchfile.py └── 备份界面 ├── UI.ui ├── UI1.ui ├── UI2.ui └── UI3.ui /.config.ini: -------------------------------------------------------------------------------- 1 | [Environment] 2 | database_path = Data/Main.db 3 | is_test = 4 | 5 | [Config] 6 | username = 7 | password = 8 | 9 | [Setting] 10 | index = symptom,disease,prescription,medicine 11 | relations = symptom_disease,disease_prescription,prescription_medicine 12 | 13 | 14 | -------------------------------------------------------------------------------- /.config.sample.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DefJia/TCM-Retrieval-System/f6921011026c954a2d775a124d1971a63de1074a/.config.sample.ini -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | test.* 2 | test2.py 3 | .idea/ 4 | .vscode/ 5 | venv/ 6 | __pycache__/ 7 | Docs/ 8 | *.spec 9 | build/ 10 | dist/ 11 | 12 | -------------------------------------------------------------------------------- /Back.py: -------------------------------------------------------------------------------- 1 | from configparser import ConfigParser 2 | import sqlite3 3 | #import UI.Wrong 4 | import time 5 | 6 | class Backend: 7 | def __init__(self): 8 | config = ConfigParser() 9 | config.read('.config.ini') 10 | self.index = config.get('Setting', 'index').split(',') 11 | self.relations = config.get('Setting', 'relations').split(',') 12 | # 读取配置文件 13 | db_path = config.get('Environment', 'database_path') 14 | self.database = sqlite3.connect(db_path) 15 | self.cursor = self.database.cursor() 16 | # 连接数据库 17 | 18 | def get_data(self, field_name, column = "name"): 19 | """ 20 | :param field_name: str/int 字段名称(可填序号或名称) 21 | :return: list 相关字段数据列表 22 | """ 23 | if type(field_name) == int and 0 <= field_name <= 3: 24 | field_name = self.index[field_name] 25 | if type(field_name) == str and field_name in self.index: 26 | sql = 'select ' + column + ' from ' + field_name 27 | self.cursor.execute(sql) 28 | data = self.cursor.fetchall() 29 | return data 30 | else: 31 | return [] 32 | 33 | def init(self, type_): 34 | # 初始化界面数据 35 | data = list() 36 | type_ = 0 37 | # 突然觉得任何模式都应该显示所有信息 38 | if type_ == 0: 39 | for elem in self.index: 40 | data.append(self.get_data(elem)) 41 | elif type_ == 1: 42 | data.append(list()) 43 | for elem in self.index[1:-1]: 44 | data.append(self.get_data(elem)) 45 | data.append(list()) 46 | return data 47 | 48 | def query_similar_data(self, box_id, content): 49 | self.cursor.execute('select name from %s where name LIKE ?' % self.index[box_id], ('%%%s%%' % content, )) 50 | names = self.cursor.fetchall() 51 | data = self.convert_raw_to_data(names) if names else list() 52 | return data 53 | 54 | 55 | def union_query(self, box_id, index, text): 56 | """ 57 | :param box_id: 输入的id 58 | :param index: 查询的id 59 | :param text: 匹配文本 60 | :return: data 61 | """ 62 | #self.cursor.execute('select id from %s where name = ?' % self.index[box_id], (text, )) 63 | # 先查询关系号 64 | #res = self.cursor.fetchone() 65 | #if res: 66 | #id = res[0] 67 | if text != "": 68 | #id = res[0] 69 | # db_name = self.relations[int((box_id + index - 1) / 2)] 70 | t = self.index[index] 71 | s = self.index[box_id] 72 | a = self.index[min(index, box_id)]#@ 73 | b = self.index[max(index, box_id)] 74 | #sql = format('select name from %s inner join %s_%s on %s.id = %s_%s.%s_id where %s_id = ?' % (t, a, b, t, a, b, t, s)) 75 | sql = format('select name from %s inner join %s_%s on %s.name = %s_%s.%s_id where %s_id = ?' % (t, a, b, t, a, b, t, s)) 76 | if 'medicine' in (a, b): 77 | #sql = format('select name, grams from %s inner join %s_%s on %s.id = %s_%s.%s_id where %s_id = ?' % (t, a, b, t, a, b, t, s)) 78 | sql = format('select name, grams from %s inner join %s_%s on %s.name = %s_%s.%s_id where %s_id = ?' % (t, a, b, t, a, b, t, s)) 79 | #self.cursor.execute(sql, (id, )) 80 | self.cursor.execute(sql, (text, )) 81 | raw = self.cursor.fetchall() 82 | return self.convert_raw_to_data(raw) 83 | 84 | def iq_inquire(self, name, phone, idcard): 85 | try: 86 | print(name+phone+idcard) 87 | #七种方案,三种只在一个框中输入,三种在两个框中输入,一种在三个框中输入 88 | #没有简便方法的话就只能写全7种了 89 | if name != "" and phone != "" and idcard !="": 90 | self.cursor.execute('select * from patient where name = "%s" and phone = %s and identitynum = %s' %(name, phone, idcard)) 91 | if name == "" and phone != "" and idcard !="": 92 | self.cursor.execute('select * from patient where phone = %s and identitynum = %s' % (phone, idcard)) 93 | if name != "" and phone == "" and idcard !="": 94 | self.cursor.execute('select * from patient where name = "%s" and identitynum = %s' % (name, idcard)) 95 | if name != "" and phone != "" and idcard =="": 96 | self.cursor.execute('select * from patient where name = "%s" and phone = %s ' %(name, phone)) 97 | if name == "" and phone != "" and idcard =="": 98 | self.cursor.execute('select * from patient where phone = %s' %phone) 99 | if name != "" and phone == "" and idcard =="": 100 | print('select * from patient where name = "%s"' %name) 101 | self.cursor.execute('select * from patient where name = "%s"' %name) 102 | if name == "" and phone == "" and idcard !="": 103 | self.cursor.execute('select * from patient where identitynum = %s ' % idcard) 104 | if name == "" and phone == "" and idcard =="": 105 | self.cursor.execute('select * from patient where identitynum = %s ' % idcard) 106 | # sql = "SELECT * FROM EMPLOYEE WHERE INCOME > %s" % (1000) 107 | data = self.cursor.fetchall() 108 | print(data) 109 | return data 110 | except Exception as e: 111 | print(e) 112 | pass 113 | 114 | def save_data(self, db_name, name): 115 | sql = format('insert into %s (name) values ("%s")' % (db_name, name)) 116 | print(sql) 117 | try: 118 | self.cursor.execute(sql) 119 | self.database.commit() 120 | return 0 121 | except sqlite3.IntegrityError: 122 | return 1 123 | 124 | def i_save_data(self,name,gender,age,phone,identitynum,address,id): 125 | sql0 = format('select * from patient where id = \"%s\"' %id ) 126 | sql1 = format('insert into patient (name,gender,age,phone,identitynum,address,id) ' 127 | 'values ("%s","%s","%s","%s","%s","%s","%s")' % (name,gender,age,phone,identitynum,address,id)) 128 | print("这里是v1") 129 | print(sql1) 130 | try: 131 | self.cursor.execute(sql0) 132 | data = self.cursor.fetchall() 133 | print(data) 134 | if data: 135 | return 0 136 | else: 137 | self.cursor.execute(sql1) 138 | self.database.commit() 139 | return id 140 | #这里如何把ID弄到control里面 141 | except sqlite3.IntegrityError: 142 | return 1 143 | 144 | def search_data(self, dbname, column, data): 145 | try: 146 | sql = 'select ' + column + ' from ' + dbname + " where name = '" + data +"'" 147 | self.cursor.execute(sql) 148 | data = self.cursor.fetchall() 149 | return data[0] 150 | except Exception as e: 151 | print(e) 152 | 153 | def search_disease(self,search_area): 154 | print(search_area) 155 | #查询 156 | # 查询 157 | #sql01 = 'select disease.name from (' 158 | #sql0 = 'left join disease on disease.name = c.disease_id ' 159 | sql1 = 'select distinct disease_id ,count(*) from (' 160 | sql2 = ' )Group by disease_id Order by count(*) desc ' 161 | for i in range(len(search_area)): 162 | print(search_area[i]) 163 | symptom_id = search_area[i][0] 164 | ss = 'select disease_id from symptom_disease where symptom_id = \"' + str(symptom_id) + '\" union all ' 165 | sql1 += ss 166 | #print(sql1) 167 | if i == len(search_area) - 1: 168 | sql1 = sql1[:-10] 169 | SQL = sql1 + sql2 170 | print("前方高能") 171 | print(SQL) 172 | try: 173 | self.cursor.execute(SQL) 174 | data = self.cursor.fetchall() 175 | 176 | #print(data) 177 | data1 =[] 178 | for d in data: 179 | data1.append([d[0]]) 180 | print(data1) 181 | return data1 # [0] 182 | except Exception as e: 183 | print(e) 184 | pass 185 | 186 | def save_relation(self,dbid,left_data,right_data): 187 | db_name = self.relations[dbid] 188 | left_name = db_name.split("_")[0] 189 | right_name = db_name.split("_")[-1] 190 | #left_id = int(self.search_data(left_name,"id",left_data)[0])@ 191 | #right_id = int(self.search_data(right_name,"id",right_data)[0]) 192 | left_id = self.search_data(left_name,"name",left_data)[0] 193 | right_id = self.search_data(right_name,"name",right_data)[0] 194 | sql = format('insert into %s (%s_id,%s_id) values ("%s","%s")' % (db_name,left_name,right_name,left_id, right_id)) 195 | print(sql) 196 | try: 197 | self.cursor.execute(sql) 198 | self.database.commit() 199 | return 0 200 | except Exception as e: 201 | print(e) 202 | 203 | def save_relation_gram(self,p,m,g): 204 | if g != " " and g != "NULL": 205 | sql = format( 206 | 'insert into prescription_medicine (prescription_id,medicine_id,grams) values ("%s","%s",%s)' % ( 207 | p, m, g)) 208 | else: 209 | sql = format( 210 | 'insert into prescription_medicine (prescription_id,medicine_id,grams) values ("%s","%s",%s)' % (p, m,0)) 211 | print(sql) 212 | try: 213 | self.cursor.execute(sql) 214 | self.database.commit() 215 | return 0 216 | except Exception as e: 217 | print(e) 218 | 219 | def drop_relation(self,dbid,name1,name2): 220 | db_name = self.relations[dbid] 221 | front_name = db_name.split("_")[0] 222 | back_name = db_name.split("_")[-1] 223 | #front_id = int(self.search_data(front_name, "name", left_data)[0]) 224 | #back_id = int(self.search_data(back_name, "name", right_data)[0]) 225 | sql = format( 226 | 'DELETE FROM %s WHERE %s_id = \"%s\" and %s_id = \"%s\" ' %(db_name, front_name, name1, back_name, name2) 227 | ) 228 | print(sql) 229 | try: 230 | self.cursor.execute(sql) 231 | self.database.commit() 232 | return 0 233 | except Exception as e: 234 | print(e) 235 | pass 236 | 237 | def deletedate(self,dbid,text): 238 | db_name = self.index[dbid] 239 | #id = int(self.search_data(db_name, "id", text)[0])@ 240 | 241 | sql = format( 242 | 'DELETE FROM %s WHERE name = %s' % (db_name, text) 243 | ) 244 | try: 245 | self.cursor.execute(sql) 246 | self.database.commit() 247 | return 0 248 | except Exception as e: 249 | print(e) 250 | pass 251 | 252 | 253 | def get_relations(self): 254 | pass 255 | 256 | def match_data(self): 257 | pass 258 | 259 | @staticmethod 260 | def convert_raw_to_data(raw): 261 | tmp = list() 262 | for elem in raw: 263 | tmp.append(list()) 264 | for item in elem: 265 | tmp[-1].append(str(item)) 266 | return tmp 267 | 268 | def getPatientID(self,column,text): 269 | self.cursor.execute('select id from patient where %s = ?' % column, (text, )) 270 | # 先查询关系号 271 | patientID = self.cursor.fetchone() 272 | return patientID[0] 273 | def get_full_patient_info(self,patientID): 274 | self.cursor.execute('select name,gender,age,phone,identitynum,address from patient where id = ?' , (patientID, )) 275 | # 先查询关系号 276 | data = self.cursor.fetchone() 277 | name = data[0] 278 | gender = data[1] 279 | age = data[2] 280 | phone = data[3] 281 | identitynum = data[4] 282 | address = data[5] 283 | return name,gender,age,phone,identitynum,address 284 | 285 | 286 | def final_save(self,look,listen,question,feel,menstruation,leucorrhoea,mainsymptom,list,id,time): 287 | db_name = 'prescription' 288 | #inquirydate = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())) 289 | #data = 界面里的内容 290 | sql = format( 291 | 'insert into history (id,inquirydate,look,listen,question,feel,menstruation,leucorrhoea,prescription,mainsymptom) ' 292 | 'values ("%s","%s","%s","%s","%s","%s","%s","%s","%s","%s")' 293 | % (id, time, look, listen, question, feel, menstruation, leucorrhoea, list, mainsymptom)) 294 | 295 | try: 296 | self.cursor.execute(sql) 297 | self.database.commit() 298 | return 0 299 | except Exception as e: 300 | print(e) 301 | 302 | #print('update history set %s = \"%s\" where id = %s and inquirydate = \"%s\"' % (db_name,data,id,time)) 303 | 304 | 305 | #这里面要存储开方区域中的所有信息 306 | #1.把开方遍历一遍 307 | #2.存储到与id关联的history表里 308 | pass 309 | 310 | def get_click_result(self,id): 311 | sql = 'select inquirydate,prescription from history where id = %s' %id 312 | self.cursor.execute('select inquirydate,prescription,mainsymptom,look,listen,question,feel,menstruation,leucorrhoea from history where id = \'%s\' ' %id) 313 | print('select inquirydate,prescription,mainsymptom,look,listen,question,feel,menstruation,leucorrhoea from history where id = \'%s\' ' %id) 314 | data = self.cursor.fetchall() 315 | return data 316 | 317 | def result_UI_show(self,time): 318 | self.cursor.execute('select prescription from history where inquirydate = \"%s\"' %time) 319 | print('select prescription from history where inquirydate = \"%s\"' %time) 320 | data = self.cursor.fetchall() 321 | print("重要") 322 | print(data) 323 | return data 324 | 325 | def result_get_id(self): 326 | self.cursor.execute('select prescription from history where inquirydate = \"%s\"' % time) 327 | #print('select prescription from history where inquirydate = \"%s\"' % time) 328 | data = self.cursor.fetchall() 329 | return data 330 | 331 | 332 | if __name__ == '__main__': 333 | test = Backend() 334 | # test.query_similar_data(1, '少') 335 | test.union_query(1, 0, '少阳症') 336 | -------------------------------------------------------------------------------- /Backup/1_Main.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Main 4 | 5 | 6 | 7 | 0 8 | 0 9 | 1026 10 | 512 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | 18 | 19 | 20 | 830 21 | 410 22 | 93 23 | 28 24 | 25 | 26 | 27 | 退出 28 | 29 | 30 | 31 | 32 | 33 | 40 34 | 40 35 | 311 36 | 351 37 | 38 | 39 | 40 | 病症—药方检索 41 | 42 | 43 | 44 | 45 | 20 46 | 40 47 | 113 48 | 21 49 | 50 | 51 | 52 | 53 | 54 | 55 | 30 56 | 80 57 | 93 58 | 28 59 | 60 | 61 | 62 | 搜索 63 | 64 | 65 | 66 | 67 | 68 | 190 69 | 40 70 | 111 71 | 281 72 | 73 | 74 | 75 | 76 | 77 | 78 | 40 79 | 310 80 | 93 81 | 28 82 | 83 | 84 | 85 | 导入 86 | 87 | 88 | 89 | 90 | 91 | 92 | 390 93 | 40 94 | 561 95 | 341 96 | 97 | 98 | 99 | 药名 100 | 101 | 102 | 103 | 104 | 40 105 | 40 106 | 501 107 | 281 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 700 116 | 410 117 | 93 118 | 28 119 | 120 | 121 | 122 | 打印 123 | 124 | 125 | 126 | 127 | 128 | 129 | 0 130 | 0 131 | 1026 132 | 26 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /Backup/2_Add.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | add 4 | 5 | 6 | 7 | 0 8 | 0 9 | 706 10 | 616 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | 18 | 19 | 20 | 220 21 | 500 22 | 93 23 | 28 24 | 25 | 26 | 27 | 添加 28 | 29 | 30 | 31 | 32 | 33 | 360 34 | 500 35 | 93 36 | 28 37 | 38 | 39 | 40 | 取消 41 | 42 | 43 | 44 | 45 | 46 | 340 47 | 20 48 | 321 49 | 411 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 1 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 10 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 2 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 11 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 3 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 12 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 4 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 13 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 5 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 14 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 6 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 15 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 7 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 16 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 8 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 17 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 9 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 18 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 70 266 | 80 267 | 221 268 | 131 269 | 270 | 271 | 272 | 273 | 274 | 275 | 编号 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 病名 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 药方名 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 0 313 | 0 314 | 706 315 | 26 316 | 317 | 318 | 319 | 320 | 321 | 322 | lineEdit_id 323 | lineEdit_bingming 324 | lineEdit_yaofang 325 | lineEdit_1 326 | lineEdit_2 327 | lineEdit_3 328 | lineEdit_4 329 | lineEdit_5 330 | lineEdit_6 331 | lineEdit_7 332 | lineEdit_8 333 | lineEdit_9 334 | lineEdit_10 335 | lineEdit_11 336 | lineEdit_12 337 | lineEdit_13 338 | lineEdit_14 339 | lineEdit_15 340 | lineEdit_16 341 | lineEdit_17 342 | lineEdit_18 343 | pushButton_tianjia 344 | pushButton_out 345 | 346 | 347 | 348 | 349 | -------------------------------------------------------------------------------- /Backup/MessageBox.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Sun Oct 7 15:04:54 2018 4 | 5 | @author: yang 6 | """ 7 | from PyQt5 import QtWidgets 8 | from PyQt5.QtWidgets import QMessageBox 9 | 10 | class MessageBox(QtWidgets.QWidget): 11 | def __init__(self,content,question): 12 | super().__init__() 13 | self.title = "message" 14 | self.left = 570 15 | self.top = 290 16 | self.width = 320 17 | self.height = 200 18 | self.content = content 19 | self.question = question 20 | self.initUI() 21 | 22 | def initUI(self): 23 | self.setWindowTitle(self.title) 24 | self.setGeometry(self.left, self.top, self.width, self.height) 25 | 26 | self.buttonReply = QMessageBox.question(self, self.content, self.question, QMessageBox.Yes | QMessageBox.No, QMessageBox.No) 27 | #Cancel Open Discard Reset No RestoreDefaults Ignore 28 | #Ok Save Close Yes NoToAll Abort 29 | #Help SaveAll Apply YesToAll NoButton Retry 30 | ''' 31 | if self.buttonReply == QtWidgets.QMessageBox.Yes: 32 | print('Yes clicked.') 33 | else: 34 | print('No clicked.') 35 | ''' 36 | #buttonReply = QMessageBox.question(self, 'PyQt5 message', "Do you want to save?", QMessageBox.Yes | QMessageBox.No | QMessageBox.Cancel, QMessageBox.Cancel) 37 | #print(int(buttonReply)) 38 | #if buttonReply == QMessageBox.Yes: 39 | # print('Yes clicked.') 40 | #if buttonReply == QMessageBox.No: 41 | # print('No clicked.') 42 | #if buttonReply == QMessageBox.Cancel: 43 | # print('Cancel') 44 | 45 | def getReply(self): 46 | if self.buttonReply == QtWidgets.QMessageBox.Yes: 47 | return "yes" 48 | else: 49 | return "no" 50 | 51 | #def setTitle(self,title): 52 | # self.title = title 53 | 54 | #def setContent(self,content): 55 | # self.content = content 56 | 57 | #def setQuestion(self,question): 58 | # self.question = question 59 | 60 | def showWindow(self): 61 | self.show() 62 | -------------------------------------------------------------------------------- /Backup/way.py: -------------------------------------------------------------------------------- 1 | import PyQt5.QtWidgets 2 | from PyQt5 import QtWidgets 3 | import UI 4 | def SearchTable(cursor,id,mg): 5 | #try: 6 | cursor.execute("sql") 7 | #sql= " WHERE aid= '" + str(id) + "' " 8 | #data = cursor.fetchone() 9 | data1 = cursor.fetchall() 10 | #顺序 11 | #print(data) 12 | #print(data1) 13 | #print(len(data)) 14 | #print(len(data1)) 15 | 16 | row = len(data1) 17 | #col = len(data) 18 | mg.tableWidget_guanli.setRowCount(row) 19 | #print("检查") 20 | for rows in range(row): 21 | for columns in range(4): 22 | mg.tableWidget_guanli.setItem(rows,columns, QtWidgets.QTableWidgetItem(str(data1[rows][columns]))) 23 | 24 | 25 | def addTable(cursor,id,mg): 26 | #try: 27 | cursor.execute("sql") 28 | #sql= " WHERE aid= '" + str(id) + "' " 29 | #data = cursor.fetchone() 30 | data1 = cursor.fetchall() 31 | #测试 32 | #print(data) 33 | #print(data1) 34 | #print(len(data)) 35 | #print(len(data1)) 36 | 37 | row = len(data1) 38 | #col = len(data) 39 | mg.tableWidget_guanli.setRowCount(row) 40 | #print("检查") 41 | A = UI.lineSymptom.text() 42 | 43 | for rows in range(row): 44 | for columns in range(4): 45 | # mg.tablewidgetSymptom.setItem(rows,columns, QtWidgets.QTableWidgetItem(str(data1[rows][columns]))) 46 | 47 | UI.tablewidgetSymptom.setItem(rows, 0, QtWidgets.QTableWidgetItem(A)) 48 | 49 | 50 | basket = { A , 'orange', 'apple', 'pear', 'orange', 'banana'} 51 | -------------------------------------------------------------------------------- /Backup/深度截图_Control.py_20181107190137.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DefJia/TCM-Retrieval-System/f6921011026c954a2d775a124d1971a63de1074a/Backup/深度截图_Control.py_20181107190137.png -------------------------------------------------------------------------------- /Data/20190607191157.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DefJia/TCM-Retrieval-System/f6921011026c954a2d775a124d1971a63de1074a/Data/20190607191157.bak -------------------------------------------------------------------------------- /Data/20190607191434.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DefJia/TCM-Retrieval-System/f6921011026c954a2d775a124d1971a63de1074a/Data/20190607191434.bak -------------------------------------------------------------------------------- /Data/Main.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DefJia/TCM-Retrieval-System/f6921011026c954a2d775a124d1971a63de1074a/Data/Main.db -------------------------------------------------------------------------------- /Data/Main.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DefJia/TCM-Retrieval-System/f6921011026c954a2d775a124d1971a63de1074a/Data/Main.py -------------------------------------------------------------------------------- /Data/final.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DefJia/TCM-Retrieval-System/f6921011026c954a2d775a124d1971a63de1074a/Data/final.db -------------------------------------------------------------------------------- /Data/init.sql: -------------------------------------------------------------------------------- 1 | -- drop tables 2 | drop table symptom; 3 | drop table illness; 4 | drop table anagraph; 5 | drop table medicine; 6 | drop table illness_anagraph; 7 | drop table symptom_illness; 8 | drop table anagraph_medicine; 9 | 10 | -- create basic tables 11 | create table symptom( 12 | id integer primary key AUTOINCREMENT, 13 | name varchar(10) not null unique 14 | ); 15 | create table illness( 16 | id integer primary key AUTOINCREMENT, 17 | name varchar(10) not null unique 18 | ); 19 | create table anagraph( 20 | id integer primary key AUTOINCREMENT, 21 | name varchar(10) not null unique 22 | ); 23 | create table medicine( 24 | id integer primary key AUTOINCREMENT, 25 | name varchar(10) not null unique, 26 | property varchar(5) check(property in ('先煎', '后下')) 27 | ); 28 | 29 | -- Relations 30 | create table symptom_illness( 31 | illness_id integer, 32 | symptom_id integer, 33 | foreign key (illness_id) references illness(id), 34 | foreign key (symptom_id) references symptom(id) 35 | ); 36 | create table illness_anagraph( 37 | illness_id integer, 38 | anagraph_id integer, 39 | foreign key (illness_id) references illness(id), 40 | foreign key (anagraph_id) references anagraph(id) 41 | ); 42 | create table anagraph_medicine( 43 | anagraph_id integer, 44 | medicine_id integer, 45 | grams integer, 46 | foreign key (anagraph_id) references anagraph(id), 47 | foreign key (medicine_id) references medicine(id) 48 | ); 49 | 50 | -- init data 51 | insert into symptom('name') values ('头疼'); 52 | insert into symptom('name') values ('头痛'); 53 | insert into symptom('name') values ('发热'); 54 | insert into symptom('name') values ('脚痛'); 55 | insert into symptom('name') values ('口苦'); 56 | insert into symptom('name') values ('咽干'); 57 | 58 | insert into illness('name') values ('少阳症'); 59 | 60 | insert into anagraph('name') values ('小柴胡汤'); 61 | 62 | insert into medicine('name') values ('枸杞'); 63 | insert into medicine('name') values ('当归'); 64 | 65 | insert into symptom_illness (symptom_id, illness_id) values (1, 1); 66 | insert into symptom_illness (symptom_id, illness_id) VALUES (2, 1); 67 | insert into illness_anagraph (illness_id, anagraph_id) VALUES (1, 1); 68 | insert into anagraph_medicine (anagraph_id, medicine_id, grams) VALUES (1, 2, 5); 69 | insert into anagraph_medicine (anagraph_id, medicine_id, grams) VALUES (1, 1, 10); 70 | -------------------------------------------------------------------------------- /Document/API.md: -------------------------------------------------------------------------------- 1 | # 接口文档 2 | 3 | [TOC] 4 | 5 | > 维护人员:Defjia 6 | > 7 | > 创建时间:2018-10-24 8 | 9 | 调用Back.BackEnd类,使用以下方法。 10 | 11 | ## 1. 初始化界面 12 | 13 | 在界面初始化时请求数据,显示数据在主界面。 14 | 15 | ### 请求方法名 16 | 17 | init 18 | 19 | ### 请求参数 20 | 21 | | 参数名 | 类型 | 必填 | 描述 | 默认值 | 参考值 | 22 | | :----: | :--: | :--: | :----: | :----: | :----: | 23 | | type | int | 是 | 模式ID | - | 1 | 24 | 25 | ### 正确返回值 26 | 27 | { 28 | 29 | code: 0 30 | 31 | data: { 32 | 33 | ​ 'symptom': [], 34 | 35 | ​ 'illness': [], 36 | 37 | ​ 'anagraph': [], 38 | 39 | ​ 'medicine': [], 40 | 41 | ​ } 42 | 43 | } 44 | 45 | ### 错误返回值 46 | 47 | { 48 | 49 | code: 1, 50 | 51 | error_message: 'The reason of error.' 52 | 53 | } 54 | 55 | ## 2. 输入框实时查询 56 | 57 | ### 请求方法名 58 | 59 | query 60 | 61 | ### 请求参数 62 | 63 | | 参数名 | 类型 | 必填 | 描述 | 默认值 | 参考值 | 64 | | :-----: | :--: | :--: | :-----------: | :------------: | :----: | 65 | | box_id | int | 是 | 输入框ID(0-3) | - | 0 | 66 | | content | str | 否 | 输入框内容 | ''(空字符串) | SYZ | 67 | 68 | ### 正确返回值 69 | 70 | { 71 | 72 | code: 0, 73 | 74 | data: [] 75 | 76 | } 77 | 78 | ### 错误返回值 79 | 80 | { 81 | 82 | code: 1, 83 | 84 | error_message: 'The reason of error.' 85 | 86 | } 87 | 88 | ## 3. 添加记录 89 | 90 | 录入模式下,添加记录;若当前位置不为空,则同时添加关系。 91 | 92 | ### 请求方法名 93 | 94 | add_data 95 | 96 | ### 请求参数 97 | 98 | | 参数名 | 类型 | 必填 | 描述 | 默认值 | 参考值 | 99 | | :--------------: | :---: | :--: | :--------------------------: | :----: | :------------: | 100 | | box_id | int | 是 | 输入框ID(0-3) | - | 1 | 101 | | content | str | 是 | 输入框内容 | - | '少阳症' | 102 | | current_location | tuple | 否 | 当前位置(包含种类和相关ID) | None | ('illness', 2) | 103 | 104 | ### 正确返回值 105 | 106 | { 107 | 108 | code: 0 109 | 110 | } 111 | 112 | ### 错误返回值 113 | 114 | { 115 | 116 | code: 1, 117 | 118 | error_message: 'The reason of error.' 119 | 120 | } 121 | 122 | ## 4. 显示相关信息 123 | 124 | 当选中某对象时,显示相邻的一个或两个关联对象。 125 | 126 | ### 请求方法名 127 | 128 | get_relations 129 | 130 | ### 请求参数 131 | 132 | | 参数名 | 类型 | 必填 | 描述 | 默认值 | 参考值 | 133 | | :-----: | :--: | :--: | :----------: | :----: | :----: | 134 | | box_id | int | 是 | 当前输入框ID | - | 0 | 135 | | content | str | 是 | 选中的对象 | - | '头疼' | 136 | 137 | ### 正确返回值 138 | 139 | { 140 | 141 | code: 0, 142 | 143 | data: { 144 | 145 | ​ 'medical': [], 146 | 147 | ​ 'illness': [] 148 | 149 | ​ } 150 | 151 | } 152 | 153 | ### 错误返回值 154 | 155 | { 156 | 157 | code: 1, 158 | 159 | error_message: 'The reason of error.' 160 | 161 | } 162 | 163 | ## 5. 查找匹配信息 164 | 165 | 检索模式下,在症状或药列表中添加一条或多条记录时,自动显示匹配的父对象 166 | 167 | ### 请求方法名 168 | 169 | match_data 170 | 171 | ### 请求参数 172 | 173 | | 参数名 | 类型 | 必填 | 描述 | 默认值 | 参考值 | 174 | | :-------: | :--: | :--: | :------------------: | :----: | :--------------: | 175 | | box_id | int | 是 | 0 -> 症状、3 -> 药 | - | 0 | 176 | | para_list | list | 是 | 列表中是所有相关条件 | - | ['头疼', '发热'] | 177 | 178 | ### 正确返回值 179 | 180 | { 181 | 182 | code: 0, 183 | 184 | data: { 185 | 186 | ​ 'illness': [] 187 | 188 | ​ } 189 | 190 | } 191 | 192 | ### 错误返回值 193 | 194 | { 195 | 196 | code: 1, 197 | 198 | error_message: 'The reason of error.' 199 | 200 | } 201 | 202 | 203 | 204 | ------ 205 | 206 | The end. -------------------------------------------------------------------------------- /Document/Dev.md: -------------------------------------------------------------------------------- 1 | # 开发者文档 2 | 3 | [TOC] 4 | 5 | ## 开发规范 6 | 7 | ### 文件存放位置 8 | 9 | - 所有文档位于Document/ 10 | - UI文件及生成的Python文件位于文件夹UI/下 11 | - 暂时用不到的文件与相关备份位于Backup/下 12 | 13 | ### 操作说明 14 | 15 | - Control.py包含与界面显示有关的方法 16 | - Front.py包含前端方法,负责处理被触发的请求并修改界面内容 17 | - Back.py包含与数据库调用相关的内容,API文档可见API.md 18 | - 数据库文件为Data/Main.db,生成的sql语句为Data/init.sql 19 | - 在测试阶段,修改数据库或添加数据,直接在语句中修改,然后重新跑一遍覆盖原有数据库 20 | - .config.ini是与环境有关的配置文件 21 | 22 | ### 命名规范 23 | 24 | #### PyQt组件名 25 | 26 | - 采用驼峰命名法,控件类型+名称,如lineSymptom 27 | 28 | #### Python代码命名 29 | 30 | - 类的命名,首字母大写 31 | - 方法函数的命名,除特殊函数外,用三个以下英文单词表述其功能,用下划线连接,均小写。 32 | 33 | #### 数据库命名 34 | 35 | - 数据库名一律小写 36 | - 字段名称一律小写 37 | 38 | ## 数据库设计 39 | 40 | ### 中药(Medicine) 41 | 42 | ### 药方(Anagraph) 43 | 44 | - 药方名[name, PK] 45 | - 对应中药ID以及克数的集合[info] 46 | 47 | ### 病(Illness) 48 | 49 | - 序号[id, PK, int(4)] 50 | - 病症名[name] 51 | - 对应药方ID的集合[ana_id] 52 | 53 | ### 症状(symptom) 54 | 55 | - 序号[id, PK, int(4)] 56 | - 症状名[name] 57 | - 对应病的ID[ill_id] -------------------------------------------------------------------------------- /Document/Usage.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DefJia/TCM-Retrieval-System/f6921011026c954a2d775a124d1971a63de1074a/Document/Usage.md -------------------------------------------------------------------------------- /Document/sqlite简单使用说明.md: -------------------------------------------------------------------------------- 1 | # 导入SQLite驱动: 2 | import sqlite3 3 | # 连接到SQLite数据库 4 | # 数据库文件是test.db 5 | # 如果文件不存在,会自动在当前目录创建: 6 | conn = sqlite3.connect('test.db') 7 | # 创建一个Cursor: 8 | cursor = conn.cursor() 9 | # 执行一条SQL语句,创建user表: 10 | cursor.execute('create table user (id varchar(20) primary key, name varchar(20))') 11 | 12 | # 继续执行一条SQL语句,插入一条记录: 13 | cursor.execute('insert into user (id, name) values (\'1\', \'Michael\')') 14 | 15 | # 通过rowcount获得插入的行数: 16 | cursor.rowcount 17 | # 获得查询结果集: 18 | values = cursor.fetchall() 19 | # 关闭Cursor: 20 | cursor.close() 21 | # 提交事务: 22 | conn.commit() 23 | # 关闭Connection: 24 | conn.close() 25 | 26 | ------------------------------------- 27 | 可能用到语句范例(貌似没啥特别要注意的) 28 | 29 | UPDATE user SET name = '23' WHERE id = 2 30 | DELETE FROM table WHERE id = 1 31 | INSERT INTO user(id,name,king) VALUES(0,'12','US') 32 | SELECT columns FROM tale WHERE iddf = 'oiu14' 33 | count() distinct 34 | -------------------------------------------------------------------------------- /Document/一次反馈记录.txt: -------------------------------------------------------------------------------- 1 | X记录病人信息界面字太小 加身份证号 2 | X注释栏要大些(望闻问切/经带) 3 | X记录 加手机传输? 手机 病人填写信息? 4 | 界面再大些 5 | X点人名调药方,在原先基础上改(手机号/身份证号 唯一确定) 6 | 要在tablewidget 上写 ? 录入模式不用关联 7 | 8 | 录入模式有逻辑问题!应该实时更新旁边的tableweidgt 9 | 主诉栏 生成药方还要病症,望闻问切栏与症状相关联, 10 | 填写主诉的如果没有就提示,加到病症 11 | 还要查询病人 12 | 展示以图片 有格式 台头空着(同仁堂、)电子签字 B5纸 13 | 病人信息和药方信息数据库分开 14 | 完整的界面 15 | 16 | 17 | 18 | 1.病人信息录入 19 | 2.录入模式关联接触 -------------------------------------------------------------------------------- /Document/录入活动图.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DefJia/TCM-Retrieval-System/f6921011026c954a2d775a124d1971a63de1074a/Document/录入活动图.pdf -------------------------------------------------------------------------------- /Document/录入活动图.vsdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DefJia/TCM-Retrieval-System/f6921011026c954a2d775a124d1971a63de1074a/Document/录入活动图.vsdx -------------------------------------------------------------------------------- /Document/问诊活动图.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DefJia/TCM-Retrieval-System/f6921011026c954a2d775a124d1971a63de1074a/Document/问诊活动图.pdf -------------------------------------------------------------------------------- /Document/问诊活动图.vsdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DefJia/TCM-Retrieval-System/f6921011026c954a2d775a124d1971a63de1074a/Document/问诊活动图.vsdx -------------------------------------------------------------------------------- /Front.py: -------------------------------------------------------------------------------- 1 | from configparser import ConfigParser 2 | from Back import Backend 3 | from PyQt5.QtWidgets import QTableWidgetItem 4 | 5 | 6 | class Frontend: 7 | def __init__(self, interface, reminder=None, information = None,property=None) : 8 | config = ConfigParser() 9 | config.read('.config.ini') 10 | self.index = config.get('Setting', 'index').split(',') 11 | # 读取配置文件 12 | self.interface = interface 13 | self.reminder = reminder 14 | self.information = information 15 | self.property = property 16 | self.row = 0 17 | self.column = 0 18 | self.id = 0 19 | self.time = 0 20 | self.type = 1 # 模式 21 | self.location = tuple() # 当前位置 22 | self.line = "" #为了使用一个提示框替代 23 | self.search_area = [list(), list(), list(), list()] # 检索区 24 | # self.search_area_symptom = list() 25 | self.result_list = list() #中途存一下双击result之后的列表 26 | self.prescription_list = list() 27 | self.mainSymptom = list() 28 | self.work_area = dict() # 药方工作区 29 | self.prescription_list = list() #把开方区里的数据捕获之后放入的列表 30 | self.medicine_gram_list = list() 31 | self.widgets = list(range(4)) 32 | self.widgets[0] = self.interface.tablewidgetSymptom 33 | self.widgets[1] = self.interface.tablewidgetDisease 34 | self.widgets[2] = self.interface.tablewidgetPrescription 35 | self.widgets[3] = self.interface.tablewidgetMedicine 36 | self.viceSymptoms = list(range(6)) 37 | self.viceSymptoms[0] =self.information.lineLook 38 | self.viceSymptoms[1] =self.information.lineListen 39 | self.viceSymptoms[2] =self.information.lineQuestion 40 | self.viceSymptoms[3] =self.information.lineFeel 41 | self.viceSymptoms[4] =self.information.lineMenstruation 42 | self.viceSymptoms[5] =self.information.lineLeucorrhoea 43 | # Global Variable 44 | self.back = Backend() 45 | #暂时存储病人的所有信息 46 | self.name = "无" 47 | self.gender = "无" 48 | self.age = 0 49 | self.phone = 0 50 | self.identitynum = "" 51 | self.address = "" 52 | 53 | # inquirydate = line 54 | self.look = "" 55 | self.listen = "" 56 | self.question = "" 57 | self.feel = "" 58 | self.menstruation = "" 59 | self.leucorrhoea = "" 60 | # prescription = self.information.linePrescription.text() 61 | # mainsymptom = self.information.lineSymptom.text() 62 | self.mainsymptom = self.search_area[0] 63 | 64 | # Import function 65 | # self.init_data() # 不用一开始显示,而且显示会崩溃,原因未查 66 | # Init data 67 | 68 | def init_data(self): 69 | data = self.back.init(self.type) 70 | self.set_all_tables(data) 71 | return 0 72 | 73 | def get_input(self, box_id, input_box, option_box): 74 | # 当获取到输入,触发此函数,然后在下拉框中显示匹配内容 75 | text = input_box.text() 76 | if text: 77 | data = self.back.query_similar_data(box_id, text) 78 | if data: 79 | #print("测试1") 80 | option_box.show() 81 | self.set_table(option_box, data) 82 | 83 | else: 84 | option_box.hide() 85 | #print("测试") 86 | else: 87 | option_box.hide() 88 | return 0 89 | 90 | def optioned_data(self, box_id, text, mode=0, data = 0, aaa=0): 91 | # 任意模式下,当option被选中时,显示相关数据 92 | # mode为0时只显示右边 93 | #self.search_area = [list() for i in range(4)] 94 | # 初始化 95 | if aaa ==0: 96 | target_indexs = list() 97 | if box_id == 3 and [text] not in self.search_area[box_id]: 98 | #self.search_area[3] = data 99 | self.search_area[3].append([text," "]) 100 | print("AAAA") 101 | print(data) 102 | 103 | if box_id != 3 and [text] not in self.search_area[box_id] : 104 | self.search_area[box_id].append([text]) 105 | 106 | target_indexs.append(box_id + 1) 107 | for index in target_indexs: 108 | if box_id != 0: 109 | sub_data = self.back.union_query(box_id, index, text) 110 | if sub_data: 111 | self.search_area[index] = sub_data 112 | 113 | if mode == 1 and box_id != 3: 114 | target_indexs.append(box_id + 1) 115 | pass 116 | 117 | for index in target_indexs: 118 | if box_id != 0: 119 | sub_data = self.back.union_query(box_id, index, text) 120 | if sub_data: 121 | self.search_area[index] = sub_data 122 | else: 123 | self.search_area[1] = self.back.search_disease(self.search_area[0]) 124 | #获取serach_area[0]里面的每一个元素,并启动查询方法传入(search_area[0]),查询里面每一个数 125 | #在back里面写方法 Select 病名 from 表 where 病症名 = line.text1 or 病症名 = line.text2 order by xxx 126 | #settable() 127 | pass 128 | self.set_table(self.information.tablewidgetMainSymptom, self.search_area[0]) 129 | self.set_all_tables(self.search_area) 130 | # print(self.search_area) 131 | return 0 132 | ''' 133 | elif aaa == 1: 134 | target_indexs = list() 135 | if [text] not in self.search_area[box_id]: 136 | self.search_area[box_id].append([text]) 137 | if mode == 1 and box_id != 3: 138 | target_indexs.append(box_id + 1) 139 | pass 140 | for index in target_indexs: 141 | sub_data = self.back.union_query(box_id, index, text) 142 | if sub_data: 143 | self.search_area[index] = sub_data 144 | self.set_all_tables(self.search_area) 145 | 146 | #target_indexs = list() 147 | if [text] not in self.mainSymptom: 148 | self.mainSymptom.append([text]) 149 | 150 | print(self.mainSymptom) 151 | 152 | # self.mainSymptom.clear() 153 | return 0 154 | ''' 155 | def get_data(self, box_id=1, content=1): 156 | # 录入模式下,当添加按钮被触发时,将输入的内容添加到数据库 157 | # 如果当前位置不为空,还要添加关系 158 | return ['3', '2'] 159 | 160 | def save_data(self,index,text): 161 | # 如何获取点击按钮 162 | #index = self.group_inputs.index(input_box) 163 | if index == 0: 164 | name = "symptom" #是不是直接这个 165 | elif index == 1: 166 | name = "disease" 167 | elif index == 2: 168 | name = "prescription" 169 | elif index == 3: 170 | name = "medicine" 171 | 172 | if text: 173 | res = self.back.save_data(name, text) 174 | if res: 175 | print('该名称已存在') 176 | else: 177 | print('录入成功') 178 | 179 | 180 | # 新加方法 181 | def add_item(self, box_id, text): 182 | check_id = 0 183 | for value in self.search_area[box_id]: 184 | if text == value: 185 | check_id = check_id + 1 186 | if check_id == 0: 187 | self.search_area[box_id].append(text) 188 | # print(text) 189 | if self.type == 0: 190 | self.save_data(box_id, text) 191 | 192 | 193 | @staticmethod 194 | def set_table(table, data_list): 195 | # data_list: [[item, item], [item, item]] 196 | if data_list: 197 | print(data_list) 198 | 199 | ''' 200 | for elem in data_list: 201 | elem.append('克') 202 | ''' 203 | row = len(data_list) 204 | column = len(data_list[0]) 205 | print(row,column) 206 | table.setRowCount(row) 207 | table.setColumnCount(column) 208 | for r in range(row): 209 | columnCurrentRow = len(data_list[r]) 210 | for c in range(columnCurrentRow): 211 | t = (str(data_list[r][c])) 212 | #table.setItem(r, c, QTableWidgetItem(data_list[r][c])) 213 | table.setItem(r, c, QTableWidgetItem(t)) 214 | 215 | #如果table是开方区的则 216 | 217 | def set_all_tables(self, data): 218 | cnt = 0 219 | for item in data: 220 | if type(item) == list and item: 221 | self.set_table(self.widgets[cnt], item) 222 | cnt += 1 223 | return 0 224 | 225 | def deletedata(self,text,index): 226 | self.back.deletedate(text,index) 227 | pass 228 | 229 | def final_save(self,list,id,time): 230 | look = self.look 231 | listen =self.listen 232 | question = self.question 233 | feel = self.feel 234 | menstruation = self.menstruation 235 | leucorrhoea = self.leucorrhoea 236 | mainsymptom = self.mainsymptom 237 | self.back.final_save(look,listen,question,feel,menstruation,leucorrhoea,mainsymptom,list,id,time) 238 | pass 239 | 240 | def get_table_data(self,table,list): 241 | row = table.rowCount() 242 | column = table.columnCount() 243 | print(column) 244 | for i in range(row): 245 | for j in range(column): 246 | # 8和7是row和column,怎么从front中抽取row和column 247 | if self.interface.tablewidgetPrescribe.item(i, j).text() != "NULL": 248 | print(self.interface.tablewidgetPrescribe.item(i, j).text()) 249 | # print(self.interface.tablewidgetPrescribe.item(2, 2).text()) 250 | list.append(self.interface.tablewidgetPrescribe.item(i, j).text()) 251 | 252 | 253 | if __name__ == '__main__': 254 | pass -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 中医智能检索系统 TCM-Retrieval-System 2 | 3 | [TOC] 4 | 5 | ## 简介 6 | 7 | ​ 中医智能检索系统是一款辅助中医医生开药方的桌面软件,包含录入和检索症状、病症、药方、药材的功能,也具备文献检索功能。 8 | 9 | ## 文档 10 | 11 | - [使用说明](Document/Usage.md) 12 | - [开发文档](Document/Dev.md) 13 | - [接口文档](Document/API.md) 14 | - [录入模式UML图](Document/录入活动图.pdf) 15 | - [问诊模式UML图](Document/问诊活动图.pdf) 16 | 17 | ## 界面设计 18 | 19 | ![深度截图_Control.py_20181107190137](Backup/深度截图_Control.py_20181107190137.png) 20 | 21 | ## 打包方法 22 | 23 | 1. 先安装Pyinstaller,并切换到项目根目录下 24 | 2. `pyinstaller -F -w Control.py` 25 | 3. 生成的文件在根目录dist文件夹下,然后把Data文件夹和.config.ini复制一份到dist中。即可运行。 26 | 27 | ## 开发进程 28 | 29 | ### UI界面 30 | 31 | - [ ] 修改下拉框的命名方式,同时修改代码中相关的变量 32 | - [x] **在检索模式下,隐藏+号** 33 | - [ ] 在录入模式下,应有编辑和删除按钮 34 | - [x] **去掉其他三个的表头** 35 | - [x] 模式选择按钮貌似改成RadioButton这样的多选框比较好? 36 | - [x] 在开方工作区下添加清空和保存按钮 37 | - [x] **另外可以考虑加个标题** 38 | - [ ] 录入药需要选择属性 39 | - [x] **去掉表头*3** 40 | - [ ] 统一组件名称命名方法并同步修改代码中变量 41 | - [ ] **添加当前位置的文本框(我好像给删了)** 42 | 43 | - [ ] radiobutton替换成标签页/或界面变化更明显一点 44 | - [ ] 录入框中修改,可删除 45 | - [ ] 录入模式——按钮——建立病症药方关系;开放模式——按钮——导入药方 46 | ### Control类 47 | 48 | - [ ] 完善相关功能 49 | - [x] RadioButtom使加号消失 50 | - [ ] 以列表的形式添加数据到 tablewidgetXXX里面 51 | - [ ] symptom ---> disease 里面查询(按匹配程度排序) 52 | - [ ] 点击disease,prescript变化 53 | - [ ] 点击药方,药变化 54 | - [ ] 点 录入 药方下移 55 | - [ ] 修改 药克 数以及用法,可删除,添加 56 | ### Front类 57 | 58 | - [x] set_table函数应该只显示一列 59 | - [ ] 添加成功后最好可以弹框提示 60 | - [ ] 完善相关功能 61 | 62 | ### Back类 63 | 64 | - [ ] 完善相关功能 65 | - [ ] 病名命中次数排序/ 66 | 67 | ### 数据库 68 | 69 | - [ ] 修改medicine表结构,添加属性 70 | - [ ] 新建药方表 71 | 72 | ### information 界面 73 | - [ ] 添加过程可能有bug 74 | - [ ] 主诉,点击option出现bug 75 | - [ ] 查询功能没有测试 76 | - [ ] 界面,6个框 77 | 78 | ------ 79 | 80 | Collaborators: [Alanlinzy](https://github.com/alanlinzy), [Brahamack](https://github.com/brahamack), [Defjia](https://github.com/DefJia) 81 | -------------------------------------------------------------------------------- /UI/MessageBox.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Sun Oct 7 15:04:54 2018 4 | @author: yang 5 | """ 6 | from PyQt5 import QtWidgets 7 | from PyQt5.QtWidgets import QMessageBox, QApplication 8 | from PyQt5 import QtCore, QtGui, QtWidgets 9 | import sys 10 | 11 | 12 | class MessageBox(QtWidgets.QWidget): 13 | def __init__(self,content,question): 14 | super().__init__() 15 | self.title = "message" 16 | self.left = 570 17 | self.top = 290 18 | self.width = 320 19 | self.height = 200 20 | self.content = content 21 | self.question = question 22 | self.status = self.initUI() 23 | 24 | def initUI(self): 25 | self.setWindowTitle(self.title) 26 | self.setGeometry(self.left, self.top, self.width, self.height) 27 | self.buttonReply = QMessageBox.question(self, self.content, self.question, QMessageBox.Yes | QMessageBox.No, QMessageBox.No) 28 | if self.buttonReply == QtWidgets.QMessageBox.Yes: 29 | print('Yes clicked.') 30 | return 1 31 | else: 32 | print('No clicked.') 33 | return 0 34 | 35 | 36 | if __name__ == "__main__": 37 | app = QApplication(sys.argv) 38 | main_window = MessageBox("你好吗","还行") 39 | main_window.show() 40 | sys.exit(app.exec_()) 41 | -------------------------------------------------------------------------------- /UI/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DefJia/TCM-Retrieval-System/f6921011026c954a2d775a124d1971a63de1074a/UI/__init__.py -------------------------------------------------------------------------------- /UI/final.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'final.ui' 4 | # 5 | # Created by: PyQt5 UI code generator 5.11.2 6 | # 7 | # WARNING! All changes made in this file will be lost! 8 | 9 | from PyQt5 import QtCore, QtGui, QtWidgets 10 | 11 | class Ui_final_2(object): 12 | def setupUi(self, final_2): 13 | final_2.setObjectName("final_2") 14 | final_2.resize(477, 267) 15 | self.centralwidget = QtWidgets.QWidget(final_2) 16 | self.centralwidget.setObjectName("centralwidget") 17 | self.gridLayout = QtWidgets.QGridLayout(self.centralwidget) 18 | self.gridLayout.setObjectName("gridLayout") 19 | self.label = QtWidgets.QLabel(self.centralwidget) 20 | font = QtGui.QFont() 21 | font.setFamily("Academy Engraved LET") 22 | font.setPointSize(28) 23 | self.label.setFont(font) 24 | self.label.setObjectName("label") 25 | self.gridLayout.addWidget(self.label, 0, 0, 1, 2) 26 | self.label_2 = QtWidgets.QLabel(self.centralwidget) 27 | font = QtGui.QFont() 28 | font.setFamily("Academy Engraved LET") 29 | font.setPointSize(28) 30 | self.label_2.setFont(font) 31 | self.label_2.setObjectName("label_2") 32 | self.gridLayout.addWidget(self.label_2, 1, 0, 1, 2) 33 | self.buttonContinue = QtWidgets.QPushButton(self.centralwidget) 34 | font = QtGui.QFont() 35 | font.setFamily("Academy Engraved LET") 36 | font.setPointSize(20) 37 | self.buttonContinue.setFont(font) 38 | self.buttonContinue.setObjectName("buttonContinue") 39 | self.gridLayout.addWidget(self.buttonContinue, 2, 0, 1, 1) 40 | self.buttonOut = QtWidgets.QPushButton(self.centralwidget) 41 | font = QtGui.QFont() 42 | font.setFamily("Academy Engraved LET") 43 | font.setPointSize(20) 44 | self.buttonOut.setFont(font) 45 | self.buttonOut.setObjectName("buttonOut") 46 | self.gridLayout.addWidget(self.buttonOut, 2, 1, 1, 1) 47 | final_2.setCentralWidget(self.centralwidget) 48 | self.menubar = QtWidgets.QMenuBar(final_2) 49 | self.menubar.setGeometry(QtCore.QRect(0, 0, 477, 25)) 50 | self.menubar.setObjectName("menubar") 51 | final_2.setMenuBar(self.menubar) 52 | self.statusbar = QtWidgets.QStatusBar(final_2) 53 | self.statusbar.setObjectName("statusbar") 54 | final_2.setStatusBar(self.statusbar) 55 | 56 | self.retranslateUi(final_2) 57 | QtCore.QMetaObject.connectSlotsByName(final_2) 58 | 59 | def retranslateUi(self, final_2): 60 | _translate = QtCore.QCoreApplication.translate 61 | final_2.setWindowTitle(_translate("final_2", "MainWindow")) 62 | self.label.setText(_translate("final_2", " 信息保存成功")) 63 | self.label_2.setText(_translate("final_2", " 是否需要继续开方?")) 64 | self.buttonContinue.setText(_translate("final_2", "继续开方")) 65 | self.buttonOut.setText(_translate("final_2", "退出系统")) 66 | 67 | -------------------------------------------------------------------------------- /UI/final.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | final_2 4 | 5 | 6 | 7 | 0 8 | 0 9 | 477 10 | 267 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Academy Engraved LET 23 | 28 24 | 25 | 26 | 27 | 信息保存成功 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | Academy Engraved LET 36 | 28 37 | 38 | 39 | 40 | 是否需要继续开方? 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | Academy Engraved LET 49 | 20 50 | 51 | 52 | 53 | 继续开方 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | Academy Engraved LET 62 | 20 63 | 64 | 65 | 66 | 退出系统 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 0 76 | 0 77 | 477 78 | 25 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /UI/information.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'information.ui' 4 | # 5 | # Created by: PyQt5 UI code generator 5.11.2 6 | # 7 | # WARNING! All changes made in this file will be lost! 8 | 9 | from PyQt5 import QtCore, QtGui, QtWidgets 10 | 11 | class Ui_Information(object): 12 | def setupUi(self, Information): 13 | Information.setObjectName("Information") 14 | Information.resize(960, 831) 15 | self.centralwidget = QtWidgets.QWidget(Information) 16 | self.centralwidget.setObjectName("centralwidget") 17 | self.gridLayout = QtWidgets.QGridLayout(self.centralwidget) 18 | self.gridLayout.setObjectName("gridLayout") 19 | self.IButtonGetinUI = QtWidgets.QPushButton(self.centralwidget) 20 | font = QtGui.QFont() 21 | font.setPointSize(20) 22 | self.IButtonGetinUI.setFont(font) 23 | self.IButtonGetinUI.setObjectName("IButtonGetinUI") 24 | self.gridLayout.addWidget(self.IButtonGetinUI, 6, 4, 1, 1) 25 | self.IButtonYes = QtWidgets.QPushButton(self.centralwidget) 26 | font = QtGui.QFont() 27 | font.setPointSize(20) 28 | self.IButtonYes.setFont(font) 29 | self.IButtonYes.setObjectName("IButtonYes") 30 | self.gridLayout.addWidget(self.IButtonYes, 6, 0, 1, 1) 31 | self.IButtonOut = QtWidgets.QPushButton(self.centralwidget) 32 | font = QtGui.QFont() 33 | font.setPointSize(20) 34 | self.IButtonOut.setFont(font) 35 | self.IButtonOut.setObjectName("IButtonOut") 36 | self.gridLayout.addWidget(self.IButtonOut, 6, 5, 1, 2) 37 | self.horizontalLayout_7 = QtWidgets.QHBoxLayout() 38 | self.horizontalLayout_7.setObjectName("horizontalLayout_7") 39 | self.label_14 = QtWidgets.QLabel(self.centralwidget) 40 | font = QtGui.QFont() 41 | font.setPointSize(20) 42 | self.label_14.setFont(font) 43 | self.label_14.setObjectName("label_14") 44 | self.horizontalLayout_7.addWidget(self.label_14) 45 | self.lineSymptom = QtWidgets.QLineEdit(self.centralwidget) 46 | font = QtGui.QFont() 47 | font.setPointSize(20) 48 | self.lineSymptom.setFont(font) 49 | self.lineSymptom.setObjectName("lineSymptom") 50 | self.horizontalLayout_7.addWidget(self.lineSymptom) 51 | self.gridLayout.addLayout(self.horizontalLayout_7, 3, 0, 1, 1) 52 | self.horizontalLayout_3 = QtWidgets.QHBoxLayout() 53 | self.horizontalLayout_3.setObjectName("horizontalLayout_3") 54 | self.label_13 = QtWidgets.QLabel(self.centralwidget) 55 | font = QtGui.QFont() 56 | font.setPointSize(20) 57 | self.label_13.setFont(font) 58 | self.label_13.setObjectName("label_13") 59 | self.horizontalLayout_3.addWidget(self.label_13) 60 | self.lineIdentitynum = QtWidgets.QLineEdit(self.centralwidget) 61 | font = QtGui.QFont() 62 | font.setPointSize(20) 63 | self.lineIdentitynum.setFont(font) 64 | self.lineIdentitynum.setObjectName("lineIdentitynum") 65 | self.horizontalLayout_3.addWidget(self.lineIdentitynum) 66 | self.gridLayout.addLayout(self.horizontalLayout_3, 2, 0, 1, 3) 67 | self.tablewidgetMainSymptom = QtWidgets.QTableWidget(self.centralwidget) 68 | self.tablewidgetMainSymptom.setObjectName("tablewidgetMainSymptom") 69 | self.tablewidgetMainSymptom.setColumnCount(0) 70 | self.tablewidgetMainSymptom.setRowCount(0) 71 | self.tablewidgetMainSymptom.horizontalHeader().setVisible(False) 72 | self.tablewidgetMainSymptom.verticalHeader().setVisible(False) 73 | self.gridLayout.addWidget(self.tablewidgetMainSymptom, 4, 0, 1, 3) 74 | self.IButtonInquire = QtWidgets.QPushButton(self.centralwidget) 75 | font = QtGui.QFont() 76 | font.setPointSize(20) 77 | self.IButtonInquire.setFont(font) 78 | self.IButtonInquire.setObjectName("IButtonInquire") 79 | self.gridLayout.addWidget(self.IButtonInquire, 6, 2, 1, 1) 80 | self.horizontalLayout_2 = QtWidgets.QHBoxLayout() 81 | self.horizontalLayout_2.setObjectName("horizontalLayout_2") 82 | self.label_11 = QtWidgets.QLabel(self.centralwidget) 83 | font = QtGui.QFont() 84 | font.setPointSize(20) 85 | self.label_11.setFont(font) 86 | self.label_11.setObjectName("label_11") 87 | self.horizontalLayout_2.addWidget(self.label_11) 88 | self.linePhone = QtWidgets.QLineEdit(self.centralwidget) 89 | font = QtGui.QFont() 90 | font.setPointSize(20) 91 | self.linePhone.setFont(font) 92 | self.linePhone.setObjectName("linePhone") 93 | self.horizontalLayout_2.addWidget(self.linePhone) 94 | self.gridLayout.addLayout(self.horizontalLayout_2, 1, 0, 1, 1) 95 | self.formLayout = QtWidgets.QFormLayout() 96 | self.formLayout.setObjectName("formLayout") 97 | self.label_8 = QtWidgets.QLabel(self.centralwidget) 98 | font = QtGui.QFont() 99 | font.setPointSize(20) 100 | self.label_8.setFont(font) 101 | self.label_8.setObjectName("label_8") 102 | self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_8) 103 | self.lineLook = QtWidgets.QLineEdit(self.centralwidget) 104 | font = QtGui.QFont() 105 | font.setPointSize(20) 106 | self.lineLook.setFont(font) 107 | self.lineLook.setObjectName("lineLook") 108 | self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.lineLook) 109 | self.label_15 = QtWidgets.QLabel(self.centralwidget) 110 | font = QtGui.QFont() 111 | font.setPointSize(20) 112 | self.label_15.setFont(font) 113 | self.label_15.setObjectName("label_15") 114 | self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_15) 115 | self.lineListen = QtWidgets.QLineEdit(self.centralwidget) 116 | font = QtGui.QFont() 117 | font.setPointSize(20) 118 | self.lineListen.setFont(font) 119 | self.lineListen.setObjectName("lineListen") 120 | self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.lineListen) 121 | self.label_16 = QtWidgets.QLabel(self.centralwidget) 122 | font = QtGui.QFont() 123 | font.setPointSize(20) 124 | self.label_16.setFont(font) 125 | self.label_16.setObjectName("label_16") 126 | self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.label_16) 127 | self.lineQuestion = QtWidgets.QLineEdit(self.centralwidget) 128 | font = QtGui.QFont() 129 | font.setPointSize(20) 130 | self.lineQuestion.setFont(font) 131 | self.lineQuestion.setObjectName("lineQuestion") 132 | self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.lineQuestion) 133 | self.label_17 = QtWidgets.QLabel(self.centralwidget) 134 | font = QtGui.QFont() 135 | font.setPointSize(20) 136 | self.label_17.setFont(font) 137 | self.label_17.setObjectName("label_17") 138 | self.formLayout.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.label_17) 139 | self.lineFeel = QtWidgets.QLineEdit(self.centralwidget) 140 | font = QtGui.QFont() 141 | font.setPointSize(20) 142 | self.lineFeel.setFont(font) 143 | self.lineFeel.setObjectName("lineFeel") 144 | self.formLayout.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.lineFeel) 145 | self.label_18 = QtWidgets.QLabel(self.centralwidget) 146 | font = QtGui.QFont() 147 | font.setPointSize(20) 148 | self.label_18.setFont(font) 149 | self.label_18.setObjectName("label_18") 150 | self.formLayout.setWidget(4, QtWidgets.QFormLayout.LabelRole, self.label_18) 151 | self.lineMenstruation = QtWidgets.QLineEdit(self.centralwidget) 152 | font = QtGui.QFont() 153 | font.setPointSize(20) 154 | self.lineMenstruation.setFont(font) 155 | self.lineMenstruation.setObjectName("lineMenstruation") 156 | self.formLayout.setWidget(4, QtWidgets.QFormLayout.FieldRole, self.lineMenstruation) 157 | self.label_19 = QtWidgets.QLabel(self.centralwidget) 158 | font = QtGui.QFont() 159 | font.setPointSize(20) 160 | self.label_19.setFont(font) 161 | self.label_19.setObjectName("label_19") 162 | self.formLayout.setWidget(5, QtWidgets.QFormLayout.LabelRole, self.label_19) 163 | self.lineLeucorrhoea = QtWidgets.QLineEdit(self.centralwidget) 164 | font = QtGui.QFont() 165 | font.setPointSize(20) 166 | self.lineLeucorrhoea.setFont(font) 167 | self.lineLeucorrhoea.setObjectName("lineLeucorrhoea") 168 | self.formLayout.setWidget(5, QtWidgets.QFormLayout.FieldRole, self.lineLeucorrhoea) 169 | self.gridLayout.addLayout(self.formLayout, 5, 0, 1, 7) 170 | self.horizontalLayout = QtWidgets.QHBoxLayout() 171 | self.horizontalLayout.setObjectName("horizontalLayout") 172 | self.label = QtWidgets.QLabel(self.centralwidget) 173 | font = QtGui.QFont() 174 | font.setPointSize(20) 175 | self.label.setFont(font) 176 | self.label.setObjectName("label") 177 | self.horizontalLayout.addWidget(self.label) 178 | self.lineName = QtWidgets.QLineEdit(self.centralwidget) 179 | font = QtGui.QFont() 180 | font.setPointSize(20) 181 | self.lineName.setFont(font) 182 | self.lineName.setObjectName("lineName") 183 | self.horizontalLayout.addWidget(self.lineName) 184 | self.gridLayout.addLayout(self.horizontalLayout, 0, 0, 1, 1) 185 | self.horizontalLayout_6 = QtWidgets.QHBoxLayout() 186 | self.horizontalLayout_6.setObjectName("horizontalLayout_6") 187 | self.label_10 = QtWidgets.QLabel(self.centralwidget) 188 | font = QtGui.QFont() 189 | font.setPointSize(20) 190 | self.label_10.setFont(font) 191 | self.label_10.setObjectName("label_10") 192 | self.horizontalLayout_6.addWidget(self.label_10) 193 | self.lineAge = QtWidgets.QLineEdit(self.centralwidget) 194 | font = QtGui.QFont() 195 | font.setPointSize(20) 196 | self.lineAge.setFont(font) 197 | self.lineAge.setObjectName("lineAge") 198 | self.horizontalLayout_6.addWidget(self.lineAge) 199 | self.gridLayout.addLayout(self.horizontalLayout_6, 2, 4, 1, 3) 200 | self.horizontalLayout_5 = QtWidgets.QHBoxLayout() 201 | self.horizontalLayout_5.setObjectName("horizontalLayout_5") 202 | self.label_12 = QtWidgets.QLabel(self.centralwidget) 203 | font = QtGui.QFont() 204 | font.setPointSize(20) 205 | self.label_12.setFont(font) 206 | self.label_12.setObjectName("label_12") 207 | self.horizontalLayout_5.addWidget(self.label_12) 208 | self.lineAddress = QtWidgets.QLineEdit(self.centralwidget) 209 | font = QtGui.QFont() 210 | font.setPointSize(20) 211 | self.lineAddress.setFont(font) 212 | self.lineAddress.setObjectName("lineAddress") 213 | self.horizontalLayout_5.addWidget(self.lineAddress) 214 | self.gridLayout.addLayout(self.horizontalLayout_5, 1, 4, 1, 3) 215 | self.DBOutput = QtWidgets.QPushButton(self.centralwidget) 216 | font = QtGui.QFont() 217 | font.setPointSize(18) 218 | self.DBOutput.setFont(font) 219 | self.DBOutput.setObjectName("DBOutput") 220 | self.gridLayout.addWidget(self.DBOutput, 7, 2, 1, 1) 221 | self.horizontalLayout_4 = QtWidgets.QHBoxLayout() 222 | self.horizontalLayout_4.setObjectName("horizontalLayout_4") 223 | self.label_9 = QtWidgets.QLabel(self.centralwidget) 224 | font = QtGui.QFont() 225 | font.setPointSize(20) 226 | self.label_9.setFont(font) 227 | self.label_9.setObjectName("label_9") 228 | self.horizontalLayout_4.addWidget(self.label_9) 229 | self.boxGender = QtWidgets.QComboBox(self.centralwidget) 230 | font = QtGui.QFont() 231 | font.setPointSize(20) 232 | self.boxGender.setFont(font) 233 | self.boxGender.setObjectName("boxGender") 234 | self.boxGender.addItem("") 235 | self.boxGender.addItem("") 236 | self.horizontalLayout_4.addWidget(self.boxGender) 237 | self.label_2 = QtWidgets.QLabel(self.centralwidget) 238 | self.label_2.setObjectName("label_2") 239 | self.horizontalLayout_4.addWidget(self.label_2) 240 | self.gridLayout.addLayout(self.horizontalLayout_4, 0, 4, 1, 3) 241 | self.DBInput = QtWidgets.QPushButton(self.centralwidget) 242 | font = QtGui.QFont() 243 | font.setPointSize(18) 244 | self.DBInput.setFont(font) 245 | self.DBInput.setObjectName("DBInput") 246 | self.gridLayout.addWidget(self.DBInput, 7, 4, 1, 1) 247 | self.option = QtWidgets.QTableWidget(self.centralwidget) 248 | self.option.setGeometry(QtCore.QRect(10, 210, 256, 171)) 249 | palette = QtGui.QPalette() 250 | brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) 251 | brush.setStyle(QtCore.Qt.SolidPattern) 252 | palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) 253 | brush = QtGui.QBrush(QtGui.QColor(170, 255, 127)) 254 | brush.setStyle(QtCore.Qt.SolidPattern) 255 | palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) 256 | brush = QtGui.QBrush(QtGui.QColor(84, 238, 255)) 257 | brush.setStyle(QtCore.Qt.SolidPattern) 258 | palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Light, brush) 259 | brush = QtGui.QBrush(QtGui.QColor(212, 255, 191)) 260 | brush.setStyle(QtCore.Qt.SolidPattern) 261 | palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Midlight, brush) 262 | brush = QtGui.QBrush(QtGui.QColor(85, 127, 63)) 263 | brush.setStyle(QtCore.Qt.SolidPattern) 264 | palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Dark, brush) 265 | brush = QtGui.QBrush(QtGui.QColor(113, 170, 84)) 266 | brush.setStyle(QtCore.Qt.SolidPattern) 267 | palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Mid, brush) 268 | brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) 269 | brush.setStyle(QtCore.Qt.SolidPattern) 270 | palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) 271 | brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) 272 | brush.setStyle(QtCore.Qt.SolidPattern) 273 | palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.BrightText, brush) 274 | brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) 275 | brush.setStyle(QtCore.Qt.SolidPattern) 276 | palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) 277 | brush = QtGui.QBrush(QtGui.QColor(206, 255, 185)) 278 | brush.setStyle(QtCore.Qt.SolidPattern) 279 | palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) 280 | brush = QtGui.QBrush(QtGui.QColor(170, 255, 127)) 281 | brush.setStyle(QtCore.Qt.SolidPattern) 282 | palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) 283 | brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) 284 | brush.setStyle(QtCore.Qt.SolidPattern) 285 | palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Shadow, brush) 286 | brush = QtGui.QBrush(QtGui.QColor(212, 255, 191)) 287 | brush.setStyle(QtCore.Qt.SolidPattern) 288 | palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.AlternateBase, brush) 289 | brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) 290 | brush.setStyle(QtCore.Qt.SolidPattern) 291 | palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipBase, brush) 292 | brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) 293 | brush.setStyle(QtCore.Qt.SolidPattern) 294 | palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipText, brush) 295 | brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) 296 | brush.setStyle(QtCore.Qt.SolidPattern) 297 | palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) 298 | brush = QtGui.QBrush(QtGui.QColor(170, 255, 127)) 299 | brush.setStyle(QtCore.Qt.SolidPattern) 300 | palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) 301 | brush = QtGui.QBrush(QtGui.QColor(84, 238, 255)) 302 | brush.setStyle(QtCore.Qt.SolidPattern) 303 | palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Light, brush) 304 | brush = QtGui.QBrush(QtGui.QColor(212, 255, 191)) 305 | brush.setStyle(QtCore.Qt.SolidPattern) 306 | palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Midlight, brush) 307 | brush = QtGui.QBrush(QtGui.QColor(85, 127, 63)) 308 | brush.setStyle(QtCore.Qt.SolidPattern) 309 | palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Dark, brush) 310 | brush = QtGui.QBrush(QtGui.QColor(113, 170, 84)) 311 | brush.setStyle(QtCore.Qt.SolidPattern) 312 | palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Mid, brush) 313 | brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) 314 | brush.setStyle(QtCore.Qt.SolidPattern) 315 | palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) 316 | brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) 317 | brush.setStyle(QtCore.Qt.SolidPattern) 318 | palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.BrightText, brush) 319 | brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) 320 | brush.setStyle(QtCore.Qt.SolidPattern) 321 | palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) 322 | brush = QtGui.QBrush(QtGui.QColor(206, 255, 185)) 323 | brush.setStyle(QtCore.Qt.SolidPattern) 324 | palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) 325 | brush = QtGui.QBrush(QtGui.QColor(170, 255, 127)) 326 | brush.setStyle(QtCore.Qt.SolidPattern) 327 | palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) 328 | brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) 329 | brush.setStyle(QtCore.Qt.SolidPattern) 330 | palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Shadow, brush) 331 | brush = QtGui.QBrush(QtGui.QColor(212, 255, 191)) 332 | brush.setStyle(QtCore.Qt.SolidPattern) 333 | palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.AlternateBase, brush) 334 | brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) 335 | brush.setStyle(QtCore.Qt.SolidPattern) 336 | palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipBase, brush) 337 | brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) 338 | brush.setStyle(QtCore.Qt.SolidPattern) 339 | palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipText, brush) 340 | brush = QtGui.QBrush(QtGui.QColor(85, 127, 63)) 341 | brush.setStyle(QtCore.Qt.SolidPattern) 342 | palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) 343 | brush = QtGui.QBrush(QtGui.QColor(170, 255, 127)) 344 | brush.setStyle(QtCore.Qt.SolidPattern) 345 | palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) 346 | brush = QtGui.QBrush(QtGui.QColor(84, 238, 255)) 347 | brush.setStyle(QtCore.Qt.SolidPattern) 348 | palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Light, brush) 349 | brush = QtGui.QBrush(QtGui.QColor(212, 255, 191)) 350 | brush.setStyle(QtCore.Qt.SolidPattern) 351 | palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Midlight, brush) 352 | brush = QtGui.QBrush(QtGui.QColor(85, 127, 63)) 353 | brush.setStyle(QtCore.Qt.SolidPattern) 354 | palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Dark, brush) 355 | brush = QtGui.QBrush(QtGui.QColor(113, 170, 84)) 356 | brush.setStyle(QtCore.Qt.SolidPattern) 357 | palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Mid, brush) 358 | brush = QtGui.QBrush(QtGui.QColor(85, 127, 63)) 359 | brush.setStyle(QtCore.Qt.SolidPattern) 360 | palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) 361 | brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) 362 | brush.setStyle(QtCore.Qt.SolidPattern) 363 | palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.BrightText, brush) 364 | brush = QtGui.QBrush(QtGui.QColor(85, 127, 63)) 365 | brush.setStyle(QtCore.Qt.SolidPattern) 366 | palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) 367 | brush = QtGui.QBrush(QtGui.QColor(170, 255, 127)) 368 | brush.setStyle(QtCore.Qt.SolidPattern) 369 | palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) 370 | brush = QtGui.QBrush(QtGui.QColor(170, 255, 127)) 371 | brush.setStyle(QtCore.Qt.SolidPattern) 372 | palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) 373 | brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) 374 | brush.setStyle(QtCore.Qt.SolidPattern) 375 | palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Shadow, brush) 376 | brush = QtGui.QBrush(QtGui.QColor(170, 255, 127)) 377 | brush.setStyle(QtCore.Qt.SolidPattern) 378 | palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.AlternateBase, brush) 379 | brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) 380 | brush.setStyle(QtCore.Qt.SolidPattern) 381 | palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipBase, brush) 382 | brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) 383 | brush.setStyle(QtCore.Qt.SolidPattern) 384 | palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipText, brush) 385 | self.option.setPalette(palette) 386 | self.option.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) 387 | self.option.setObjectName("option") 388 | self.option.setColumnCount(0) 389 | self.option.setRowCount(0) 390 | self.option.horizontalHeader().setVisible(False) 391 | self.option.verticalHeader().setVisible(False) 392 | self.IButtonOut.raise_() 393 | self.tablewidgetMainSymptom.raise_() 394 | self.IButtonYes.raise_() 395 | self.IButtonInquire.raise_() 396 | self.IButtonGetinUI.raise_() 397 | self.DBOutput.raise_() 398 | self.DBInput.raise_() 399 | Information.setCentralWidget(self.centralwidget) 400 | self.menubar = QtWidgets.QMenuBar(Information) 401 | self.menubar.setGeometry(QtCore.QRect(0, 0, 960, 25)) 402 | self.menubar.setObjectName("menubar") 403 | Information.setMenuBar(self.menubar) 404 | self.statusbar = QtWidgets.QStatusBar(Information) 405 | self.statusbar.setObjectName("statusbar") 406 | Information.setStatusBar(self.statusbar) 407 | 408 | self.retranslateUi(Information) 409 | QtCore.QMetaObject.connectSlotsByName(Information) 410 | 411 | def retranslateUi(self, Information): 412 | _translate = QtCore.QCoreApplication.translate 413 | Information.setWindowTitle(_translate("Information", "病人信息录入")) 414 | self.IButtonGetinUI.setText(_translate("Information", " 开方界面 ")) 415 | self.IButtonYes.setText(_translate("Information", "确定")) 416 | self.IButtonOut.setText(_translate("Information", " 退出 ")) 417 | self.label_14.setText(_translate("Information", "主诉")) 418 | self.label_13.setText(_translate("Information", "身份证")) 419 | self.IButtonInquire.setText(_translate("Information", " 查询 ")) 420 | self.label_11.setText(_translate("Information", "手机")) 421 | self.label_8.setText(_translate("Information", "望")) 422 | self.label_15.setText(_translate("Information", "闻")) 423 | self.label_16.setText(_translate("Information", "问")) 424 | self.label_17.setText(_translate("Information", "切")) 425 | self.label_18.setText(_translate("Information", "经")) 426 | self.label_19.setText(_translate("Information", "带")) 427 | self.label.setText(_translate("Information", "名字")) 428 | self.label_10.setText(_translate("Information", "年龄")) 429 | self.label_12.setText(_translate("Information", "住址")) 430 | self.DBOutput.setText(_translate("Information", "数据库导出")) 431 | self.label_9.setText(_translate("Information", "性别")) 432 | self.boxGender.setItemText(0, _translate("Information", "男")) 433 | self.boxGender.setItemText(1, _translate("Information", "女")) 434 | self.label_2.setText(_translate("Information", " ")) 435 | self.DBInput.setText(_translate("Information", "数据库导入")) 436 | 437 | -------------------------------------------------------------------------------- /UI/information.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Information 4 | 5 | 6 | 7 | 0 8 | 0 9 | 960 10 | 831 11 | 12 | 13 | 14 | 病人信息录入 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 20 23 | 24 | 25 | 26 | 开方界面 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 20 35 | 36 | 37 | 38 | 确定 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 20 47 | 48 | 49 | 50 | 退出 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 20 61 | 62 | 63 | 64 | 主诉 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 20 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 20 86 | 87 | 88 | 89 | 身份证 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 20 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | false 108 | 109 | 110 | false 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 20 119 | 120 | 121 | 122 | 查询 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 20 133 | 134 | 135 | 136 | 手机 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 20 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 20 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 20 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 20 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 20 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 20 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 20 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 20 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 20 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 20 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 20 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 20 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 20 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 20 288 | 289 | 290 | 291 | 名字 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 20 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 20 313 | 314 | 315 | 316 | 年龄 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 20 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 20 338 | 339 | 340 | 341 | 住址 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 20 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 18 361 | 362 | 363 | 364 | 数据库导出 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 20 375 | 376 | 377 | 378 | 性别 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 20 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 18 415 | 416 | 417 | 418 | 数据库导入 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 10 427 | 210 428 | 256 429 | 171 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 0 439 | 0 440 | 0 441 | 442 | 443 | 444 | 445 | 446 | 447 | 170 448 | 255 449 | 127 450 | 451 | 452 | 453 | 454 | 455 | 456 | 84 457 | 238 458 | 255 459 | 460 | 461 | 462 | 463 | 464 | 465 | 212 466 | 255 467 | 191 468 | 469 | 470 | 471 | 472 | 473 | 474 | 85 475 | 127 476 | 63 477 | 478 | 479 | 480 | 481 | 482 | 483 | 113 484 | 170 485 | 84 486 | 487 | 488 | 489 | 490 | 491 | 492 | 0 493 | 0 494 | 0 495 | 496 | 497 | 498 | 499 | 500 | 501 | 255 502 | 255 503 | 255 504 | 505 | 506 | 507 | 508 | 509 | 510 | 0 511 | 0 512 | 0 513 | 514 | 515 | 516 | 517 | 518 | 519 | 206 520 | 255 521 | 185 522 | 523 | 524 | 525 | 526 | 527 | 528 | 170 529 | 255 530 | 127 531 | 532 | 533 | 534 | 535 | 536 | 537 | 0 538 | 0 539 | 0 540 | 541 | 542 | 543 | 544 | 545 | 546 | 212 547 | 255 548 | 191 549 | 550 | 551 | 552 | 553 | 554 | 555 | 255 556 | 255 557 | 220 558 | 559 | 560 | 561 | 562 | 563 | 564 | 0 565 | 0 566 | 0 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 0 576 | 0 577 | 0 578 | 579 | 580 | 581 | 582 | 583 | 584 | 170 585 | 255 586 | 127 587 | 588 | 589 | 590 | 591 | 592 | 593 | 84 594 | 238 595 | 255 596 | 597 | 598 | 599 | 600 | 601 | 602 | 212 603 | 255 604 | 191 605 | 606 | 607 | 608 | 609 | 610 | 611 | 85 612 | 127 613 | 63 614 | 615 | 616 | 617 | 618 | 619 | 620 | 113 621 | 170 622 | 84 623 | 624 | 625 | 626 | 627 | 628 | 629 | 0 630 | 0 631 | 0 632 | 633 | 634 | 635 | 636 | 637 | 638 | 255 639 | 255 640 | 255 641 | 642 | 643 | 644 | 645 | 646 | 647 | 0 648 | 0 649 | 0 650 | 651 | 652 | 653 | 654 | 655 | 656 | 206 657 | 255 658 | 185 659 | 660 | 661 | 662 | 663 | 664 | 665 | 170 666 | 255 667 | 127 668 | 669 | 670 | 671 | 672 | 673 | 674 | 0 675 | 0 676 | 0 677 | 678 | 679 | 680 | 681 | 682 | 683 | 212 684 | 255 685 | 191 686 | 687 | 688 | 689 | 690 | 691 | 692 | 255 693 | 255 694 | 220 695 | 696 | 697 | 698 | 699 | 700 | 701 | 0 702 | 0 703 | 0 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 85 713 | 127 714 | 63 715 | 716 | 717 | 718 | 719 | 720 | 721 | 170 722 | 255 723 | 127 724 | 725 | 726 | 727 | 728 | 729 | 730 | 84 731 | 238 732 | 255 733 | 734 | 735 | 736 | 737 | 738 | 739 | 212 740 | 255 741 | 191 742 | 743 | 744 | 745 | 746 | 747 | 748 | 85 749 | 127 750 | 63 751 | 752 | 753 | 754 | 755 | 756 | 757 | 113 758 | 170 759 | 84 760 | 761 | 762 | 763 | 764 | 765 | 766 | 85 767 | 127 768 | 63 769 | 770 | 771 | 772 | 773 | 774 | 775 | 255 776 | 255 777 | 255 778 | 779 | 780 | 781 | 782 | 783 | 784 | 85 785 | 127 786 | 63 787 | 788 | 789 | 790 | 791 | 792 | 793 | 170 794 | 255 795 | 127 796 | 797 | 798 | 799 | 800 | 801 | 802 | 170 803 | 255 804 | 127 805 | 806 | 807 | 808 | 809 | 810 | 811 | 0 812 | 0 813 | 0 814 | 815 | 816 | 817 | 818 | 819 | 820 | 170 821 | 255 822 | 127 823 | 824 | 825 | 826 | 827 | 828 | 829 | 255 830 | 255 831 | 220 832 | 833 | 834 | 835 | 836 | 837 | 838 | 0 839 | 0 840 | 0 841 | 842 | 843 | 844 | 845 | 846 | 847 | 848 | QAbstractItemView::NoEditTriggers 849 | 850 | 851 | false 852 | 853 | 854 | false 855 | 856 | 857 | IButtonOut 858 | tablewidgetMainSymptom 859 | IButtonYes 860 | IButtonInquire 861 | IButtonGetinUI 862 | DBOutput 863 | DBInput 864 | 865 | 866 | 867 | 868 | 0 869 | 0 870 | 960 871 | 25 872 | 873 | 874 | 875 | 876 | 877 | 878 | 879 | 880 | -------------------------------------------------------------------------------- /UI/inquire.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'inquire.ui' 4 | # 5 | # Created by: PyQt5 UI code generator 5.11.2 6 | # 7 | # WARNING! All changes made in this file will be lost! 8 | 9 | from PyQt5 import QtCore, QtGui, QtWidgets 10 | 11 | class Ui_Inquire(object): 12 | def setupUi(self, Inquire): 13 | Inquire.setObjectName("Inquire") 14 | Inquire.resize(700, 539) 15 | self.centralwidget = QtWidgets.QWidget(Inquire) 16 | self.centralwidget.setObjectName("centralwidget") 17 | self.gridLayout = QtWidgets.QGridLayout(self.centralwidget) 18 | self.gridLayout.setObjectName("gridLayout") 19 | self.tableWidget = QtWidgets.QTableWidget(self.centralwidget) 20 | self.tableWidget.setEnabled(True) 21 | self.tableWidget.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) 22 | self.tableWidget.setDragEnabled(False) 23 | self.tableWidget.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows) 24 | self.tableWidget.setObjectName("tableWidget") 25 | self.tableWidget.setColumnCount(6) 26 | self.tableWidget.setRowCount(6) 27 | item = QtWidgets.QTableWidgetItem() 28 | self.tableWidget.setVerticalHeaderItem(0, item) 29 | item = QtWidgets.QTableWidgetItem() 30 | self.tableWidget.setVerticalHeaderItem(1, item) 31 | item = QtWidgets.QTableWidgetItem() 32 | self.tableWidget.setVerticalHeaderItem(2, item) 33 | item = QtWidgets.QTableWidgetItem() 34 | self.tableWidget.setVerticalHeaderItem(3, item) 35 | item = QtWidgets.QTableWidgetItem() 36 | self.tableWidget.setVerticalHeaderItem(4, item) 37 | item = QtWidgets.QTableWidgetItem() 38 | self.tableWidget.setVerticalHeaderItem(5, item) 39 | item = QtWidgets.QTableWidgetItem() 40 | self.tableWidget.setHorizontalHeaderItem(0, item) 41 | item = QtWidgets.QTableWidgetItem() 42 | self.tableWidget.setHorizontalHeaderItem(1, item) 43 | item = QtWidgets.QTableWidgetItem() 44 | self.tableWidget.setHorizontalHeaderItem(2, item) 45 | item = QtWidgets.QTableWidgetItem() 46 | self.tableWidget.setHorizontalHeaderItem(3, item) 47 | item = QtWidgets.QTableWidgetItem() 48 | self.tableWidget.setHorizontalHeaderItem(4, item) 49 | item = QtWidgets.QTableWidgetItem() 50 | self.tableWidget.setHorizontalHeaderItem(5, item) 51 | self.tableWidget.horizontalHeader().setDefaultSectionSize(112) 52 | self.tableWidget.verticalHeader().setVisible(False) 53 | self.gridLayout.addWidget(self.tableWidget, 3, 0, 1, 3) 54 | self.ButtonOut = QtWidgets.QPushButton(self.centralwidget) 55 | font = QtGui.QFont() 56 | font.setPointSize(20) 57 | self.ButtonOut.setFont(font) 58 | self.ButtonOut.setObjectName("ButtonOut") 59 | self.gridLayout.addWidget(self.ButtonOut, 4, 2, 1, 1) 60 | self.horizontalLayout_6 = QtWidgets.QHBoxLayout() 61 | self.horizontalLayout_6.setObjectName("horizontalLayout_6") 62 | self.label_13 = QtWidgets.QLabel(self.centralwidget) 63 | font = QtGui.QFont() 64 | font.setPointSize(20) 65 | self.label_13.setFont(font) 66 | self.label_13.setObjectName("label_13") 67 | self.horizontalLayout_6.addWidget(self.label_13) 68 | self.lineIdcard = QtWidgets.QLineEdit(self.centralwidget) 69 | font = QtGui.QFont() 70 | font.setPointSize(20) 71 | self.lineIdcard.setFont(font) 72 | self.lineIdcard.setObjectName("lineIdcard") 73 | self.horizontalLayout_6.addWidget(self.lineIdcard) 74 | self.gridLayout.addLayout(self.horizontalLayout_6, 2, 0, 1, 2) 75 | self.horizontalLayout_4 = QtWidgets.QHBoxLayout() 76 | self.horizontalLayout_4.setObjectName("horizontalLayout_4") 77 | self.label_11 = QtWidgets.QLabel(self.centralwidget) 78 | font = QtGui.QFont() 79 | font.setPointSize(20) 80 | self.label_11.setFont(font) 81 | self.label_11.setObjectName("label_11") 82 | self.horizontalLayout_4.addWidget(self.label_11) 83 | self.linePhone = QtWidgets.QLineEdit(self.centralwidget) 84 | font = QtGui.QFont() 85 | font.setPointSize(20) 86 | self.linePhone.setFont(font) 87 | self.linePhone.setObjectName("linePhone") 88 | self.horizontalLayout_4.addWidget(self.linePhone) 89 | self.gridLayout.addLayout(self.horizontalLayout_4, 1, 2, 1, 1) 90 | self.horizontalLayout = QtWidgets.QHBoxLayout() 91 | self.horizontalLayout.setObjectName("horizontalLayout") 92 | self.label = QtWidgets.QLabel(self.centralwidget) 93 | font = QtGui.QFont() 94 | font.setPointSize(20) 95 | self.label.setFont(font) 96 | self.label.setObjectName("label") 97 | self.horizontalLayout.addWidget(self.label) 98 | self.lineName = QtWidgets.QLineEdit(self.centralwidget) 99 | font = QtGui.QFont() 100 | font.setPointSize(20) 101 | self.lineName.setFont(font) 102 | self.lineName.setObjectName("lineName") 103 | self.horizontalLayout.addWidget(self.lineName) 104 | self.gridLayout.addLayout(self.horizontalLayout, 1, 0, 1, 2) 105 | self.ButtonYes = QtWidgets.QPushButton(self.centralwidget) 106 | font = QtGui.QFont() 107 | font.setPointSize(20) 108 | self.ButtonYes.setFont(font) 109 | self.ButtonYes.setObjectName("ButtonYes") 110 | self.gridLayout.addWidget(self.ButtonYes, 4, 0, 1, 2) 111 | self.label_2 = QtWidgets.QLabel(self.centralwidget) 112 | font = QtGui.QFont() 113 | font.setPointSize(25) 114 | self.label_2.setFont(font) 115 | self.label_2.setObjectName("label_2") 116 | self.gridLayout.addWidget(self.label_2, 0, 1, 1, 2) 117 | Inquire.setCentralWidget(self.centralwidget) 118 | self.menubar = QtWidgets.QMenuBar(Inquire) 119 | self.menubar.setGeometry(QtCore.QRect(0, 0, 700, 25)) 120 | self.menubar.setObjectName("menubar") 121 | Inquire.setMenuBar(self.menubar) 122 | self.statusbar = QtWidgets.QStatusBar(Inquire) 123 | self.statusbar.setObjectName("statusbar") 124 | Inquire.setStatusBar(self.statusbar) 125 | 126 | self.retranslateUi(Inquire) 127 | QtCore.QMetaObject.connectSlotsByName(Inquire) 128 | 129 | def retranslateUi(self, Inquire): 130 | _translate = QtCore.QCoreApplication.translate 131 | Inquire.setWindowTitle(_translate("Inquire", "病人信息查询")) 132 | item = self.tableWidget.verticalHeaderItem(0) 133 | item.setText(_translate("Inquire", "New Row")) 134 | item = self.tableWidget.verticalHeaderItem(1) 135 | item.setText(_translate("Inquire", "New Row")) 136 | item = self.tableWidget.verticalHeaderItem(2) 137 | item.setText(_translate("Inquire", "New Row")) 138 | item = self.tableWidget.verticalHeaderItem(3) 139 | item.setText(_translate("Inquire", "New Row")) 140 | item = self.tableWidget.verticalHeaderItem(4) 141 | item.setText(_translate("Inquire", "New Row")) 142 | item = self.tableWidget.verticalHeaderItem(5) 143 | item.setText(_translate("Inquire", "New Row")) 144 | item = self.tableWidget.horizontalHeaderItem(0) 145 | item.setText(_translate("Inquire", "姓名")) 146 | item = self.tableWidget.horizontalHeaderItem(1) 147 | item.setText(_translate("Inquire", "性别")) 148 | item = self.tableWidget.horizontalHeaderItem(2) 149 | item.setText(_translate("Inquire", "年龄")) 150 | item = self.tableWidget.horizontalHeaderItem(3) 151 | item.setText(_translate("Inquire", "手机")) 152 | item = self.tableWidget.horizontalHeaderItem(4) 153 | item.setText(_translate("Inquire", "身份证")) 154 | item = self.tableWidget.horizontalHeaderItem(5) 155 | item.setText(_translate("Inquire", "地址")) 156 | self.ButtonOut.setText(_translate("Inquire", "退出")) 157 | self.label_13.setText(_translate("Inquire", "身份证")) 158 | self.label_11.setText(_translate("Inquire", "手机")) 159 | self.label.setText(_translate("Inquire", "名字")) 160 | self.ButtonYes.setText(_translate("Inquire", "确定")) 161 | self.label_2.setText(_translate("Inquire", " 检索条件")) 162 | 163 | -------------------------------------------------------------------------------- /UI/inquire.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Inquire 4 | 5 | 6 | 7 | 0 8 | 0 9 | 700 10 | 539 11 | 12 | 13 | 14 | 病人信息查询 15 | 16 | 17 | 18 | 19 | 20 | 21 | true 22 | 23 | 24 | QAbstractItemView::NoEditTriggers 25 | 26 | 27 | false 28 | 29 | 30 | QAbstractItemView::SelectRows 31 | 32 | 33 | 112 34 | 35 | 36 | false 37 | 38 | 39 | 40 | New Row 41 | 42 | 43 | 44 | 45 | New Row 46 | 47 | 48 | 49 | 50 | New Row 51 | 52 | 53 | 54 | 55 | New Row 56 | 57 | 58 | 59 | 60 | New Row 61 | 62 | 63 | 64 | 65 | New Row 66 | 67 | 68 | 69 | 70 | 姓名 71 | 72 | 73 | 74 | 75 | 性别 76 | 77 | 78 | 79 | 80 | 年龄 81 | 82 | 83 | 84 | 85 | 手机 86 | 87 | 88 | 89 | 90 | 身份证 91 | 92 | 93 | 94 | 95 | 地址 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 20 105 | 106 | 107 | 108 | 退出 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 20 119 | 120 | 121 | 122 | 身份证 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 20 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 20 144 | 145 | 146 | 147 | 手机 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 20 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 20 169 | 170 | 171 | 172 | 名字 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 20 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 20 192 | 193 | 194 | 195 | 确定 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 25 204 | 205 | 206 | 207 | 检索条件 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 0 217 | 0 218 | 700 219 | 25 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | -------------------------------------------------------------------------------- /UI/login.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'login.ui' 4 | # 5 | # Created by: PyQt5 UI code generator 5.11.2 6 | # 7 | # WARNING! All changes made in this file will be lost! 8 | 9 | from PyQt5 import QtCore, QtGui, QtWidgets 10 | 11 | class Ui_LogIn(object): 12 | def setupUi(self, LogIn): 13 | LogIn.setObjectName("LogIn") 14 | LogIn.resize(390, 263) 15 | self.centralwidget = QtWidgets.QWidget(LogIn) 16 | self.centralwidget.setObjectName("centralwidget") 17 | self.gridLayout = QtWidgets.QGridLayout(self.centralwidget) 18 | self.gridLayout.setObjectName("gridLayout") 19 | self.label = QtWidgets.QLabel(self.centralwidget) 20 | font = QtGui.QFont() 21 | font.setFamily("Academy Engraved LET") 22 | font.setPointSize(28) 23 | self.label.setFont(font) 24 | self.label.setObjectName("label") 25 | self.gridLayout.addWidget(self.label, 0, 0, 1, 1) 26 | self.lineUser = QtWidgets.QLineEdit(self.centralwidget) 27 | font = QtGui.QFont() 28 | font.setFamily("Academy Engraved LET") 29 | font.setPointSize(18) 30 | self.lineUser.setFont(font) 31 | self.lineUser.setObjectName("lineUser") 32 | self.gridLayout.addWidget(self.lineUser, 0, 1, 1, 2) 33 | self.label_2 = QtWidgets.QLabel(self.centralwidget) 34 | font = QtGui.QFont() 35 | font.setFamily("Academy Engraved LET") 36 | font.setPointSize(28) 37 | self.label_2.setFont(font) 38 | self.label_2.setObjectName("label_2") 39 | self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1) 40 | self.linePassword = QtWidgets.QLineEdit(self.centralwidget) 41 | font = QtGui.QFont() 42 | font.setFamily("Academy Engraved LET") 43 | font.setPointSize(18) 44 | self.linePassword.setFont(font) 45 | self.linePassword.setEchoMode(QtWidgets.QLineEdit.Password) 46 | self.linePassword.setObjectName("linePassword") 47 | self.gridLayout.addWidget(self.linePassword, 1, 1, 1, 2) 48 | self.noButton = QtWidgets.QPushButton(self.centralwidget) 49 | font = QtGui.QFont() 50 | font.setFamily("Academy Engraved LET") 51 | font.setPointSize(18) 52 | self.noButton.setFont(font) 53 | self.noButton.setObjectName("noButton") 54 | self.gridLayout.addWidget(self.noButton, 2, 2, 1, 1) 55 | self.yesButton = QtWidgets.QPushButton(self.centralwidget) 56 | font = QtGui.QFont() 57 | font.setFamily("Academy Engraved LET") 58 | font.setPointSize(18) 59 | self.yesButton.setFont(font) 60 | self.yesButton.setObjectName("yesButton") 61 | self.gridLayout.addWidget(self.yesButton, 2, 1, 1, 1) 62 | LogIn.setCentralWidget(self.centralwidget) 63 | self.menubar = QtWidgets.QMenuBar(LogIn) 64 | self.menubar.setGeometry(QtCore.QRect(0, 0, 390, 25)) 65 | self.menubar.setObjectName("menubar") 66 | LogIn.setMenuBar(self.menubar) 67 | self.statusbar = QtWidgets.QStatusBar(LogIn) 68 | self.statusbar.setObjectName("statusbar") 69 | LogIn.setStatusBar(self.statusbar) 70 | 71 | self.retranslateUi(LogIn) 72 | QtCore.QMetaObject.connectSlotsByName(LogIn) 73 | 74 | def retranslateUi(self, LogIn): 75 | _translate = QtCore.QCoreApplication.translate 76 | LogIn.setWindowTitle(_translate("LogIn", "登录界面")) 77 | self.label.setText(_translate("LogIn", "用户名")) 78 | self.label_2.setText(_translate("LogIn", "密码")) 79 | self.noButton.setText(_translate("LogIn", "取消")) 80 | self.noButton.setShortcut(_translate("LogIn", "Esc")) 81 | self.yesButton.setText(_translate("LogIn", "确定")) 82 | self.yesButton.setShortcut(_translate("LogIn", "Return")) 83 | 84 | -------------------------------------------------------------------------------- /UI/login.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | LogIn 4 | 5 | 6 | 7 | 0 8 | 0 9 | 390 10 | 263 11 | 12 | 13 | 14 | 登录界面 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Academy Engraved LET 23 | 28 24 | 25 | 26 | 27 | 用户名 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | Academy Engraved LET 36 | 18 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | Academy Engraved LET 46 | 28 47 | 48 | 49 | 50 | 密码 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | Academy Engraved LET 59 | 18 60 | 61 | 62 | 63 | QLineEdit::Password 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | Academy Engraved LET 72 | 18 73 | 74 | 75 | 76 | 取消 77 | 78 | 79 | Esc 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | Academy Engraved LET 88 | 18 89 | 90 | 91 | 92 | 确定 93 | 94 | 95 | Return, Enter 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 0 105 | 0 106 | 390 107 | 25 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /UI/logwrong.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'logwrong.ui' 4 | # 5 | # Created by: PyQt5 UI code generator 5.11.2 6 | # 7 | # WARNING! All changes made in this file will be lost! 8 | 9 | from PyQt5 import QtCore, QtGui, QtWidgets 10 | 11 | class Ui_LogWrong(object): 12 | def setupUi(self, LogWrong): 13 | LogWrong.setObjectName("LogWrong") 14 | LogWrong.resize(422, 238) 15 | self.centralwidget = QtWidgets.QWidget(LogWrong) 16 | self.centralwidget.setObjectName("centralwidget") 17 | self.gridLayout = QtWidgets.QGridLayout(self.centralwidget) 18 | self.gridLayout.setObjectName("gridLayout") 19 | self.label = QtWidgets.QLabel(self.centralwidget) 20 | font = QtGui.QFont() 21 | font.setFamily("Academy Engraved LET") 22 | font.setPointSize(28) 23 | self.label.setFont(font) 24 | self.label.setObjectName("label") 25 | self.gridLayout.addWidget(self.label, 0, 0, 1, 1) 26 | self.yesButton = QtWidgets.QPushButton(self.centralwidget) 27 | font = QtGui.QFont() 28 | font.setFamily("Academy Engraved LET") 29 | font.setPointSize(20) 30 | self.yesButton.setFont(font) 31 | self.yesButton.setObjectName("yesButton") 32 | self.gridLayout.addWidget(self.yesButton, 1, 0, 1, 1) 33 | LogWrong.setCentralWidget(self.centralwidget) 34 | self.menubar = QtWidgets.QMenuBar(LogWrong) 35 | self.menubar.setGeometry(QtCore.QRect(0, 0, 422, 25)) 36 | self.menubar.setObjectName("menubar") 37 | LogWrong.setMenuBar(self.menubar) 38 | self.statusbar = QtWidgets.QStatusBar(LogWrong) 39 | self.statusbar.setObjectName("statusbar") 40 | LogWrong.setStatusBar(self.statusbar) 41 | 42 | self.retranslateUi(LogWrong) 43 | QtCore.QMetaObject.connectSlotsByName(LogWrong) 44 | 45 | def retranslateUi(self, LogWrong): 46 | _translate = QtCore.QCoreApplication.translate 47 | LogWrong.setWindowTitle(_translate("LogWrong", "MainWindow")) 48 | self.label.setText(_translate("LogWrong", "账号或密码错误")) 49 | self.yesButton.setText(_translate("LogWrong", "确定")) 50 | 51 | -------------------------------------------------------------------------------- /UI/logwrong.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | LogWrong 4 | 5 | 6 | 7 | 0 8 | 0 9 | 422 10 | 238 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Academy Engraved LET 23 | 28 24 | 25 | 26 | 27 | 账号或密码错误 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | Academy Engraved LET 36 | 20 37 | 38 | 39 | 40 | 确定 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 0 50 | 0 51 | 422 52 | 25 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /UI/missPhone.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'missPhone.ui' 4 | # 5 | # Created by: PyQt5 UI code generator 5.11.2 6 | # 7 | # WARNING! All changes made in this file will be lost! 8 | 9 | from PyQt5 import QtCore, QtGui, QtWidgets 10 | 11 | class Ui_missPhone(object): 12 | def setupUi(self, missPhone): 13 | missPhone.setObjectName("missPhone") 14 | missPhone.resize(422, 273) 15 | self.centralwidget = QtWidgets.QWidget(missPhone) 16 | self.centralwidget.setObjectName("centralwidget") 17 | self.gridLayout = QtWidgets.QGridLayout(self.centralwidget) 18 | self.gridLayout.setObjectName("gridLayout") 19 | self.label_2 = QtWidgets.QLabel(self.centralwidget) 20 | font = QtGui.QFont() 21 | font.setFamily("Academy Engraved LET") 22 | font.setPointSize(28) 23 | self.label_2.setFont(font) 24 | self.label_2.setObjectName("label_2") 25 | self.gridLayout.addWidget(self.label_2, 2, 1, 1, 1) 26 | self.yesButton = QtWidgets.QPushButton(self.centralwidget) 27 | font = QtGui.QFont() 28 | font.setFamily("Academy Engraved LET") 29 | font.setPointSize(22) 30 | self.yesButton.setFont(font) 31 | self.yesButton.setObjectName("yesButton") 32 | self.gridLayout.addWidget(self.yesButton, 3, 1, 1, 1) 33 | self.label = QtWidgets.QLabel(self.centralwidget) 34 | font = QtGui.QFont() 35 | font.setFamily("Academy Engraved LET") 36 | font.setPointSize(28) 37 | self.label.setFont(font) 38 | self.label.setObjectName("label") 39 | self.gridLayout.addWidget(self.label, 1, 1, 1, 1) 40 | missPhone.setCentralWidget(self.centralwidget) 41 | self.menubar = QtWidgets.QMenuBar(missPhone) 42 | self.menubar.setGeometry(QtCore.QRect(0, 0, 422, 25)) 43 | self.menubar.setObjectName("menubar") 44 | missPhone.setMenuBar(self.menubar) 45 | self.statusbar = QtWidgets.QStatusBar(missPhone) 46 | self.statusbar.setObjectName("statusbar") 47 | missPhone.setStatusBar(self.statusbar) 48 | 49 | self.retranslateUi(missPhone) 50 | QtCore.QMetaObject.connectSlotsByName(missPhone) 51 | 52 | def retranslateUi(self, missPhone): 53 | _translate = QtCore.QCoreApplication.translate 54 | missPhone.setWindowTitle(_translate("missPhone", "MainWindow")) 55 | self.label_2.setText(_translate("missPhone", " 或身份证号")) 56 | self.yesButton.setText(_translate("missPhone", "确定")) 57 | self.yesButton.setShortcut(_translate("missPhone", "Return")) 58 | self.label.setText(_translate("missPhone", " 请输入手机号")) 59 | 60 | -------------------------------------------------------------------------------- /UI/missPhone.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | missPhone 4 | 5 | 6 | 7 | 0 8 | 0 9 | 422 10 | 273 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Academy Engraved LET 23 | 28 24 | 25 | 26 | 27 | 或身份证号 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | Academy Engraved LET 36 | 22 37 | 38 | 39 | 40 | 确定 41 | 42 | 43 | Return 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | Academy Engraved LET 52 | 28 53 | 54 | 55 | 56 | 请输入手机号 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 0 66 | 0 67 | 422 68 | 25 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /UI/property.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'property.ui' 4 | # 5 | # Created by: PyQt5 UI code generator 5.11.2 6 | # 7 | # WARNING! All changes made in this file will be lost! 8 | 9 | from PyQt5 import QtCore, QtGui, QtWidgets 10 | 11 | class Ui_Property(object): 12 | def setupUi(self, Property): 13 | Property.setObjectName("Property") 14 | Property.resize(393, 293) 15 | self.centralwidget = QtWidgets.QWidget(Property) 16 | self.centralwidget.setObjectName("centralwidget") 17 | self.label = QtWidgets.QLabel(self.centralwidget) 18 | self.label.setGeometry(QtCore.QRect(60, 0, 261, 81)) 19 | font = QtGui.QFont() 20 | font.setFamily("宋体") 21 | font.setPointSize(22) 22 | self.label.setFont(font) 23 | self.label.setObjectName("label") 24 | self.comboBox = QtWidgets.QComboBox(self.centralwidget) 25 | self.comboBox.setGeometry(QtCore.QRect(140, 80, 101, 51)) 26 | font = QtGui.QFont() 27 | font.setPointSize(19) 28 | self.comboBox.setFont(font) 29 | self.comboBox.setObjectName("comboBox") 30 | self.comboBox.addItem("") 31 | self.comboBox.addItem("") 32 | self.comboBox.addItem("") 33 | self.comboBox.addItem("") 34 | self.comboBox.addItem("") 35 | self.pushButton = QtWidgets.QPushButton(self.centralwidget) 36 | self.pushButton.setGeometry(QtCore.QRect(130, 160, 121, 51)) 37 | font = QtGui.QFont() 38 | font.setPointSize(19) 39 | self.pushButton.setFont(font) 40 | self.pushButton.setObjectName("pushButton") 41 | Property.setCentralWidget(self.centralwidget) 42 | self.menubar = QtWidgets.QMenuBar(Property) 43 | self.menubar.setGeometry(QtCore.QRect(0, 0, 393, 25)) 44 | self.menubar.setObjectName("menubar") 45 | Property.setMenuBar(self.menubar) 46 | self.statusbar = QtWidgets.QStatusBar(Property) 47 | self.statusbar.setObjectName("statusbar") 48 | Property.setStatusBar(self.statusbar) 49 | 50 | self.retranslateUi(Property) 51 | QtCore.QMetaObject.connectSlotsByName(Property) 52 | 53 | def retranslateUi(self, Property): 54 | _translate = QtCore.QCoreApplication.translate 55 | Property.setWindowTitle(_translate("Property", "属性")) 56 | self.label.setText(_translate("Property", "请选择药材属性")) 57 | self.comboBox.setItemText(0, _translate("Property", "先煎")) 58 | self.comboBox.setItemText(1, _translate("Property", "后下")) 59 | self.comboBox.setItemText(2, _translate("Property", "包煎")) 60 | self.comboBox.setItemText(3, _translate("Property", "冲服")) 61 | self.comboBox.setItemText(4, _translate("Property", "烊化")) 62 | self.pushButton.setText(_translate("Property", "确定")) 63 | 64 | -------------------------------------------------------------------------------- /UI/property.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Property 4 | 5 | 6 | 7 | 0 8 | 0 9 | 393 10 | 293 11 | 12 | 13 | 14 | 属性 15 | 16 | 17 | 18 | 19 | 20 | 60 21 | 0 22 | 261 23 | 81 24 | 25 | 26 | 27 | 28 | 宋体 29 | 22 30 | 31 | 32 | 33 | 请选择药材属性 34 | 35 | 36 | 37 | 38 | 39 | 140 40 | 80 41 | 101 42 | 51 43 | 44 | 45 | 46 | 47 | 19 48 | 49 | 50 | 51 | 52 | 先煎 53 | 54 | 55 | 56 | 57 | 后下 58 | 59 | 60 | 61 | 62 | 包煎 63 | 64 | 65 | 66 | 67 | 冲服 68 | 69 | 70 | 71 | 72 | 烊化 73 | 74 | 75 | 76 | 77 | 78 | 79 | 130 80 | 160 81 | 121 82 | 51 83 | 84 | 85 | 86 | 87 | 19 88 | 89 | 90 | 91 | 确定 92 | 93 | 94 | 95 | 96 | 97 | 98 | 0 99 | 0 100 | 393 101 | 25 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /UI/quantity.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'quantity.ui' 4 | # 5 | # Created by: PyQt5 UI code generator 5.11.2 6 | # 7 | # WARNING! All changes made in this file will be lost! 8 | 9 | from PyQt5 import QtCore, QtGui, QtWidgets 10 | 11 | class Ui_quantity(object): 12 | def setupUi(self, quantity): 13 | quantity.setObjectName("quantity") 14 | quantity.resize(429, 201) 15 | self.centralwidget = QtWidgets.QWidget(quantity) 16 | self.centralwidget.setObjectName("centralwidget") 17 | self.pushButton = QtWidgets.QPushButton(self.centralwidget) 18 | self.pushButton.setGeometry(QtCore.QRect(160, 110, 93, 28)) 19 | self.pushButton.setObjectName("pushButton") 20 | self.label = QtWidgets.QLabel(self.centralwidget) 21 | self.label.setGeometry(QtCore.QRect(70, 20, 101, 81)) 22 | font = QtGui.QFont() 23 | font.setFamily("Academy Engraved LET") 24 | font.setPointSize(28) 25 | self.label.setFont(font) 26 | self.label.setObjectName("label") 27 | self.lineQuantity = QtWidgets.QLineEdit(self.centralwidget) 28 | self.lineQuantity.setGeometry(QtCore.QRect(210, 40, 171, 41)) 29 | self.lineQuantity.setObjectName("lineQuantity") 30 | quantity.setCentralWidget(self.centralwidget) 31 | self.menubar = QtWidgets.QMenuBar(quantity) 32 | self.menubar.setGeometry(QtCore.QRect(0, 0, 429, 25)) 33 | self.menubar.setObjectName("menubar") 34 | quantity.setMenuBar(self.menubar) 35 | self.statusbar = QtWidgets.QStatusBar(quantity) 36 | self.statusbar.setObjectName("statusbar") 37 | quantity.setStatusBar(self.statusbar) 38 | 39 | self.retranslateUi(quantity) 40 | QtCore.QMetaObject.connectSlotsByName(quantity) 41 | 42 | def retranslateUi(self, quantity): 43 | _translate = QtCore.QCoreApplication.translate 44 | quantity.setWindowTitle(_translate("quantity", "MainWindow")) 45 | self.pushButton.setText(_translate("quantity", "确定")) 46 | self.label.setText(_translate("quantity", "克数")) 47 | 48 | -------------------------------------------------------------------------------- /UI/quantity.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | quantity 4 | 5 | 6 | 7 | 0 8 | 0 9 | 429 10 | 201 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | 18 | 19 | 20 | 160 21 | 110 22 | 93 23 | 28 24 | 25 | 26 | 27 | 确定 28 | 29 | 30 | 31 | 32 | 33 | 70 34 | 20 35 | 101 36 | 81 37 | 38 | 39 | 40 | 41 | Academy Engraved LET 42 | 28 43 | 44 | 45 | 46 | 克数 47 | 48 | 49 | 50 | 51 | 52 | 210 53 | 40 54 | 171 55 | 41 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 0 64 | 0 65 | 429 66 | 25 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /UI/relationDelete.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'relationDelete.ui' 4 | # 5 | # Created by: PyQt5 UI code generator 5.11.2 6 | # 7 | # WARNING! All changes made in this file will be lost! 8 | 9 | from PyQt5 import QtCore, QtGui, QtWidgets 10 | 11 | class Ui_relationDelete(object): 12 | def setupUi(self, relationDelete): 13 | relationDelete.setObjectName("relationDelete") 14 | relationDelete.resize(430, 337) 15 | self.centralwidget = QtWidgets.QWidget(relationDelete) 16 | self.centralwidget.setObjectName("centralwidget") 17 | self.gridLayout = QtWidgets.QGridLayout(self.centralwidget) 18 | self.gridLayout.setObjectName("gridLayout") 19 | self.label = QtWidgets.QLabel(self.centralwidget) 20 | font = QtGui.QFont() 21 | font.setFamily("Academy Engraved LET") 22 | font.setPointSize(28) 23 | self.label.setFont(font) 24 | self.label.setObjectName("label") 25 | self.gridLayout.addWidget(self.label, 0, 0, 1, 2) 26 | self.label_2 = QtWidgets.QLabel(self.centralwidget) 27 | font = QtGui.QFont() 28 | font.setFamily("Academy Engraved LET") 29 | font.setPointSize(28) 30 | self.label_2.setFont(font) 31 | self.label_2.setObjectName("label_2") 32 | self.gridLayout.addWidget(self.label_2, 2, 0, 1, 2) 33 | self.buttonYes = QtWidgets.QPushButton(self.centralwidget) 34 | font = QtGui.QFont() 35 | font.setFamily("Academy Engraved LET") 36 | font.setPointSize(20) 37 | self.buttonYes.setFont(font) 38 | self.buttonYes.setObjectName("buttonYes") 39 | self.gridLayout.addWidget(self.buttonYes, 3, 0, 1, 1) 40 | self.buttonNo = QtWidgets.QPushButton(self.centralwidget) 41 | font = QtGui.QFont() 42 | font.setFamily("Academy Engraved LET") 43 | font.setPointSize(20) 44 | self.buttonNo.setFont(font) 45 | self.buttonNo.setObjectName("buttonNo") 46 | self.gridLayout.addWidget(self.buttonNo, 3, 1, 1, 1) 47 | self.label_3 = QtWidgets.QLabel(self.centralwidget) 48 | font = QtGui.QFont() 49 | font.setFamily("Academy Engraved LET") 50 | font.setPointSize(28) 51 | self.label_3.setFont(font) 52 | self.label_3.setObjectName("label_3") 53 | self.gridLayout.addWidget(self.label_3, 1, 0, 1, 2) 54 | relationDelete.setCentralWidget(self.centralwidget) 55 | self.menubar = QtWidgets.QMenuBar(relationDelete) 56 | self.menubar.setGeometry(QtCore.QRect(0, 0, 430, 25)) 57 | self.menubar.setObjectName("menubar") 58 | relationDelete.setMenuBar(self.menubar) 59 | self.statusbar = QtWidgets.QStatusBar(relationDelete) 60 | self.statusbar.setObjectName("statusbar") 61 | relationDelete.setStatusBar(self.statusbar) 62 | 63 | self.retranslateUi(relationDelete) 64 | QtCore.QMetaObject.connectSlotsByName(relationDelete) 65 | 66 | def retranslateUi(self, relationDelete): 67 | _translate = QtCore.QCoreApplication.translate 68 | relationDelete.setWindowTitle(_translate("relationDelete", "MainWindow")) 69 | self.label.setText(_translate("relationDelete", " 确定删除")) 70 | self.label_2.setText(_translate("relationDelete", " 的联系吗")) 71 | self.buttonYes.setText(_translate("relationDelete", "是的")) 72 | self.buttonYes.setShortcut(_translate("relationDelete", "Return")) 73 | self.buttonNo.setText(_translate("relationDelete", "取消")) 74 | self.label_3.setText(_translate("relationDelete", "病症-病名-药方-药")) 75 | 76 | -------------------------------------------------------------------------------- /UI/relationDelete.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | relationDelete 4 | 5 | 6 | 7 | 0 8 | 0 9 | 430 10 | 337 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Academy Engraved LET 23 | 28 24 | 25 | 26 | 27 | 确定删除 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | Academy Engraved LET 36 | 28 37 | 38 | 39 | 40 | 的联系吗 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | Academy Engraved LET 49 | 20 50 | 51 | 52 | 53 | 是的 54 | 55 | 56 | Return 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | Academy Engraved LET 65 | 20 66 | 67 | 68 | 69 | 取消 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | Academy Engraved LET 78 | 28 79 | 80 | 81 | 82 | 病症-病名-药方-药 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 0 92 | 0 93 | 430 94 | 25 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /UI/reminder.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'reminder.ui' 4 | # 5 | # Created by: PyQt5 UI code generator 5.11.2 6 | # 7 | # WARNING! All changes made in this file will be lost! 8 | 9 | from PyQt5 import QtCore, QtGui, QtWidgets 10 | 11 | class Ui_reminder(object): 12 | def setupUi(self, reminder): 13 | reminder.setObjectName("reminder") 14 | reminder.resize(397, 247) 15 | self.centralwidget = QtWidgets.QWidget(reminder) 16 | self.centralwidget.setObjectName("centralwidget") 17 | self.labelType = QtWidgets.QLabel(self.centralwidget) 18 | self.labelType.setGeometry(QtCore.QRect(30, 20, 351, 91)) 19 | font = QtGui.QFont() 20 | font.setFamily("宋体") 21 | font.setPointSize(22) 22 | self.labelType.setFont(font) 23 | self.labelType.setToolTip("") 24 | self.labelType.setObjectName("labelType") 25 | self.buttonYes = QtWidgets.QPushButton(self.centralwidget) 26 | self.buttonYes.setGeometry(QtCore.QRect(80, 130, 101, 51)) 27 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) 28 | sizePolicy.setHorizontalStretch(0) 29 | sizePolicy.setVerticalStretch(0) 30 | sizePolicy.setHeightForWidth(self.buttonYes.sizePolicy().hasHeightForWidth()) 31 | self.buttonYes.setSizePolicy(sizePolicy) 32 | font = QtGui.QFont() 33 | font.setFamily("Academy Engraved LET") 34 | font.setPointSize(20) 35 | self.buttonYes.setFont(font) 36 | self.buttonYes.setObjectName("buttonYes") 37 | self.buttonNo = QtWidgets.QPushButton(self.centralwidget) 38 | self.buttonNo.setGeometry(QtCore.QRect(210, 130, 101, 51)) 39 | font = QtGui.QFont() 40 | font.setFamily("Academy Engraved LET") 41 | font.setPointSize(20) 42 | self.buttonNo.setFont(font) 43 | self.buttonNo.setObjectName("buttonNo") 44 | reminder.setCentralWidget(self.centralwidget) 45 | self.menubar = QtWidgets.QMenuBar(reminder) 46 | self.menubar.setGeometry(QtCore.QRect(0, 0, 397, 25)) 47 | self.menubar.setObjectName("menubar") 48 | reminder.setMenuBar(self.menubar) 49 | self.statusbar = QtWidgets.QStatusBar(reminder) 50 | self.statusbar.setObjectName("statusbar") 51 | reminder.setStatusBar(self.statusbar) 52 | 53 | self.retranslateUi(reminder) 54 | QtCore.QMetaObject.connectSlotsByName(reminder) 55 | 56 | def retranslateUi(self, reminder): 57 | _translate = QtCore.QCoreApplication.translate 58 | reminder.setWindowTitle(_translate("reminder", "提示")) 59 | self.labelType.setText(_translate("reminder", "是否确定加入数据库")) 60 | self.buttonYes.setText(_translate("reminder", "确定")) 61 | self.buttonYes.setShortcut(_translate("reminder", "Return")) 62 | self.buttonNo.setText(_translate("reminder", "取消")) 63 | 64 | -------------------------------------------------------------------------------- /UI/reminder.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | reminder 4 | 5 | 6 | 7 | 0 8 | 0 9 | 545 10 | 195 11 | 12 | 13 | 14 | 提示 15 | 16 | 17 | 18 | 19 | 20 | 21 | Qt::Vertical 22 | 23 | 24 | 25 | 26 | Academy Engraved LET 27 | 28 28 | 29 | 30 | 31 | 32 | 33 | 34 | 是否确定加入数据库 35 | 36 | 37 | 38 | 39 | Qt::Horizontal 40 | 41 | 42 | 43 | 44 | 0 45 | 0 46 | 47 | 48 | 49 | 50 | Academy Engraved LET 51 | 20 52 | 53 | 54 | 55 | 确定 56 | 57 | 58 | Return 59 | 60 | 61 | 62 | 63 | 64 | Academy Engraved LET 65 | 20 66 | 67 | 68 | 69 | 取消 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 0 81 | 0 82 | 545 83 | 25 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /UI/result.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'result.ui' 4 | # 5 | # Created by: PyQt5 UI code generator 5.11.2 6 | # 7 | # WARNING! All changes made in this file will be lost! 8 | 9 | from PyQt5 import QtCore, QtGui, QtWidgets 10 | 11 | class Ui_result(object): 12 | def setupUi(self, result): 13 | result.setObjectName("result") 14 | result.resize(800, 411) 15 | self.centralwidget = QtWidgets.QWidget(result) 16 | self.centralwidget.setObjectName("centralwidget") 17 | self.gridLayout = QtWidgets.QGridLayout(self.centralwidget) 18 | self.gridLayout.setObjectName("gridLayout") 19 | self.tableWidget = QtWidgets.QTableWidget(self.centralwidget) 20 | self.tableWidget.setEnabled(True) 21 | self.tableWidget.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) 22 | self.tableWidget.setDragEnabled(False) 23 | self.tableWidget.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows) 24 | self.tableWidget.setObjectName("tableWidget") 25 | self.tableWidget.setColumnCount(8) 26 | self.tableWidget.setRowCount(6) 27 | item = QtWidgets.QTableWidgetItem() 28 | self.tableWidget.setVerticalHeaderItem(0, item) 29 | item = QtWidgets.QTableWidgetItem() 30 | self.tableWidget.setVerticalHeaderItem(1, item) 31 | item = QtWidgets.QTableWidgetItem() 32 | self.tableWidget.setVerticalHeaderItem(2, item) 33 | item = QtWidgets.QTableWidgetItem() 34 | self.tableWidget.setVerticalHeaderItem(3, item) 35 | item = QtWidgets.QTableWidgetItem() 36 | self.tableWidget.setVerticalHeaderItem(4, item) 37 | item = QtWidgets.QTableWidgetItem() 38 | self.tableWidget.setVerticalHeaderItem(5, item) 39 | item = QtWidgets.QTableWidgetItem() 40 | self.tableWidget.setHorizontalHeaderItem(0, item) 41 | item = QtWidgets.QTableWidgetItem() 42 | self.tableWidget.setHorizontalHeaderItem(1, item) 43 | item = QtWidgets.QTableWidgetItem() 44 | self.tableWidget.setHorizontalHeaderItem(2, item) 45 | item = QtWidgets.QTableWidgetItem() 46 | self.tableWidget.setHorizontalHeaderItem(3, item) 47 | item = QtWidgets.QTableWidgetItem() 48 | self.tableWidget.setHorizontalHeaderItem(4, item) 49 | item = QtWidgets.QTableWidgetItem() 50 | self.tableWidget.setHorizontalHeaderItem(5, item) 51 | item = QtWidgets.QTableWidgetItem() 52 | self.tableWidget.setHorizontalHeaderItem(6, item) 53 | item = QtWidgets.QTableWidgetItem() 54 | self.tableWidget.setHorizontalHeaderItem(7, item) 55 | self.tableWidget.horizontalHeader().setDefaultSectionSize(112) 56 | self.tableWidget.verticalHeader().setVisible(False) 57 | self.tableWidget.verticalHeader().setCascadingSectionResizes(True) 58 | self.gridLayout.addWidget(self.tableWidget, 0, 0, 1, 1) 59 | self.ButtonOut = QtWidgets.QPushButton(self.centralwidget) 60 | font = QtGui.QFont() 61 | font.setPointSize(20) 62 | self.ButtonOut.setFont(font) 63 | self.ButtonOut.setObjectName("ButtonOut") 64 | self.gridLayout.addWidget(self.ButtonOut, 1, 0, 1, 1) 65 | result.setCentralWidget(self.centralwidget) 66 | self.menubar = QtWidgets.QMenuBar(result) 67 | self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 25)) 68 | self.menubar.setObjectName("menubar") 69 | result.setMenuBar(self.menubar) 70 | self.statusbar = QtWidgets.QStatusBar(result) 71 | self.statusbar.setObjectName("statusbar") 72 | result.setStatusBar(self.statusbar) 73 | 74 | self.retranslateUi(result) 75 | QtCore.QMetaObject.connectSlotsByName(result) 76 | 77 | def retranslateUi(self, result): 78 | _translate = QtCore.QCoreApplication.translate 79 | result.setWindowTitle(_translate("result", "电子病历")) 80 | item = self.tableWidget.verticalHeaderItem(0) 81 | item.setText(_translate("result", "New Row")) 82 | item = self.tableWidget.verticalHeaderItem(1) 83 | item.setText(_translate("result", "New Row")) 84 | item = self.tableWidget.verticalHeaderItem(2) 85 | item.setText(_translate("result", "New Row")) 86 | item = self.tableWidget.verticalHeaderItem(3) 87 | item.setText(_translate("result", "New Row")) 88 | item = self.tableWidget.verticalHeaderItem(4) 89 | item.setText(_translate("result", "New Row")) 90 | item = self.tableWidget.verticalHeaderItem(5) 91 | item.setText(_translate("result", "New Row")) 92 | item = self.tableWidget.horizontalHeaderItem(0) 93 | item.setText(_translate("result", "就诊时间")) 94 | item = self.tableWidget.horizontalHeaderItem(1) 95 | item.setText(_translate("result", "药方")) 96 | item = self.tableWidget.horizontalHeaderItem(2) 97 | item.setText(_translate("result", "病症")) 98 | item = self.tableWidget.horizontalHeaderItem(3) 99 | item.setText(_translate("result", "望")) 100 | item = self.tableWidget.horizontalHeaderItem(4) 101 | item.setText(_translate("result", "闻")) 102 | item = self.tableWidget.horizontalHeaderItem(5) 103 | item.setText(_translate("result", "问")) 104 | item = self.tableWidget.horizontalHeaderItem(6) 105 | item.setText(_translate("result", "切")) 106 | item = self.tableWidget.horizontalHeaderItem(7) 107 | item.setText(_translate("result", "带")) 108 | self.ButtonOut.setText(_translate("result", "退出")) 109 | self.ButtonOut.setShortcut(_translate("result", "Esc")) 110 | 111 | -------------------------------------------------------------------------------- /UI/result.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | result 4 | 5 | 6 | 7 | 0 8 | 0 9 | 800 10 | 411 11 | 12 | 13 | 14 | 电子病历 15 | 16 | 17 | 18 | 19 | 20 | 21 | true 22 | 23 | 24 | QAbstractItemView::NoEditTriggers 25 | 26 | 27 | false 28 | 29 | 30 | QAbstractItemView::SelectRows 31 | 32 | 33 | 112 34 | 35 | 36 | false 37 | 38 | 39 | true 40 | 41 | 42 | 43 | New Row 44 | 45 | 46 | 47 | 48 | New Row 49 | 50 | 51 | 52 | 53 | New Row 54 | 55 | 56 | 57 | 58 | New Row 59 | 60 | 61 | 62 | 63 | New Row 64 | 65 | 66 | 67 | 68 | New Row 69 | 70 | 71 | 72 | 73 | 就诊时间 74 | 75 | 76 | 77 | 78 | 药方 79 | 80 | 81 | 82 | 83 | 病症 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 20 118 | 119 | 120 | 121 | 退出 122 | 123 | 124 | Esc 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 0 134 | 0 135 | 800 136 | 25 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /UI/wrong.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'wrong.ui' 4 | # 5 | # Created by: PyQt5 UI code generator 5.11.2 6 | # 7 | # WARNING! All changes made in this file will be lost! 8 | 9 | from PyQt5 import QtCore, QtGui, QtWidgets 10 | 11 | class Ui_Wrong(object): 12 | def setupUi(self, Wrong): 13 | Wrong.setObjectName("Wrong") 14 | Wrong.resize(310, 143) 15 | self.centralwidget = QtWidgets.QWidget(Wrong) 16 | self.centralwidget.setObjectName("centralwidget") 17 | self.label = QtWidgets.QLabel(self.centralwidget) 18 | self.label.setGeometry(QtCore.QRect(110, 10, 72, 15)) 19 | self.label.setObjectName("label") 20 | self.pushButton = QtWidgets.QPushButton(self.centralwidget) 21 | self.pushButton.setGeometry(QtCore.QRect(100, 50, 93, 28)) 22 | self.pushButton.setObjectName("pushButton") 23 | Wrong.setCentralWidget(self.centralwidget) 24 | self.menubar = QtWidgets.QMenuBar(Wrong) 25 | self.menubar.setGeometry(QtCore.QRect(0, 0, 310, 25)) 26 | self.menubar.setObjectName("menubar") 27 | Wrong.setMenuBar(self.menubar) 28 | self.statusbar = QtWidgets.QStatusBar(Wrong) 29 | self.statusbar.setObjectName("statusbar") 30 | Wrong.setStatusBar(self.statusbar) 31 | 32 | self.retranslateUi(Wrong) 33 | QtCore.QMetaObject.connectSlotsByName(Wrong) 34 | 35 | def retranslateUi(self, Wrong): 36 | _translate = QtCore.QCoreApplication.translate 37 | Wrong.setWindowTitle(_translate("Wrong", "MainWindow")) 38 | self.label.setText(_translate("Wrong", "密码错误")) 39 | self.pushButton.setText(_translate("Wrong", "确定")) 40 | self.pushButton.setShortcut(_translate("Wrong", "Return")) 41 | 42 | -------------------------------------------------------------------------------- /UI/wrong.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Wrong 4 | 5 | 6 | 7 | 0 8 | 0 9 | 310 10 | 143 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | 18 | 19 | 20 | 110 21 | 10 22 | 72 23 | 15 24 | 25 | 26 | 27 | 密码错误 28 | 29 | 30 | 31 | 32 | 33 | 100 34 | 50 35 | 93 36 | 28 37 | 38 | 39 | 40 | 确定 41 | 42 | 43 | Return 44 | 45 | 46 | 47 | 48 | 49 | 50 | 0 51 | 0 52 | 310 53 | 25 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /UI/yes.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'yes.ui' 4 | # 5 | # Created by: PyQt5 UI code generator 5.11.2 6 | # 7 | # WARNING! All changes made in this file will be lost! 8 | 9 | from PyQt5 import QtCore, QtGui, QtWidgets 10 | 11 | class Ui_Yes(object): 12 | def setupUi(self, Yes): 13 | Yes.setObjectName("Yes") 14 | Yes.resize(383, 197) 15 | self.centralwidget = QtWidgets.QWidget(Yes) 16 | self.centralwidget.setObjectName("centralwidget") 17 | self.gridLayout = QtWidgets.QGridLayout(self.centralwidget) 18 | self.gridLayout.setObjectName("gridLayout") 19 | self.label = QtWidgets.QLabel(self.centralwidget) 20 | font = QtGui.QFont() 21 | font.setFamily("Academy Engraved LET") 22 | font.setPointSize(28) 23 | self.label.setFont(font) 24 | self.label.setObjectName("label") 25 | self.gridLayout.addWidget(self.label, 0, 0, 1, 1) 26 | self.yesButton = QtWidgets.QPushButton(self.centralwidget) 27 | font = QtGui.QFont() 28 | font.setFamily("Academy Engraved LET") 29 | font.setPointSize(20) 30 | self.yesButton.setFont(font) 31 | self.yesButton.setObjectName("yesButton") 32 | self.gridLayout.addWidget(self.yesButton, 1, 0, 1, 1) 33 | Yes.setCentralWidget(self.centralwidget) 34 | self.menubar = QtWidgets.QMenuBar(Yes) 35 | self.menubar.setGeometry(QtCore.QRect(0, 0, 383, 25)) 36 | self.menubar.setObjectName("menubar") 37 | Yes.setMenuBar(self.menubar) 38 | self.statusbar = QtWidgets.QStatusBar(Yes) 39 | self.statusbar.setObjectName("statusbar") 40 | Yes.setStatusBar(self.statusbar) 41 | 42 | self.retranslateUi(Yes) 43 | QtCore.QMetaObject.connectSlotsByName(Yes) 44 | 45 | def retranslateUi(self, Yes): 46 | _translate = QtCore.QCoreApplication.translate 47 | Yes.setWindowTitle(_translate("Yes", "MainWindow")) 48 | self.label.setText(_translate("Yes", " 操作成功")) 49 | self.yesButton.setText(_translate("Yes", "确定")) 50 | self.yesButton.setShortcut(_translate("Yes", "Return")) 51 | 52 | -------------------------------------------------------------------------------- /UI/yes.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Yes 4 | 5 | 6 | 7 | 0 8 | 0 9 | 383 10 | 197 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Academy Engraved LET 23 | 28 24 | 25 | 26 | 27 | 操作成功 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | Academy Engraved LET 36 | 20 37 | 38 | 39 | 40 | 确定 41 | 42 | 43 | Return 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 0 53 | 0 54 | 383 55 | 25 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DefJia/TCM-Retrieval-System/f6921011026c954a2d775a124d1971a63de1074a/__init__.py -------------------------------------------------------------------------------- /books/仲景全书.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DefJia/TCM-Retrieval-System/f6921011026c954a2d775a124d1971a63de1074a/books/仲景全书.docx -------------------------------------------------------------------------------- /books/本草纲目.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DefJia/TCM-Retrieval-System/f6921011026c954a2d775a124d1971a63de1074a/books/本草纲目.docx -------------------------------------------------------------------------------- /books/汤头歌决.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DefJia/TCM-Retrieval-System/f6921011026c954a2d775a124d1971a63de1074a/books/汤头歌决.docx -------------------------------------------------------------------------------- /books/药王全书.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DefJia/TCM-Retrieval-System/f6921011026c954a2d775a124d1971a63de1074a/books/药王全书.docx -------------------------------------------------------------------------------- /books/黄帝内经.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DefJia/TCM-Retrieval-System/f6921011026c954a2d775a124d1971a63de1074a/books/黄帝内经.docx -------------------------------------------------------------------------------- /searchfile.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Sun Mar 3 09:46:50 2019 4 | 5 | @author: yang 6 | """ 7 | 8 | from docx import Document 9 | import os,sys 10 | 11 | class SearchFile: 12 | def __init__(self): 13 | self.word = "" 14 | self.filename = "" 15 | self.root_dir = r"../TCM-Retrieval-System/books/" 16 | self.root = os.path.abspath(self.root_dir) 17 | 18 | def get_content(self,word,filename=""): 19 | self.word = word 20 | self.filename = filename 21 | content_list=[] 22 | filename = filename+".docx" 23 | try: 24 | content_list= self.find_files(filename) 25 | except Exception as e: 26 | print(e) 27 | return content_list 28 | 29 | 30 | def search_word(self,filename): 31 | #打开文档 32 | document = Document(filename) 33 | # document = Document(r'C:\Users\Cheng\Desktop\kword\words\wind.docx') 34 | #print(filename) 35 | #读取每段资料 36 | #l = [ paragraph.text.encode('gb2312') for paragraph in document.paragraphs] 37 | l = [ paragraph.text.encode('utf-8') for paragraph in document.paragraphs] 38 | #输出并观察结果,也可以通过其他手段处理文本即可 39 | wordB = self.word.encode('utf-8') 40 | wlist = [] 41 | for i in l: 42 | i=i.strip() 43 | if i.find(wordB)!=-1 and i!= "": 44 | wlist.append(i.decode()) 45 | print(len(wlist)) 46 | return wlist 47 | 48 | def get_process_files(self,filename = ""): 49 | """process all files in directory""" 50 | cur_dir=os.path.abspath(self.root) 51 | file_list=os.listdir(cur_dir) 52 | #print(file_list) 53 | process_list=[] 54 | if filename != "": 55 | index = file_list.index(filename) 56 | targetfile = cur_dir+"\\"+ file_list[index] 57 | if os.path.isfile(targetfile): 58 | process_list.append(targetfile) 59 | else: 60 | for file in file_list: 61 | fullfile=cur_dir+"\\"+file 62 | if os.path.isfile(fullfile): 63 | process_list.append(fullfile) 64 | elif os.path.isdir(fullfile): 65 | dir_extra_list=get_process_files(fullfile) 66 | if len(dir_extra_list)!=0: 67 | for x in dir_extra_list: 68 | process_list.append(x) 69 | return process_list 70 | 71 | def find_files(self,filename=""): 72 | process_list=self.get_process_files(filename) 73 | content_list=[] 74 | for files in process_list: 75 | #try: 76 | list0 = self.search_word(files) 77 | #print(list0) 78 | content_list = content_list + list0 79 | #except Exception as e: 80 | # print(e) 81 | return content_list 82 | 83 | if __name__=='__main__': 84 | #文件根目录 85 | #root_dir=sys.argv[1] 86 | #root_dir = r"../TCM-Retrieval-System/books/" 87 | #要搜索的关键字 88 | #word=sys.argv[2] 89 | #root = os.path.abspath(root_dir) 90 | #print(root) 91 | word = "枸杞" 92 | filename = "本草纲目" 93 | sf = SearchFile() 94 | try: 95 | list = sf.get_content(word,filename): 96 | 97 | except Exception as e: 98 | print(e) 99 | --------------------------------------------------------------------------------