设计要求:
- 预约挂号
为解决患者排队等候的问题,采用除传统挂号方式外的预约挂号方式,主要功能包括:
(1)网上预约,患者可通过手机端APP或PC端实现(建议APP方式),预约分为两种类型:专家预约和科室预约。预约时需要确定就医时段(以半小时为例),每个时段均需限制预约人数。
(2)门诊挂号缴费。对预约患者,凭预约号最多允许提前30分钟挂号缴费。如果预约时间已过,则预约失效,按普通门诊挂号处理。
(3)排队与叫号。
排队:系统根据患者缴费时间先后自动生成排队号。如果患者是预约客户,系统按照优先规则(可以自己定义规则)产生有具有优先权的排队号。
叫号:如果是专家预约,依据专家排队队列叫号并显示;如果是科室预约,则根据科室排队队列由系统根据开放就诊窗口动态分诊,并通过语音叫号。
(4)预约取消,在挂号前患者可以取消预约。但如患者多次取消预约或放弃挂号缴费,加入黑名单(该功能为选做)。
- 门诊处理
(1)病历编辑:实现病历的新增、编辑功能,最好能支持病例模版。
(2)检查检验申请:帮助医生完成各种检查、检验申请单的书写工作。
(3)门诊处方:帮助医生完成处方的书写和编辑工作,希望能自动判断药房库存。
(4)历史病历查询:查看病人以往的电子病历。
- 收费划价
(1)划价收费。收费功能除支持现金方式外,预留微信或支付宝支付接口(该支付方式纳入分析设计,可以选做)
(2)门诊退费:在医学检查、检验、药品领取等行为未实际发生的情况下,病人可以凭缴费单据在收费窗口申请退费(缴费12小时以内)。如果患者已经领药,则需要先到药房申请退药,得到退药处方单,再凭借该处方单在窗口退费。
。
- 药房领药
一旦缴费完成,信息即可推送到药房准备发药,以缩短患者等待时间。
- 配药,配药师从当前队列中取出处方,进行配药。
- 发药,药剂师审核所发药品数量、品名等信息,确认无误后发放药品。
- 进度跟踪,患者可以通过显示屏实时看到自己的处方单的完成状态,如等待配药,正在配药,等待发药,正在发药等。
退药。审核退药请求,如果合理,则为患者生成一退药处方单
表格 1 项目基本信息
项目编号 | 001 | 项目名称 | 医院门诊管理系统 |
项目简称 | HIS系统 | 项目经理 | |
项目类型 | 信息管理系统 | 团队规模 | |
应用架构 | springboot+vue | 开发语言 | java,js,sql,js |
开发平台 | IntelliJIDEA | 数据库 | mysql |
-
- 系统环境
- 操作系统:Windows10;
- jdk8.0;
- Mysql8.0;
- IntelliJIDEA2019
数据库sql文件:
SET NAMES utf8mb4;
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';
DROP SCHEMA IF EXISTS myHIS;
CREATE SCHEMA myHIS;
USE myHIS;
create table admin(
admin_id int primary key auto_increment not null comment"pk",
admin_phone varchar(11) not null comment"用户电话",
admin_pwd varchar(20) not null comment"用户密码",
admin_type int not null comment"0为病人用户,1为医生,2为管理员,3为药房"
)ENGINE=INNODB charset=utf8mb4 comment'admin表';
INSERT INTO admin (admin_id, admin_phone, admin_pwd, admin_type)
VALUES (1,'admin1','123456',2);
INSERT INTO admin (admin_id, admin_phone, admin_pwd, admin_type)
VALUES (2,'admin2','123456',2);
create table doctor(
doc_id int primary key auto_increment not null comment"pk",
doc_name varchar(20) not null comment"医生姓名",
doc_age int not null comment"医生年龄",
doc_phone varchar(11) not null comment"医生电话",
doc_pwd varchar(20) not null comment"医生密码",
doc_info varchar(200) not null comment"医生简介",
doc_gender int not null comment"医生性别,0为女;1为男",
doc_image varchar(50) comment"医生图片",
doc_dep varchar(20) not null comment"医生科室",
is_experts int not null comment"0:不是专家;1:是专家",
doc_value double comment"预约价格",
type int not null comment"0为病人用户,1为医生,2为管理员,3为药房"
)ENGINE=INNODB charset=utf8mb4 comment'医生表';
INSERT INTO doctor (doc_id, doc_name, doc_age, doc_phone, doc_pwd,doc_info,doc_gender,doc_image,doc_dep,is_experts,doc_value,type)
VALUES (1,'doctor',25,'doctor1','123456','doctor1',0,null,'内科',0,20,1);
INSERT INTO doctor (doc_id, doc_name, doc_age, doc_phone, doc_pwd,doc_info,doc_gender,doc_image,doc_dep,is_experts,doc_value,type)
VALUES (2,'doctor',25,'doctor2','123456','doctor2',1,null,'外科',0,20,1);
INSERT INTO doctor (doc_id, doc_name, doc_age, doc_phone, doc_pwd,doc_info,doc_gender,doc_image,doc_dep,is_experts,doc_value,type)
VALUES (3,'doctor',25,'doctor3','123456','doctor3',0,null,'妇产科',0,20,1);
INSERT INTO doctor (doc_id, doc_name, doc_age, doc_phone, doc_pwd,doc_info,doc_gender,doc_image,doc_dep,is_experts,doc_value,type)
VALUES (4,'doctor',25,'doctor4','123456','doctor4',1,null,'儿科',0,20,1);
INSERT INTO doctor (doc_id, doc_name, doc_age, doc_phone, doc_pwd,doc_info,doc_gender,doc_image,doc_dep,is_experts,doc_value,type)
VALUES (5,'doctor',25,'doctor5','123456','doctor5',1,null,'口腔科',0,20,1);
INSERT INTO doctor (doc_id, doc_name, doc_age, doc_phone, doc_pwd,doc_info,doc_gender,doc_image,doc_dep,is_experts,doc_value,type)
VALUES (6,'doctor',25,'doctor6','123456','doctor6',1,null,'耳鼻喉科',0,20,1);
INSERT INTO doctor (doc_id, doc_name, doc_age, doc_phone, doc_pwd,doc_info,doc_gender,doc_image,doc_dep,is_experts,doc_value,type)
VALUES (7,'doctor',25,'doctor7','123456','doctor7',1,null,'康复科',0,20,1);
INSERT INTO doctor (doc_id, doc_name, doc_age, doc_phone, doc_pwd,doc_info,doc_gender,doc_image,doc_dep,is_experts,doc_value,type)
VALUES (8,'doctor',25,'doctor8','123456','doctor8',0,null,'内科',0,20,1);
INSERT INTO doctor (doc_id, doc_name, doc_age, doc_phone, doc_pwd,doc_info,doc_gender,doc_image,doc_dep,is_experts,doc_value,type)
VALUES (9,'doctor',25,'doctor9','123456','doctor9',1,null,'外科',0,20,1);
INSERT INTO doctor (doc_id, doc_name, doc_age, doc_phone, doc_pwd,doc_info,doc_gender,doc_image,doc_dep,is_experts,doc_value,type)
VALUES (10,'doctor',25,'doctor10','123456','doctor10',0,null,'妇产科',0,20,1);
INSERT INTO doctor (doc_id, doc_name, doc_age, doc_phone, doc_pwd,doc_info,doc_gender,doc_image,doc_dep,is_experts,doc_value,type)
VALUES (11,'doctor',25,'doctor11','123456','doctor11',1,null,'儿科',0,20,1);
INSERT INTO doctor (doc_id, doc_name, doc_age, doc_phone, doc_pwd,doc_info,doc_gender,doc_image,doc_dep,is_experts,doc_value,type)
VALUES (12,'doctor',25,'doctor12','123456','doctor12',1,null,'口腔科',0,20,1);
INSERT INTO doctor (doc_id, doc_name, doc_age, doc_phone, doc_pwd,doc_info,doc_gender,doc_image,doc_dep,is_experts,doc_value,type)
VALUES (13,'doctor',25,'doctor13','123456','doctor13',1,null,'耳鼻喉科',0,20,1);
INSERT INTO doctor (doc_id, doc_name, doc_age, doc_phone, doc_pwd,doc_info,doc_gender,doc_image,doc_dep,is_experts,doc_value,type)
VALUES (14,'doctor',25,'doctor14','123456','doctor14',1,null,'康复科',0,20,1);
INSERT INTO doctor (doc_id, doc_name, doc_age, doc_phone, doc_pwd,doc_info,doc_gender,doc_image,doc_dep,is_experts,doc_value,type)
VALUES (15,'专家1',25,'专家1','123456','专家1',1,null,'体检科',1,20,1);
INSERT INTO doctor (doc_id, doc_name, doc_age, doc_phone, doc_pwd,doc_info,doc_gender,doc_image,doc_dep,is_experts,doc_value,type)
VALUES (16,'专家2',25,'专家2','123456','专家2',1,null,'消化科',1,20,1);
INSERT INTO doctor (doc_id, doc_name, doc_age, doc_phone, doc_pwd,doc_info,doc_gender,doc_image,doc_dep,is_experts,doc_value,type)
VALUES (17,'专家3',25,'专家3','123456','专家3',1,null,'消化科',1,20,1);
INSERT INTO doctor (doc_id, doc_name, doc_age, doc_phone, doc_pwd,doc_info,doc_gender,doc_image,doc_dep,is_experts,doc_value,type)
VALUES (18,'专家4',25,'专家4','123456','专家4',1,null,'消化科',1,20,1);
INSERT INTO doctor (doc_id, doc_name, doc_age, doc_phone, doc_pwd,doc_info,doc_gender,doc_image,doc_dep,is_experts,doc_value,type)
VALUES (19,'专家5',25,'专家5','123456','专家5',1,null,'消化科',1,20,1);
INSERT INTO doctor (doc_id, doc_name, doc_age, doc_phone, doc_pwd,doc_info,doc_gender,doc_image,doc_dep,is_experts,doc_value,type)
VALUES (20,'专家6',25,'专家6','123456','专家6',1,null,'消化科',1,20,1);
INSERT INTO doctor (doc_id, doc_name, doc_age, doc_phone, doc_pwd,doc_info,doc_gender,doc_image,doc_dep,is_experts,doc_value,type)
VALUES (21,'专家7',25,'专家7','123456','专家7',1,null,'消化科',1,20,1);
INSERT INTO doctor (doc_id, doc_name, doc_age, doc_phone, doc_pwd,doc_info,doc_gender,doc_image,doc_dep,is_experts,doc_value,type)
VALUES (22,'专家8',25,'专家8','123456','专家8',1,null,'消化科',1,20,1);
create table user(
user_id int primary key auto_increment not null comment"pk",
user_name varchar(20) not null comment "病人用户姓名",
user_phone varchar(11) not null comment "用户电话账号",
user_address varchar(50) not null comment"用户家庭住址",
user_pwd varchar(20) not null comment"用户密码",
user_idNum varchar(18) not null comment"用户身份证号",
user_gender int not null comment"0:女性,1:男性",
user_age int not null comment"用户年龄",
user_image varchar(50) comment"用户图片",
type int not null comment"0为病人用户,1为医生,2为管理员,3为药房"
)ENGINE=INNODB charset=utf8mb4 comment '病人用户表';
INSERT INTO user (user_id, user_name, user_phone, user_address, user_pwd,user_idNum,user_gender,user_age,user_image,type)
VALUES (1,'user1','user1','重庆大学','123456','430108200112164589',0,18,null,0);
INSERT INTO user (user_id, user_name, user_phone, user_address, user_pwd,user_idNum,user_gender,user_age,user_image,type)
VALUES (2,'user2','user2','重庆大学','123456','430108200112164589',0,18,null,0);
create table inspectioninfo(
insinfo_id int primary key auto_increment not null comment"pk",
doc_id int not null comment"医生编号",
ins_address varchar(50) not null comment"检查检验地址",
ins_value double not null comment"检查检验费用",
ins_name varchar(20) not null comment"检查检验项目名",
foreign key(doc_id) references doctor(doc_id) on update cascade on delete cascade
)ENGINE=INNODB charset=utf8mb4 comment'检查检验信息表';
INSERT INTO inspectioninfo(insinfo_id,doc_id,ins_address,ins_value,ins_name)
VALUES (1,1,'门诊二楼抽血室',20.0,'抽血');
INSERT INTO inspectioninfo (insinfo_id, doc_id, ins_address, ins_value, ins_name)
VALUES (2,1,'住院部一楼彩超室',20.0,'彩超');
INSERT INTO inspectioninfo (insinfo_id, doc_id, ins_address, ins_value, ins_name)
VALUES (3,1,'门诊二楼检验科',20.0,'检验');
INSERT INTO inspectioninfo (insinfo_id, doc_id, ins_address, ins_value, ins_name)
VALUES (4,1,'急诊一楼急救室',20.0,'胃镜');
create table inspection(
ins_id int primary key auto_increment not null comment"pk",
user_id int not null comment"病人用户姓名",
doc_id int not null comment"医生编号",
insinfo_id int not null comment"检验信息id",
ins_paystatus int not null comment"0:未缴费,1:已缴费,2:退费中,3:已退费",
ins_date datetime not null comment"检查检验开具时间",
ins_status int not null comment"0:已检查,1:未检查",
foreign key(user_id) references user(user_id) on update cascade on delete cascade,
foreign key(doc_id) references doctor(doc_id) on update cascade on delete cascade,
foreign key(insinfo_id) references inspectioninfo(insinfo_id) on update cascade on delete cascade
)ENGINE=INNODB charset=utf8mb4 comment'检查检验表';
INSERT INTO inspection(ins_id,user_id,doc_id,insinfo_id,ins_paystatus,ins_date,ins_status)
VALUES (1,1,1,1,0,'2021-07-16',1);
INSERT INTO inspection (ins_id, user_id, doc_id, insinfo_id, ins_paystatus,ins_date,ins_status)
VALUES (2,1,1,2,0,'2021-07-16',1);
INSERT INTO inspection (ins_id, user_id, doc_id, insinfo_id, ins_paystatus,ins_date,ins_status)
VALUES (3,1,1,3,0,'2021-07-16',1);
INSERT INTO inspection (ins_id, user_id, doc_id, insinfo_id, ins_paystatus,ins_date,ins_status)
VALUES (4,1,1,4,0,'2021-07-16',1);
INSERT INTO inspection (ins_id, user_id, doc_id, insinfo_id, ins_paystatus,ins_date,ins_status)
VALUES (5,2,1,1,0,'2021-07-16',1);
INSERT INTO inspection (ins_id, user_id, doc_id, insinfo_id, ins_paystatus,ins_date,ins_status)
VALUES (6,2,1,2,0,'2021-07-16',1);
INSERT INTO inspection (ins_id, user_id, doc_id, insinfo_id, ins_paystatus,ins_date,ins_status)
VALUES (7,2,1,3,0,'2021-07-16',1);
create table medicine(
med_id int primary key auto_increment not null comment"pk",
med_name varchar(20) not null comment"处方药名称",
med_category varchar(20) not null comment"处方药类别",
med_Pdate datetime not null comment"处方药生产日期",
med_spec varchar(20) not null comment"处方药规格",
med_srock int not null comment"处方药库存",
med_value double not null comment"处方药价格"
)ENGINE=INNODB charset=utf8mb4 comment'处方药表';
# INSERT INTO medicine(med_id,med_name,med_category,med_Pdate,med_spec,med_srock,med_value)
# VALUES (1,'阿司匹林','西药','2022-01-05 21:40:48','25mg*100片',100,10);
# INSERT INTO medicine(med_id,med_name,med_category,med_Pdate,med_spec,med_srock,med_value)
# VALUES (2,'复方芦荟胶囊','西药','2022-01-05 21:40:48','25mg*30粒',1000,15);
# INSERT INTO medicine(med_id,med_name,med_category,med_Pdate,med_spec,med_srock,med_value)
# VALUES (3,'阿卡波糖','抗生素','2022-01-05 21:40:48','50mg*30粒',100,10);
# INSERT INTO medicine(med_id,med_name,med_category,med_Pdate,med_spec,med_srock,med_value)
# VALUES (4,'稳心颗粒','颗粒','2022-01-05 21:40:48','9g*9袋',100,10);
# INSERT INTO medicine(med_id,med_name,med_category,med_Pdate,med_spec,med_srock,med_value)
# VALUES (5,'慢心律片','胶囊','2022-01-05 21:40:48','50mg*100粒',100,10);
INSERT INTO medicine (med_id, med_name, med_category,med_Pdate,med_spec,med_srock,med_value)
VALUES (1,'普通处方','普通处方','2021-07-16','unhappy',20,15.0);
INSERT INTO medicine (med_id, med_name, med_category,med_Pdate,med_spec,med_srock,med_value)
VALUES (2,'儿科处方','儿科处方','2021-07-16','unhappy',20,15.0);
INSERT INTO medicine (med_id, med_name, med_category,med_Pdate,med_spec,med_srock,med_value)
VALUES (3,'急诊处方','急诊处方','2021-07-16','unhappy',20,15.0);
INSERT INTO medicine (med_id, med_name, med_category,med_Pdate,med_spec,med_srock,med_value)
VALUES (4,'麻醉处方','麻醉处方','2021-07-16','unhappy',20,15.0);
INSERT INTO medicine (med_id, med_name, med_category,med_Pdate,med_spec,med_srock,med_value)
VALUES (5,'一类精神处方','一类精神处方','2021-07-16','unhappy',20,15.0);
INSERT INTO medicine (med_id, med_name, med_category,med_Pdate,med_spec,med_srock,med_value)
VALUES (6,'二类精神处方','二类精神处方','2021-07-16','unhappy',20,15.0);
create table menu(
title varchar(100) not null comment "功能标题",
href varchar(30) not null comment "功能对应的链接",
comment varchar(50) not null comment "标签内容",
icon varchar(30) comment "标签样式",
function_type int not null comment "与用户类型对应的功能"
)ENGINE=INNODB charset=utf8mb4 comment '菜单表';
INSERT INTO menu (title, href, comment, icon, function_type)
VALUES ('myHIS/Home.vue','/home','首页','el-icon-house',0);
INSERT INTO menu (title, href, comment, icon, function_type)
VALUES ('myHIS/Home.vue','/home','首页','el-icon-house',1);
INSERT INTO menu (title, href, comment, icon, function_type)
VALUES ('myHIS/Home.vue','/home','首页','el-icon-house',2);
INSERT INTO menu (title, href, comment, icon, function_type)
VALUES ('myHIS/Home.vue','/home','首页','el-icon-house',3);
INSERT INTO menu (title, href, comment, icon, function_type)
VALUES ('myHIS/user/makeAppointment.vue','/user/makeAppointment','网上预约','el-icon-time',0);
INSERT INTO menu (title, href, comment, icon, function_type)
VALUES ('myHIS/user/checkQueue.vue','/user/myorder','我的预约','el-icon-alarm-clock',0);
INSERT INTO menu (title, href, comment, icon, function_type)
VALUES ('myHIS/user/pay.vue','/user/pay','我的缴费','el-icon-money',0);
INSERT INTO menu (title, href, comment, icon, function_type)
VALUES ('myHIS/user/refund.vue','/user/refund','我的退费','el-icon-wallet',0);
INSERT INTO menu (title, href, comment, icon, function_type)
VALUES ('myHIS/doctor/addPatientRecord.vue','/doctor/addPatientRecord','病历编辑','el-icon-document',1);
INSERT INTO menu (title, href, comment, icon, function_type)
VALUES ('myHIS/doctor/examin.vue','/doctor/examin','开检查检验单','el-icon-document-add',1);
INSERT INTO menu (title, href, comment, icon, function_type)
VALUES ('myHIS/doctor/writerecipe.vue','/doctor/recipe','开处方单','el-icon-document-copy',1);
INSERT INTO menu (title, href, comment, icon, function_type)
VALUES ('myHIS/admin/userManage.vue','/admin/userManage','用户管理','el-icon-s-custom',2);
INSERT INTO menu (title, href, comment, icon, function_type)
VALUES ('myHIS/admin/doctorManage.vue','/admin/doctorManage','医生管理','el-icon-user-solid',2);
INSERT INTO menu (title, href, comment, icon, function_type)
VALUES ('myHIS/admin/charges.vue','/admin/charges','收费','el-icon-coin',2);
INSERT INTO menu (title, href, comment, icon, function_type)
VALUES ('myHIS/admin/adminRefund.vue','/admin/adminRefund','退费','el-icon-tickets',2);
INSERT INTO menu (title, href, comment, icon, function_type)
VALUES ('myHIS/pharmacy/recipe.vue','/pharmacy/recipe','处方处理','el-icon-document-copy',3);
INSERT INTO menu (title, href, comment, icon, function_type)
VALUES ('myHIS/pharmacy/return.vue','/pharmacy/return','退药申请','el-icon-edit-outline',3);
INSERT INTO menu (title, href, comment, icon, function_type)
VALUES ('myHIS/pharmacy/medicine.vue','/pharmacy/medicine','药品管理','el-icon-takeaway-box',3);
INSERT INTO menu (title, href, comment, icon, function_type)
VALUES ('myHIS/password.vue','/Password','修改密码','el-icon-edit',0);
INSERT INTO menu (title, href, comment, icon, function_type)
VALUES ('myHIS/password.vue','/Password','修改密码','el-icon-edit',1);
INSERT INTO menu (title, href, comment, icon, function_type)
VALUES ('myHIS/password.vue','/Password','修改密码','el-icon-edit',2);
INSERT INTO menu (title, href, comment, icon, function_type)
VALUES ('myHIS/password.vue','/Password','修改密码','el-icon-edit',3);
create table pharmacy(
p_id int primary key auto_increment not null comment"pk",
p_phone varchar(11) not null comment "账号",
p_pwd varchar(20) not null comment "密码",
type int not null comment"0为病人用户,1为医生,2为管理员,3为药房"
)ENGINE=INNODB charset=utf8mb4 comment '药房表';
INSERT INTO pharmacy (p_id, p_phone, p_pwd, type)
VALUES (1,'pharmacy1','123456',3);
INSERT INTO pharmacy (p_id, p_phone, p_pwd, type)
VALUES (2,'pharmacy2','123456',3);
create table prescription(
pre_id int primary key auto_increment not null comment"pk",
doc_id int not null comment "医生id",
user_id int not null comment "病人用户id",
pre_date datetime not null comment"处方开具时间",
pre_status int comment"0:正在配药,1:正在送药,2:送药完成默认空值,缴费完成为0",
pre_paystatus int not null comment"0:未缴费,1:已缴费,2:退费中,3:已退药,4:已退费",
foreign key(doc_id) references doctor(doc_id) on update cascade on delete cascade,
foreign key(user_id) references user(user_id) on update cascade on delete cascade
)ENGINE=INNODB charset=utf8mb4 comment '处方单表';
# INSERT INTO prescription(pre_id,doc_id,user_id,pre_date,pre_status,pre_paystatus)
# VALUES (1,1,1,'2022-01-05 21:40:48',0,1);
# INSERT INTO prescription(pre_id,doc_id,user_id,pre_date,pre_status,pre_paystatus)
# VALUES (2,1,2,'2022-01-05 21:40:48',2,1);
INSERT INTO prescription (pre_id, doc_id, user_id, pre_date,pre_status,pre_paystatus)
VALUES (1,1,1,'2021-07-16',0,0);
INSERT INTO prescription (pre_id, doc_id, user_id, pre_date,pre_status,pre_paystatus)
VALUES (2,1,1,'2021-07-16',0,0);
INSERT INTO prescription (pre_id, doc_id, user_id, pre_date,pre_status,pre_paystatus)
VALUES (3,1,1,'2021-07-16',0,0);
create table preAmount(
pre_id int not null comment "处方id",
med_id int not null comment "处方药id",
amount int not null comment "处方药数量",
foreign key(pre_id) references prescription(pre_id) on update cascade on delete cascade,
foreign key(med_id) references medicine(med_id) on update cascade on delete cascade
)ENGINE=INNODB charset=utf8mb4 comment '处方-处方药表';
INSERT INTO preAmount(pre_id,med_id,amount)
VALUES (1,1,1);
INSERT INTO preAmount(pre_id,med_id,amount)
VALUES (2,2,1);
INSERT INTO preAmount (pre_id, med_id, amount)
VALUES (1,1,2);
INSERT INTO preAmount (pre_id, med_id, amount)
VALUES (1,2,2);
INSERT INTO preAmount (pre_id, med_id, amount)
VALUES (1,3,2);
INSERT INTO preAmount (pre_id, med_id, amount)
VALUES (1,4,2);
INSERT INTO preAmount (pre_id, med_id, amount)
VALUES (1,5,2);
INSERT INTO preAmount (pre_id, med_id, amount)
VALUES (1,6,2);
create table refund(
refund_id int primary key auto_increment not null comment"pk",
user_id int not null comment "病人用户id",
pre_id int not null comment "处方id",
refund_date datetime not null comment"退费时间",
refund_reason varchar(100) comment"处方退费理由",
refund_status int not null comment"0:正在审核,1:审核已通过",
foreign key(user_id) references user(user_id) on update cascade on delete cascade,
foreign key(pre_id) references prescription(pre_id) on update cascade on delete cascade
)ENGINE=INNODB charset=utf8mb4 comment '退费表';
INSERT INTO refund(refund_id,user_id,pre_id,refund_date,refund_reason,refund_status)
VALUES (1,2,2,'2022-01-05 21:40:4','不需要了',0);
create table orders(
order_id int primary key auto_increment not null comment"pk",
user_id int not null comment "病人用户id",
doc_id int not null comment "医生id",
order_date datetime not null comment"预约时间",
date varchar(20) not null comment"预约时间段",
order_status int not null comment"0:正在预约,1:预约成功",
order_paystatus int not null comment"0:未缴费,1:已缴费",
number int comment"排队单号",
order_value double not null comment"预约价格",
foreign key(user_id) references user(user_id) on update cascade on delete cascade,
foreign key(doc_id) references doctor(doc_id) on update cascade on delete cascade
)ENGINE=INNODB charset=utf8mb4 comment '预约表';
INSERT INTO orders (order_id, user_id, doc_id, order_date, date,order_status,order_paystatus,number,order_value)
VALUES (1,1,1,'2021-07-16','9:00-9:30',0,0,2,20);
INSERT INTO orders (order_id, user_id, doc_id, order_date, date,order_status,order_paystatus,number,order_value)
VALUES (2,1,2,'2021-07-16','9:00-9:30',0,0,3,20);
create table medicalRecord(
m_id int primary key auto_increment not null comment"pk",
user_id int not null comment "病人用户id",
doc_id int not null comment "医生id",
past_mh varchar(200) not null comment"病史",
sym_des varchar(200) not null comment"症状描述",
allHis varchar(200) not null comment"过敏史",
dia_result varchar(200) not null comment"诊断结果",
m_date datetime not null comment"病历提交时间",
foreign key(user_id) references user(user_id) on update cascade on delete cascade,
foreign key(doc_id) references doctor(doc_id) on update cascade on delete cascade
)ENGINE=INNODB charset=utf8mb4 comment '病历表';
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (1,1,1,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (2,1,2,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (3,1,3,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (4,1,4,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (5,1,5,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (6,1,6,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (7,1,7,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (8,1,8,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (9,1,9,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (10,1,10,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (11,1,11,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (12,1,12,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (13,1,13,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (14,1,14,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (15,1,15,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (16,1,16,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (17,1,17,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (18,1,18,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (19,1,19,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (20,1,20,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (21,1,21,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (22,1,22,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (23,2,1,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (24,2,2,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (25,2,3,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (26,2,4,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (27,2,5,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (28,2,6,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (29,2,7,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (30,2,8,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (31,2,9,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (32,2,10,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (33,2,11,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (34,2,12,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (35,2,13,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (36,2,14,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (37,2,15,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (38,2,16,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (39,2,17,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (40,2,18,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (41,2,19,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (42,2,20,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (43,2,21,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
INSERT INTO medicalRecord (m_id, user_id, doc_id, past_mh, sym_des,allHis,dia_result,m_date)
VALUES (44,2,22,'感冒','咳嗽','青霉素','肺炎','2021-07-16 13:35:53');
主函数入口:
package backend;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.SpringApplication;
@SpringBootApplication
@MapperScan("backend/mapper")
public class MySpringBootApplication {
public static void main(String[] args) {
SpringApplication.run(MySpringBootApplication.class);
}
}
完整下载地址: