目录
前言介绍
系统展示
管理员页面
患者管理
诊疗信息管理
病历信息管理
处方信息管理
患者页面
医生页面
部分核心代码
病历信息
上传文件
数据库配置
前言介绍
随着信息技术和网络技术的飞速发展,人类已进入全新信息化时代,传统管理技术已无法高效,便捷地管理信息。为了迎合时代需求,优化管理效率,各种各样的管理平台应运而生,各行各业相继进入信息管理时代,医患档案管理系统就是信息时代变革中的产物之一。
任何平台都要遵循平台设计的基本流程,本平台也不例外,同样需要经过市场调研,需求分析,概要设计,详细设计,编码,测试这些步骤,基于java语言设计并实现了医患档案管理系统。该系统基于B/S即所谓浏览器/服务器模式,应用java技术,选择MySQL作为后台数据库。平台主要包括平台首页,个人中心,患者管理,医生管理,诊疗信息管理,病历信息管理,处方信息管理。
系统展示
管理员页面
患者管理
诊疗信息管理
病历信息管理
处方信息管理
患者页面
医生页面
部分核心代码
病历信息
/**
* 病历信息
* 后端接口
* @author
* @email
* @date 2022-04-23 18:27:37
*/
@RestController
@RequestMapping("/binglixinxi")
public class BinglixinxiController {
@Autowired
private BinglixinxiService binglixinxiService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,BinglixinxiEntity binglixinxi,
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yisheng")) {
binglixinxi.setYishengzhanghao((String)request.getSession().getAttribute("username"));
}
if(tableName.equals("huanzhe")) {
binglixinxi.setHuanzhezhanghao((String)request.getSession().getAttribute("username"));
}
EntityWrapper<BinglixinxiEntity> ew = new EntityWrapper<BinglixinxiEntity>();
PageUtils page = binglixinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, binglixinxi), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,BinglixinxiEntity binglixinxi,
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yisheng")) {
binglixinxi.setYishengzhanghao((String)request.getSession().getAttribute("username"));
}
if(tableName.equals("huanzhe")) {
binglixinxi.setHuanzhezhanghao((String)request.getSession().getAttribute("username"));
}
EntityWrapper<BinglixinxiEntity> ew = new EntityWrapper<BinglixinxiEntity>();
PageUtils page = binglixinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, binglixinxi), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( BinglixinxiEntity binglixinxi){
EntityWrapper<BinglixinxiEntity> ew = new EntityWrapper<BinglixinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( binglixinxi, "binglixinxi"));
return R.ok().put("data", binglixinxiService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(BinglixinxiEntity binglixinxi){
EntityWrapper< BinglixinxiEntity> ew = new EntityWrapper< BinglixinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( binglixinxi, "binglixinxi"));
BinglixinxiView binglixinxiView = binglixinxiService.selectView(ew);
return R.ok("查询病历信息成功").put("data", binglixinxiView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
BinglixinxiEntity binglixinxi = binglixinxiService.selectById(id);
return R.ok().put("data", binglixinxi);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
BinglixinxiEntity binglixinxi = binglixinxiService.selectById(id);
return R.ok().put("data", binglixinxi);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody BinglixinxiEntity binglixinxi, HttpServletRequest request){
binglixinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(binglixinxi);
binglixinxiService.insert(binglixinxi);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody BinglixinxiEntity binglixinxi, HttpServletRequest request){
binglixinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(binglixinxi);
binglixinxi.setUserid((Long)request.getSession().getAttribute("userId"));
binglixinxiService.insert(binglixinxi);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
@Transactional
public R update(@RequestBody BinglixinxiEntity binglixinxi, HttpServletRequest request){
//ValidatorUtils.validateEntity(binglixinxi);
binglixinxiService.updateById(binglixinxi);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
binglixinxiService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<BinglixinxiEntity> wrapper = new EntityWrapper<BinglixinxiEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yisheng")) {
wrapper.eq("yishengzhanghao", (String)request.getSession().getAttribute("username"));
}
if(tableName.equals("huanzhe")) {
wrapper.eq("huanzhezhanghao", (String)request.getSession().getAttribute("username"));
}
int count = binglixinxiService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
上传文件
/**
* 上传文件映射表
*/
@RestController
@RequestMapping("file")
@SuppressWarnings({"unchecked","rawtypes"})
public class FileController{
@Autowired
private ConfigService configService;
/**
* 上传文件
*/
@RequestMapping("/upload")
public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception {
if (file.isEmpty()) {
throw new EIException("上传文件不能为空");
}
String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);
File path = new File(ResourceUtils.getURL("classpath:static").getPath());
if(!path.exists()) {
path = new File("");
}
File upload = new File(path.getAbsolutePath(),"/upload/");
if(!upload.exists()) {
upload.mkdirs();
}
String fileName = new Date().getTime()+"."+fileExt;
File dest = new File(upload.getAbsolutePath()+"/"+fileName);
file.transferTo(dest);
/**
* 如果使用idea或者eclipse重启项目,发现之前上传的图片或者文件丢失,将下面一行代码注释打开
* 请将以下的"D:\\springbootq33sd\\src\\main\\resources\\static\\upload"替换成你本地项目的upload路径,
* 并且项目路径不能存在中文、空格等特殊字符
*/
// FileUtils.copyFile(dest, new File("D:\\springbootq33sd\\src\\main\\resources\\static\\upload"+"/"+fileName)); /**修改了路径以后请将该行最前面的//注释去掉**/
if(StringUtils.isNotBlank(type) && type.equals("1")) {
ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
if(configEntity==null) {
configEntity = new ConfigEntity();
configEntity.setName("faceFile");
configEntity.setValue(fileName);
} else {
configEntity.setValue(fileName);
}
configService.insertOrUpdate(configEntity);
}
return R.ok().put("file", fileName);
}
/**
* 下载文件
*/
@IgnoreAuth
@RequestMapping("/download")
public ResponseEntity<byte[]> download(@RequestParam String fileName) {
try {
File path = new File(ResourceUtils.getURL("classpath:static").getPath());
if(!path.exists()) {
path = new File("");
}
File upload = new File(path.getAbsolutePath(),"/upload/");
if(!upload.exists()) {
upload.mkdirs();
}
File file = new File(upload.getAbsolutePath()+"/"+fileName);
if(file.exists()){
/*if(!fileService.canRead(file, SessionManager.getSessionUser())){
getResponse().sendError(403);
}*/
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
headers.setContentDispositionFormData("attachment", fileName);
return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);
}
} catch (IOException e) {
e.printStackTrace();
}
return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR);
}
}
数据库配置
# Tomcat
server:
tomcat:
uri-encoding: UTF-8
port: 8080
servlet:
context-path: /springboot7ld2o
spring:
datasource:
driverClassName: com.mysql.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3308/springboot7ld2o?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8
username: root
password: 123456
# driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
# url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=springboot7ld2o
# username: sa
# password: 123456
servlet:
multipart:
max-file-size: 300MB
max-request-size: 300MB
resources:
static-locations: classpath:static/,file:static/
#mybatis
mybatis-plus:
mapper-locations: classpath*:mapper/*.xml
#实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage: com.entity
global-config:
#主键类型 0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
id-type: 1
#字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
field-strategy: 1
#驼峰下划线转换
db-column-underline: true
#刷新mapper 调试神器
refresh-mapper: true
#逻辑删除配置
logic-delete-value: -1
logic-not-delete-value: 0
#自定义SQL注入器
sql-injector: com.baomidou.mybatisplus.mapper.LogicSqlInjector
configuration:
map-underscore-to-camel-case: true
cache-enabled: false
call-setters-on-nulls: true
#springboot 项目mybatis plus 设置 jdbcTypeForNull (oracle数据库需配置JdbcType.NULL, 默认是Other)
jdbc-type-for-null: 'null'
此源码非开源,若需要此源码可扫码添加微信或者qq:2214904953进行咨询!
2600多套项目欢迎咨询