1、归档系统缺陷列表评分导出错误修复

2、归档系统初审界面,无护士缺陷,按缺陷查询时会显示护士查看缺陷按钮修复
3、归档系统退回病历,只退回给科主任,还未退回医生护士,医生护士状态会变成未提交
4、归档系统超期列表超期时间计算有错误修改
5、示踪导出崩溃修改
6、新增超期的病案无提醒通知功能
master
ALW 3 years ago
parent cdd45362c2
commit b1253f28b1

@ -5,11 +5,15 @@ import com.emr.dao.Emr_DictionaryMapper;
import com.emr.entity.*;
import com.emr.service.Archive_DetailService;
import com.emr.service.Archive_MasterService;
import com.emr.service.OverdueRemindService;
import com.emr.service.Zd_AssortService;
import com.emr.service.ipml.TBasicBrowseHistoryService;
import com.emr.util.ExceptionPrintUtil;
import com.emr.util.Msg;
import com.emr.vo.OverdueRemindVO;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.HttpClients;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
@ -51,6 +55,8 @@ public class FontController {
private Zd_AssortService assortService;
@Autowired
private TBasicBrowseHistoryService tBasicBrowseHistoryService;
@Autowired
private OverdueRemindService overdueRemindService;
/***************************提供第三方按多个分段id和记账号查询病历pdf***********************************/
/**
@ -406,4 +412,58 @@ public class FontController {
ExceptionPrintUtil.printException(e);
}
}
/**
*
* @param userId id
* @param title
* @param content
*/
@ResponseBody
@RequestMapping(value = "sendMessageWith")
public void sendMessageWith(Integer userId, String title, String content) {
title="超期的病案通知";
OverdueRemindVO overdueRemindVO= new OverdueRemindVO();
overdueRemindVO.setUserId(userId);
//查询主治医生id
String s = overdueRemindService.selectDoctorId(overdueRemindVO);
overdueRemindVO.setDoctorInCharge(s);
//判断这个医生今天是否已读超期消息提醒
int i = overdueRemindService.selectOverdueStatcByDoctorId(overdueRemindVO);
if (i ==0) {
//查询该主治医生有多少超期的病案未归档
String overdueNum = overdueRemindService.selectoverdueNumAndDoctorId(overdueRemindVO);
//调用接口
// 创建uri
content = "尊敬的医生!您有'" + overdueNum + "'条超期的病案未归档";
String url = powerUrlHead + "/font/sendMessage?"
+ "userId=" + userId.toString()
+ "&sysFlag=emr_medical_record"
+ "&title=" + title
+ "&content=" + content.replace(" ", "");
// 执行请求
try {
HttpClients.createDefault().execute(new HttpGet(url));
//保存到提醒日志
overdueRemindVO.setDOCTOR_IN_CHARGE(s);
System.out.println("s:::" + s);
overdueRemindService.insertRemind(overdueRemindVO);
} catch (Exception e) {
e.printStackTrace();
}
}
}
/**
*
* @param overdueRemindVO id
*/
@ResponseBody
@RequestMapping(value = "updatetOverdueStatc")
public void updatetOverdueStatcByDoctorId(OverdueRemindVO overdueRemindVO) {
//查询主治医生id
String s = overdueRemindService.selectDoctorId(overdueRemindVO);
overdueRemindVO.setDoctorInCharge(s);
overdueRemindService.updatetOverdueStatcByDoctorId(overdueRemindVO);
}
}

@ -59,7 +59,7 @@ public class commitController {
public void exportExcel(HttpServletResponse response, Archive_Master_Vo archiveMasterVo) throws Exception {
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
String[] header = {"病历清单id","住院号","住院次数","名字","性别","身份证","出院科室","出院日期","主管医生","状态","医生是否提交","医生","医生提交日期","护士是否提交","护士","护士提交日期","是否死亡"};
String[] fileNames = {"id","inpNo","visitId","name","sex","idNo","deptName","dischargeDateTime","doctorInCharge","archivestate","cmtDoctor","doctorName","cmtDoctorDate","cmtNurse","nurseName","cmtDurseDate","deathFlag"};
String[] fileNames = {"id","inpNo","visitId","name","sex","idNo","deptName","dischargeDateTime","doctorInCharge","archivestate","cmtDoctor","doctorName","cmtDoctorDate","cmtNurse","nurseName","cmtNurseDate","deathFlag"};
//文件名
String fileName = "科主任审核" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls";
//构造excel的数据

@ -1,5 +1,16 @@
package com.emr.controller;
import com.alibaba.fastjson.JSONObject;
import com.emr.vo.GetTime;
import sun.net.www.protocol.http.HttpURLConnection;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import com.alibaba.fastjson.JSONObject;
import com.emr.dao.MedicalRecordHomepageCacheMapper;
import com.emr.entity.Archive_Master_Vo;
@ -14,12 +25,13 @@ import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.text.ParseException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
@Controller
@RequestMapping("/medicalOverdue")
@ -191,8 +203,118 @@ public class medicalOverdueController {
ThreadExcelUtils utils = new ThreadExcelUtils(fileName, "", header, fileNames);
String result=utils.exportExcelToFilePath(response,utils.listConvert(list));
}
// /**
// * 两个日期相减
// * @param beginDateStr
// * @param endDateStr
// * @return
// */
// public static long getDaySub(String beginDateStr,String endDateStr){
// long day=0;
// SimpleDateFormat format = new java.text.SimpleDateFormat("yyyy-MM-dd");
// Date beginDate;
// Date endDate;
// try{
// beginDate = format.parse(beginDateStr);
// endDate= format.parse(endDateStr);
// day=(endDate.getTime()-beginDate.getTime())/(24*60*60*1000);
// //System.out.println("相隔的天数="+day);
// } catch (ParseException e){
// // TODO 自动生成 catch 块
// e.printStackTrace();
// }
// return day+1;
// }
// private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// /*
// * 传入查询工作日api地址,用于查询当天是否是工作日返回的是JSON格式的数据需要在代码中进行转换。
// * */
// public static String getData(String addess){
// URL url = null;
// HttpURLConnection httpConn = null;
// BufferedReader in = null;
// StringBuffer sb = new StringBuffer();
// try{
// url = new URL(addess);
// in = new BufferedReader(new InputStreamReader(url.openStream(),"utf-8") );
// String str = null;
// while((str = in.readLine()) != null) {
// sb.append( str );
// }
// } catch (Exception ex) {
// ex.printStackTrace();
// } finally{
// try{
// if(in!=null) {
// in.close();
// }
// }catch(IOException ex) {
// ex.printStackTrace();
// }
// }
// String data =sb.toString();
// return data;
// }
// /*
// * 计算两个时间点的工作日
// *
// * */
// @ResponseBody
// @RequestMapping(value = "/getTimeoutDay")
// public static long getWorkDayBetweenStartAndEnd(GetTime getTime) throws ParseException {
// List<GetTime> getTimeList= new ArrayList<>();
// getTimeList.add(getTime);
// int timeoutDay = 0;
// //工作日
// long workDay = 0;
// //先算出两个时间中间的天数
// long dayOfMiddle = getDaySub(getTime.getStartTime(),getTime.getEndTime());
// long l = dayOfMiddle - 1;
// System.out.println("dayOfMiddle::::"+dayOfMiddle);
// //从开始时间起,算出中间的周末和及假日
// for (int i = 0; i < l; i++) {
// Date now = sdf.parse(getTime.getStartTime());
// Calendar c = Calendar.getInstance();
// c.setTime(now);
// c.set(Calendar.DATE, c.get(Calendar.DATE) + i);
// String urlData = sdf.format(c.getTime());
// System.out.println("urlData::::"+urlData);
// String urlDress = "http://timor.tech/api/holiday/info/" + urlData;
//
// System.out.println("urlDress::::"+urlDress);
// //获得当前是否是工作日
// String data = getData(urlDress);
// System.out.println("data::::"+data);
// JSONObject json = getjson(data);
// System.out.println("json:::::"+json);
// String value = json.get("data").toString();
// if (value.equals("0")) {
// workDay++;
// }
// timeoutDay = Integer.parseInt(String.valueOf(workDay - 3));
// }
// if (timeoutDay < 0) {
// return 0;
// } else {
// return timeoutDay;
// }
// }
// //json串转化为json对象
// public static JSONObject getjson(String data) {
// JSONObject json = JSONObject.parseObject(data);
// return json;
// }
/*
*
*
* */
@RequestMapping(value = "/getTimeoutDay")
public long getWorkDayBetweenStartAndEnd(GetTime getTime) throws ParseException {
int i = archiveMasterService.selectWorkDateNum(getTime);
System.out.println("i:::::::::"+i);
return i;
}
}

@ -11,6 +11,10 @@ import com.emr.entity.OffsetLimitPage;
import com.emr.service.Archive_MasterService;
import com.emr.service.Emr_DictionaryService;
import com.emr.util.ThreadExcelUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
@ -20,9 +24,11 @@ import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -53,7 +59,7 @@ public class unfileMedicalController {
public void exportExcel(HttpServletResponse response, Archive_Master_Vo archiveMasterVo) throws Exception {
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
String[] header = {"病历清单id","住院号","住院次数","名字","性别","身份证","入院科室","入院日期","出院科室","出院日期","主管医生","状态","医生是否提交","医生","医生提交日期","护士是否提交","护士","护士提交日期","电子病历医生提交","电子病历护士提交","是否死亡"};
String[] fileNames = {"id","inpNo","visitId","name","sex","idNo","deptAdmissionTo","admissionDateTime","deptName","dischargeDateTime","doctorInCharge","archivestate","cmtDoctor","doctorName","cmtDoctorDate","cmtNurse","nurseName","cmtDurseDate","emrDoctorCmt","emrNureCmt","deathFlag"};
String[] fileNames = {"id","inpNo","visitId","name","sex","idNo","deptAdmissionTo","admissionDateTime","deptName","dischargeDateTime","doctorInCharge","archivestate","cmtDoctor","doctorName","cmtDoctorDate","cmtNurse","nurseName","cmtNurseDate","emrDoctorCmt","emrNureCmt","deathFlag"};
//文件名
String fileName = "未归档病历列表" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls";
//构造excel的数据
@ -88,6 +94,153 @@ public class unfileMedicalController {
}
}
@ResponseBody
@RequestMapping(value = "/exportExcel2")
public void exportBigDataExcel(HttpServletResponse response, Archive_Master_Vo archiveMasterVo)
throws Exception {
// 最重要的就是使用SXSSFWorkbook表示流的方式进行操作
// 在内存中保持100行超过100行将被刷新到磁盘
SXSSFWorkbook wb = new SXSSFWorkbook(1000);
Sheet sh = wb.createSheet(); // 建立新的sheet对象
Row row = sh.createRow(0); // 创建第一行对象
// -----------定义表头-----------
Cell cel0 = row.createCell(0);
cel0.setCellValue("病历清单id");
Cell cel2 = row.createCell(1);
cel2.setCellValue("住院号");
Cell cel3 = row.createCell(2);
cel3.setCellValue("住院次数");
Cell cel4 = row.createCell(3);
cel4.setCellValue("名字");
Cell cel5 = row.createCell(4);
cel5.setCellValue("性别");
Cell cel6 = row.createCell(5);
cel6.setCellValue("身份证");
Cell cel7 = row.createCell(6);
cel7.setCellValue("入院科室");
Cell cel8 = row.createCell(7);
cel8.setCellValue("入院日期");
Cell cel9 = row.createCell(8);
cel9.setCellValue("出院科室");
Cell cel10 = row.createCell(9);
cel10.setCellValue("出院日期");
Cell cel11 = row.createCell(10);
cel11.setCellValue("主管医生");
Cell cel12 = row.createCell(11);
cel12.setCellValue("状态");
Cell cel13 = row.createCell(12);
cel13.setCellValue("医生是否提交");
Cell cel14 = row.createCell(13);
cel14.setCellValue("医生");
Cell cel15 = row.createCell(14);
cel15.setCellValue("医生提交日期");
Cell cel16 = row.createCell(15);
cel16.setCellValue("护士是否提交");
Cell cel17 = row.createCell(16);
cel17.setCellValue("护士");
Cell cel18 = row.createCell(17);
cel18.setCellValue("护士提交日期");
Cell cel19 = row.createCell(18);
cel19.setCellValue("电子病历医生提交");
Cell cel20 = row.createCell(19);
cel20.setCellValue("电子病历护士提交");
Cell cel21 = row.createCell(20);
cel21.setCellValue("是否死亡");
List<Archive_Master_Vo> list = new ArrayList<Archive_Master_Vo>();
// 数据库中存储的数据行
int page_size = 10000;
// 求数据库中待导出数据的行数
Integer list_count = archiveMasterService.selectCountNum(archiveMasterVo);
System.out.println("list_count:::::"+list_count);
// 根据行数求数据提取次数
int export_times = list_count % page_size > 0 ? list_count / page_size
+ 1 : list_count / page_size;
// 按次数将数据写入文件
for (int j = 0; j < export_times; j++) {
list = archiveMasterService.selectByUnfileAndColumn(archiveMasterVo,j + 1, page_size);
int len = list.size() < page_size ? list.size() : page_size;
for (int i = 0; i < len; i++) {
Row row_value = sh.createRow(j * page_size + i + 1);
Cell cel0_value = row_value.createCell(0);
cel0_value.setCellValue(list.get(i).getId());
Cell cel2_value = row_value.createCell(1);
cel2_value.setCellValue(list.get(i).getInpNo());
Cell cel3_value = row_value.createCell(2);
cel3_value.setCellValue(list.get(i).getVisitId());
Cell cel4_value = row_value.createCell(3);
cel4_value.setCellValue(list.get(i).getName());
Cell cel5_value = row_value.createCell(4);
cel5_value.setCellValue(list.get(i).getSex());
Cell cel6_value = row_value.createCell(5);
cel6_value.setCellValue(list.get(i).getIdNo());
Cell cel7_value = row_value.createCell(6);
cel7_value.setCellValue(list.get(i).getDeptAdmissionTo());
Cell cel8_value = row_value.createCell(7);
cel8_value.setCellValue(list.get(i).getAdmissionDateTime());
Cell cel9_value = row_value.createCell(8);
cel9_value.setCellValue(list.get(i).getDeptName());
Cell cel10_value = row_value.createCell(9);
cel10_value.setCellValue(list.get(i).getDischargeDateTime());
Cell cel11_value = row_value.createCell(10);
cel11_value.setCellValue(list.get(i).getDoctorInCharge());
Cell cel12_value = row_value.createCell(11);
cel12_value.setCellValue(list.get(i).getArchivestate());
Cell cel13_value = row_value.createCell(12);
cel13_value.setCellValue(list.get(i).getCmtDoctor());
Cell cel14_value = row_value.createCell(13);
cel14_value.setCellValue(list.get(i).getDoctorName());
Cell cel15_value = row_value.createCell(14);
cel15_value.setCellValue(list.get(i).getCmtDoctorDate());
Cell cel16_value = row_value.createCell(15);
cel16_value.setCellValue(list.get(i).getCmtNurse());
Cell cel17_value = row_value.createCell(16);
cel17_value.setCellValue(list.get(i).getNurseName());
Cell cel18_value = row_value.createCell(17);
cel18_value.setCellValue(list.get(i).getCmtNurseDate());
Cell cel19_value = row_value.createCell(18);
cel19_value.setCellValue(list.get(i).getEmrDoctorCmt());
Cell cel20_value = row_value.createCell(19);
cel20_value.setCellValue(list.get(i).getEmrNureCmt());
Cell cel21_value = row_value.createCell(20);
cel21_value.setCellValue(list.get(i).getDeathFlag());
}
list.clear(); // 每次存储len行用完了将内容清空以便内存可重复利用
}
OutputStream os = response.getOutputStream();
//导出excel建议加上重置输出流可以不加该代码但是如果不加必须要保证输出流中不应该在存在其他数据否则导出会有问题
response.reset();
//处理乱码
String fileName = "未归档病历列表" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xlsx";
//attachment为以附件方式下载
response.setContentType("application/vnd.ms-excel");
//代码里面使用Content-Disposition来确保浏览器弹出下载对话框的时候。
response.setHeader("Content-disposition", "attachment;filename=" + fileName);
response.setBufferSize(1024);
/* File file = new File(filePath);
if (!file.exists()) {//文件夹不存在
file.mkdirs();//创建目录
}*/
//FileOutputStream fout = new FileOutputStream(new File(file, fileName));
try {
//wb.write(fout);
wb.write(os);//将excel中的数据写到输出流中用于文件的输出
os.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}

@ -191,4 +191,13 @@ public interface Archive_MasterMapper {
* @return
*/
List<Archive_Master_Vo> copyCountList(Archive_Master_Vo record);
/**
*
* @param archiveMasterVo
* @return
*/
Integer selectCountNum(Archive_Master_Vo archiveMasterVo);
}

@ -2,6 +2,8 @@ package com.emr.dao;
import com.emr.entity.MedicalRecordHomepageCache;
import com.emr.entity.MedicalRecordHomepageCacheExample;
import com.emr.vo.GetTime;
import java.util.List;
public interface MedicalRecordHomepageCacheMapper {
@ -18,4 +20,6 @@ public interface MedicalRecordHomepageCacheMapper {
int updateByPrimaryKeySelective(MedicalRecordHomepageCache record);
int updateByPrimaryKey(MedicalRecordHomepageCache record);
int selectWorkDateNum(GetTime getTime);
}

@ -0,0 +1,17 @@
package com.emr.dao;
import com.emr.vo.OverdueRemindVO;
public interface OverdueRemindMapper {
//查询主管医生id
String selectDoctorId(OverdueRemindVO overdueRemindVO);
//查询主管医医生有多少条超期记录
String selectoverdueNumAndDoctorId(OverdueRemindVO overdueRemindVO);
// 保存操作日志
int insertRemind(OverdueRemindVO overdueRemindVO);
//判断超期提醒状态
int selectOverdueStatcByDoctorId(OverdueRemindVO overdueRemindVO);
//修改日志超期提醒状态
int updatetOverdueStatcByDoctorId(OverdueRemindVO overdueRemindVO);
}

@ -178,8 +178,38 @@ public class Archive_Master_Vo {
//退回急诊室总数
private Integer backNum;
public Integer getOverTime() {
return overTime;
}
public void setOverTime(Integer overTime) {
this.overTime = overTime;
}
private String isFault;
private Integer overTime;
public Integer getCountNum() {
return countNum;
}
public void setCountNum(Integer countNum) {
this.countNum = countNum;
}
private Integer flag;
private Integer countNum;
public Integer getFlag() {
return flag;
}
public void setFlag(Integer flag) {
this.flag = flag;
}
public String getIsFault() {
return isFault;
}

@ -10,6 +10,7 @@ import com.emr.entity.Archive_Master;
import com.emr.entity.Archive_Master_Vo;
import com.emr.entity.Emr_Fault_Detail;
import com.emr.entity.OffsetLimitPage;
import com.emr.vo.GetTime;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@ -295,6 +296,24 @@ public interface Archive_MasterService {
* @return
*/
OffsetLimitPage copyCountList(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit);
/**
*
*
*
*
*
*/
int selectWorkDateNum(GetTime getTime);
/**
*
* @param archiveMasterVo
* @return
*/
Integer selectCountNum(Archive_Master_Vo archiveMasterVo);
}

@ -0,0 +1,17 @@
package com.emr.service;
import com.emr.vo.OverdueRemindVO;
public interface OverdueRemindService {
//查询主管医生id
String selectDoctorId(OverdueRemindVO overdueRemindVO);
//查询主管医医生有多少条超期记录
String selectoverdueNumAndDoctorId(OverdueRemindVO overdueRemindVO);
// 保存操作日志
int insertRemind(OverdueRemindVO overdueRemindVO);
//判断超期提醒状态
int selectOverdueStatcByDoctorId(OverdueRemindVO overdueRemindVO);
//修改日志超期提醒状态
int updatetOverdueStatcByDoctorId(OverdueRemindVO overdueRemindVO);
}

@ -11,6 +11,7 @@ import com.alibaba.fastjson.JSONObject;
import com.emr.dao.*;
import com.emr.util.HttpClientTool;
import com.emr.util.IDHelper;
import com.emr.vo.GetTime;
import com.emr.vo.Power_User_Dto;
import com.emr.entity.*;
import com.emr.service.Archive_MasterService;
@ -497,6 +498,7 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
@Override
public OffsetLimitPage selectOverdue(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit) {
PageHelper.offsetPage(offset, limit);
List<Archive_Master_Vo> list = archiveMasterMapper.selectOverdue(archiveMasterVo);
if(list!=null && list.size()>0) {
//查询用户集合
@ -811,6 +813,16 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
List<Archive_Master_Vo> list = archiveMasterMapper.copyCountList(archiveMasterVo);
return new OffsetLimitPage((Page) list);
}
@Override
public int selectWorkDateNum(GetTime getTime) {
return medicalRecordHomepageCacheMapper.selectWorkDateNum(getTime) ;
}
@Override
public Integer selectCountNum(Archive_Master_Vo archiveMasterVo) {
return archiveMasterMapper.selectCountNum(archiveMasterVo);
}
}

@ -0,0 +1,39 @@
package com.emr.service.ipml;
import com.emr.dao.Archive_MasterMapper;
import com.emr.dao.OverdueRemindMapper;
import com.emr.service.OverdueRemindService;
import com.emr.vo.OverdueRemindVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class OverdueRemindServiceImpl implements OverdueRemindService {
@Autowired
private OverdueRemindMapper overdueRemindMapper;
@Override
public String selectDoctorId(OverdueRemindVO overdueRemindVO) {
return overdueRemindMapper.selectDoctorId(overdueRemindVO);
}
@Override
public String selectoverdueNumAndDoctorId(OverdueRemindVO overdueRemindVO) {
return overdueRemindMapper.selectoverdueNumAndDoctorId(overdueRemindVO);
}
@Override
public int insertRemind(OverdueRemindVO overdueRemindVO) {
return overdueRemindMapper.insertRemind(overdueRemindVO);
}
@Override
public int selectOverdueStatcByDoctorId(OverdueRemindVO overdueRemindVO) {
return overdueRemindMapper.selectOverdueStatcByDoctorId(overdueRemindVO);
}
@Override
public int updatetOverdueStatcByDoctorId(OverdueRemindVO overdueRemindVO) {
return overdueRemindMapper.updatetOverdueStatcByDoctorId(overdueRemindVO);
}
}

@ -1,5 +1,6 @@
package com.emr.util;
import com.emr.entity.Archive_Master_Vo;
import com.emr.entity.Emr_Fault_Vo;
import org.apache.commons.beanutils.PropertyUtilsBean;
import org.apache.commons.collections.CollectionUtils;
@ -11,6 +12,7 @@ import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.*;
import java.beans.PropertyDescriptor;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.InvocationTargetException;
@ -38,6 +40,11 @@ public class ThreadExcelUtils {
private String[] hearders;
private String[] fields;
public ThreadExcelUtils(FileOutputStream fileOut) {
}
public Workbook getWb() {
return wb;
}
@ -225,6 +232,8 @@ public class ThreadExcelUtils {
return params;
}
/***
* 线sheet
*/

@ -0,0 +1,23 @@
package com.emr.vo;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
@Data
public class GetTime {
/** 开始时间 */
@DateTimeFormat(pattern="yyyy-MM-dd")
private String startTime;
/** 结束时间 */
@DateTimeFormat(pattern="yyyy-MM-dd")
private String endTime;
/** id */
private Integer id;
/** 时间 */
private String date;
/** 1工作日 2休息日 */
private String flag;
}

@ -0,0 +1,32 @@
package com.emr.vo;
import lombok.Data;
import java.util.Date;
@Data
public class OverdueRemindVO {
/** 用户Id */
private Integer userId;
/** power_user表的工号Id */
private String userName;
/** 超期数量 */
private String overdueNum;
/**主治医生Id */
private String doctorInCharge;
/** Master_Following表的工号Id */
private String handleId;
/**姓名 */
private String handleName;
/**出院时间 */
private Date dischargeDateTime;
/**归档时间 */
private Date handleTime;
/**id */
private Integer id;
/**i提醒状态1、未读2、已读*/
private Integer reminderStatus;
/**提醒时间*/
private Date reminderTime;
private String DOCTOR_IN_CHARGE;
}

@ -46,6 +46,7 @@
<result column="print_num" jdbcType="NVARCHAR" property="printNum"/>
</resultMap>
<resultMap id="BaseResultMap2" type="com.emr.entity.Archive_Master_Vo">
<id column="id" jdbcType="NVARCHAR" property="id" />
<result column="patient_id" jdbcType="NVARCHAR" property="patientId" />
@ -104,6 +105,9 @@
<result column="delay_num" jdbcType="INTEGER" property="delayNum" />
<result column="quality_num" jdbcType="INTEGER" property="qualityNum" />
<result column="back_num" jdbcType="INTEGER" property="backNum" />
<result column="overTime" jdbcType="INTEGER" property="overTime" />
<result column="flag" jdbcType="INTEGER" property="flag" />
<result column="countNum" jdbcType="INTEGER" property="countNum" />
</resultMap>
<sql id="Base_Column_List">
id, patient_id, inp_no, visit_id, name, sex, dept_name, discharge_date_time, ArchiveState,
@ -671,12 +675,18 @@
,CONVERT(varchar(10),m.discharge_date_time, 120) discharge_date_time,m.ArchiveState,CONVERT(varchar(10),m.admission_date_time, 120) admission_date_time,ISNULL(d.name,m.dept_admission_to) dept_admission_to
,m.check_doctor,m.checked_datetime,m.checked_doctor,m.LockInfo,m.DOCTOR_IN_CHARGE,m.ID_NO,m.DISCHARGE_DISPOSITION,m.dept_code_lend,m.isscaned,
m.cmt_doctor,m.cmt_nurse,m.doctor_name,m.nurse_name,m.cmt_doctor_date,m.cmt_nurse_date,m.emr_doctor_cmt,m.emr_nure_cmt,m.death_flag,m.is_scanning,
m.bed_number,ISNULL(s.numb, 0) numb,ISNULL(amf.num, 0) checkFlag
m.bed_number,ISNULL(s.numb, 0) numb,ISNULL(amf.num, 9) checkFlag
,ISNULL(sDoctor.numb, 0) faultDoctorNum,ISNULL(sNurse.numb, 0) faultNurseNum,ISNULL(printTable.num, 0) printNum
from archive_master m
LEFT JOIN(select master_id,count(*) num from Archive_Master_Following where following_type=5 GROUP BY master_id ) amf
LEFT JOIN(SELECT amfa.id ,amfa.master_id, amfa.following_type num FROM Archive_Master_Following amfa left join
(SELECT amfb.master_id ida,max(handle_time) t FROM Archive_Master_Following amfb GROUP BY master_id) amfc
on amfa.master_id = amfc.ida
AND amfa.handle_time = amfc.t
WHERE ida is not NULL
AND t is not null
AND following_type in (5,9)) amf
on m.id=amf.master_id
LEFT JOIN(select archive_detail_id,count(*) numb from emr_fault_detail where 1=1 and back_flag in ('1','5') GROUP BY archive_detail_id) sDoctor
LEFT JOIN(select archive_detail_id,count(*) numb from emr_fault_detail where 1=1 and back_flag in ('1','5') GROUP BY archive_detail_id) sDoctor
on m.id=sDoctor.archive_detail_id
LEFT JOIN(select archive_detail_id,count(*) numb from emr_fault_detail where 1=1 and back_flag in ('2','6') GROUP BY archive_detail_id) sNurse
on m.id=sNurse.archive_detail_id
@ -1446,26 +1456,41 @@
<!--初次提交归档-->
<select id="selectOverdue" parameterType="com.emr.entity.Archive_Master_Vo" resultMap="BaseResultMap2">
select f.id,f.handle_name,f.handle_id,f.handle_time,ISNULL(DATEDIFF(dd,CONVERT(VARCHAR(20),m.discharge_date_time,23),CONVERT(VARCHAR(20),f.handle_time,23)), 0) diffDay,
<if test="overdueDays != null and overdueDays != ''">
case
when ISNULL(datediff(day,convert(varchar(100),m.mid_date,23),convert(varchar(100),f.handle_time,23)),0)&lt;=0
then '0'
when ISNULL( datediff(day,convert(varchar(100),m.mid_date,23),convert(varchar(100),f.handle_time,23)),0)+ISNULL(m.dayOne,0)-1-cast(#{overdueDays,jdbcType=NCHAR} as int)&lt;0
then '0'
when ISNULL(m.dayOne,0)>=0 and ISNULL( datediff(day,convert(varchar(100),m.mid_date,23),convert(varchar(100),f.handle_time,23)),0)>=0
then ISNULL( datediff(day,convert(varchar(100),m.mid_date,23),convert(varchar(100),f.handle_time,23)),0)+ISNULL(m.dayOne,0)-1-cast(#{overdueDays,jdbcType=NCHAR} as int)
else '0'
end overdue
</if>
<if test="overdueDays == null or overdueDays == ''">
case
when ISNULL( datediff(day,convert(varchar(100),m.mid_date,23),convert(varchar(100),f.handle_time,23)),0)+ISNULL(m.dayOne,0)-1-3&lt;0
then '0'
when ISNULL(m.dayOne,0)>=0 and ISNULL( datediff(day,convert(varchar(100),m.mid_date,23),convert(varchar(100),f.handle_time,23)),0)>=0
then ISNULL( datediff(day,convert(varchar(100),m.mid_date,23),convert(varchar(100),f.handle_time,23)),0)+ISNULL(m.dayOne,0)-1-3
else '0'
end overdue
</if>
(
CASE
WHEN (
(
SELECT
count(1)
FROM
emr_holiday_set
WHERE
flag = 1
AND date >= CONVERT (
VARCHAR (10),
m.discharge_date_time,
23
)
AND date &lt;= f.handle_time
) - 3
) &lt;= 0 THEN 0 else
(
(
SELECT
count(1)
FROM
emr_holiday_set
WHERE
flag = 1
AND date >= CONVERT (
VARCHAR (10),
m.discharge_date_time,
23
)
AND date &lt;= f.handle_time
) - 3
)
end) as overTime
,m.master_id,m.patient_id,m.inp_no,m.visit_id,m.name,ISNULL(c.name,m.dept_name) dept_name,m.discharge_date_time,m.DOCTOR_IN_CHARGE,m.first_instance,m.death_flag,ISNULL(e.name,m.dept_admission_to) dept_admission_to,admission_date_time
from (
select id,master_id ,convert(varchar,handle_time,120) handle_time ,handle_id,handle_name,following_type from (
@ -1479,6 +1504,7 @@
convert(varchar(10),(DATEADD(DAY,cast(#{overdueDays,jdbcType=NCHAR} as int)-1,convert(varchar(10),discharge_date_time,23))),23) mid_date
,ISNULL(dbo.getWorkday(convert(varchar(10),discharge_date_time,23),convert(varchar(10),(DATEADD(DAY,cast(#{overdueDays,jdbcType=NCHAR} as int),convert(varchar(10),discharge_date_time,23))),23)) , 0) dayOne
</if>
<if test="overdueDays == null and overdueDays == ''">overTime => #{overdueDays }</if>
<if test="overdueDays == null or overdueDays == ''">
convert(varchar(10),(DATEADD(DAY,2,convert(varchar(10),discharge_date_time,23))),23) mid_date
,ISNULL(dbo.getWorkday(convert(varchar(10),discharge_date_time,23),convert(varchar(10),(DATEADD(DAY,3,convert(varchar(10),discharge_date_time,23))),23)) , 0) dayOne
@ -1501,6 +1527,7 @@
<if test="(overdueDaysTwo != null and overdueDaysTwo != '') and (overdueDays == null or overdueDays == '')">
and ISNULL( datediff(day,convert(varchar(100),m.mid_date,23),convert(varchar(100),f.handle_time,23)),0)+ISNULL(m.dayOne,0)-1-3>=#{overdueDaysTwo,jdbcType=NCHAR}
</if>
<!--<if test="(overdueDaysTwo == null or overdueDaysTwo == '') and (overdueDays == null or overdueDays == '')">
and ISNULL( datediff(day,convert(varchar(100),m.mid_date,23),convert(varchar(100),f.handle_time,23)),0)+ISNULL(m.dayOne,0)-1-3>=0
</if>-->
@ -1583,23 +1610,23 @@
select id,master_id,following_type,following_content,handle_name,handle_time,ROW_NUMBER() OVER (partition by master_id ORDER BY master_id,handle_time) as rowNumb from Archive_Master_Following where following_type='9'
)f1
LEFT JOIN (
select *,
<if test="overdueDays != null and overdueDays != ''">
convert(varchar(10),(DATEADD(DAY,cast(#{overdueDays,jdbcType=NCHAR} as int)-1,convert(varchar(10),handle_time,23))),23) mid_date
,ISNULL(dbo.getWorkday(convert(varchar(10),handle_time,23),convert(varchar(10),(DATEADD(DAY,cast(#{overdueDays,jdbcType=NCHAR} as int),convert(varchar(10),handle_time,23))),23)) , 0) dayOne
</if>
<if test="overdueDays == null or overdueDays == ''">
convert(varchar(10),(DATEADD(DAY,cast('2' as int),convert(varchar(10),handle_time,23))),23) mid_date
,ISNULL(dbo.getWorkday(convert(varchar(10),handle_time,23),convert(varchar(10),(DATEADD(DAY,cast('3' as int),convert(varchar(10),handle_time,23))),23)) , 0) dayOne
</if>
from(
select *,ROW_NUMBER() OVER (partition by master_id ORDER BY master_id,handle_time) as rowNumb from Archive_Master_Following where following_type='5'
)a
select *,
<if test="overdueDays != null and overdueDays != ''">
convert(varchar(10),(DATEADD(DAY,cast(#{overdueDays,jdbcType=NCHAR} as int)-1,convert(varchar(10),handle_time,23))),23) mid_date
,ISNULL(dbo.getWorkday(convert(varchar(10),handle_time,23),convert(varchar(10),(DATEADD(DAY,cast(#{overdueDays,jdbcType=NCHAR} as int),convert(varchar(10),handle_time,23))),23)) , 0) dayOne
</if>
<if test="overdueDays == null or overdueDays == ''">
convert(varchar(10),(DATEADD(DAY,cast('2' as int),convert(varchar(10),handle_time,23))),23) mid_date
,ISNULL(dbo.getWorkday(convert(varchar(10),handle_time,23),convert(varchar(10),(DATEADD(DAY,cast('3' as int),convert(varchar(10),handle_time,23))),23)) , 0) dayOne
</if>
from(
select *,ROW_NUMBER() OVER (partition by master_id ORDER BY master_id,handle_time) as rowNumb from Archive_Master_Following where following_type='5'
)a
)f2
on f1.master_id=f2.master_id and f1.rowNumb=f2.rowNumb-1
LEFT JOIN (
select id master_id,patient_id,inp_no,visit_id,name,dept_name,convert(varchar,discharge_date_time,120) discharge_date_time,check_doctor,first_instance,DOCTOR_IN_CHARGE,death_flag,dept_admission_to,convert(varchar,admission_date_time,120) admission_date_time
from archive_master where 1=1 and ArchiveState not in('作废','已封存','取消入院') and Is_Valid!=1
select id master_id,patient_id,inp_no,visit_id,name,dept_name,convert(varchar,discharge_date_time,120) discharge_date_time,check_doctor,first_instance,DOCTOR_IN_CHARGE,death_flag,dept_admission_to,convert(varchar,admission_date_time,120) admission_date_time
from archive_master where 1=1 and ArchiveState not in('作废','已封存','取消入院') and Is_Valid!=1
) m
on f1.master_id=m.master_id
LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where typeCode='dept_code' )) c
@ -2038,4 +2065,144 @@
group by patient_id,admiss_id, admiss_times, name , convert(date, print_createtime, 8)
</select>
<select id="selectCountNum" parameterType="com.emr.entity.Archive_Master_Vo" resultType="java.lang.Integer">
select COUNT(m.ID) as countNum
from archive_master m
LEFT JOIN(SELECT amfa.id ,amfa.master_id, amfa.following_type num FROM Archive_Master_Following amfa left join
(SELECT amfb.master_id ida,max(handle_time) t FROM Archive_Master_Following amfb GROUP BY master_id) amfc
on amfa.master_id = amfc.ida
AND amfa.handle_time = amfc.t
WHERE ida is not NULL
AND t is not null
AND following_type in (5,9)) amf
on m.id=amf.master_id
LEFT JOIN(select archive_detail_id,count(*) numb from emr_fault_detail where 1=1 and back_flag in ('1','5') GROUP BY archive_detail_id) sDoctor
on m.id=sDoctor.archive_detail_id
LEFT JOIN(select archive_detail_id,count(*) numb from emr_fault_detail where 1=1 and back_flag in ('2','6') GROUP BY archive_detail_id) sNurse
on m.id=sNurse.archive_detail_id
LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where
typeCode='dept_code' )) d
on m.dept_admission_to=d.code
LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where
typeCode='dept_code' )) f
on m.dept_name=f.code
LEFT JOIN(select archive_detail_id,count(*) numb from emr_fault_detail where 1=1 and back_flag is not null GROUP BY archive_detail_id) s
on m.id=s.archive_detail_id
LEFT JOIN (select MasterID,COUNT(*) num from archive_printInfo group by MasterID) printTable
on m.id=printTable.MasterID
where 1=1
and patindex('%B%',m.inp_no) in (0,1)
and m.ArchiveState not in('作废','已封存') and m.Is_Valid!=1 and inp_no not like 'LG%'
<if test="printNum != null and printNum != ''">
<choose>
<when test="printNum == 1">
and printTable.MasterID is not null
</when>
<otherwise>and printTable.MasterID is null</otherwise>
</choose>
</if>
<if test="inpNo != null and inpNo != ''">
and m.inp_no like '%'+#{inpNo,jdbcType=NCHAR}+'%'
</if>
<if test="bedNumber != null and bedNumber != ''">
and m.bed_number like '%'+#{bedNumber,jdbcType=NVARCHAR}+'%'
</if>
<if test="visitId != null and visitId != ''">
and m.visit_id=#{visitId,jdbcType=NCHAR}
</if>
<if test="name != null and name != ''">
and m.name like '%'+#{name,jdbcType=NCHAR}+'%'
</if>
<if test="archivestate != null and archivestate != ''">
and m.ArchiveState in
<foreach item="item" collection="archivestate.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="idNo != null and idNo != ''">
and m.ID_NO like '%'+#{idNo,jdbcType=NCHAR}+'%'
</if>
<if test="sex != null">
and m.sex = #{sex,jdbcType=NVARCHAR}
</if>
<if test="deptName!= null and deptName!= ''">
and m.dept_name in
<foreach item="item" collection="deptName.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="deptAdmissionTo != null and deptAdmissionTo!=''">
and m.dept_admission_to in
<foreach item="item" collection="deptAdmissionTo.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<!--<if test="deptAdmissionTo != null and deptAdmissionTo!=''">-->
<!--and m.dept_admission_to = #{deptAdmissionTo,jdbcType=NVARCHAR}-->
<!--</if>-->
<if test="dischargeDateTime != null">
and m.discharge_date_time = #{dischargeDateTime,jdbcType=NVARCHAR}
</if>
<choose>
<when test="startDateTo != null and startDateTo != '' and endDateTo != null and endDateTo != ''">
and m.discharge_date_time between CONVERT(VARCHAR(10),#{startDateTo,jdbcType=NCHAR},120) and
#{endDateTo,jdbcType=NCHAR}+ ' 23:59:59'
</when>
<when test="startDateTo != null and startDateTo != ''">
and m.discharge_date_time >= CONVERT(VARCHAR(10),#{startDateTo,jdbcType=NCHAR},120)
</when>
<when test="endDateTo != null and endDateTo != ''">
and m.discharge_date_time &lt;= #{endDateTo,jdbcType=NCHAR}+ ' 23:59:59'
</when>
</choose>
<choose>
<when test="startDate != null and startDate != '' and endDate != null and endDate != ''">
and m.admission_date_time between CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120) and
#{endDate,jdbcType=NCHAR}+ ' 23:59:59'
</when>
<when test="startDate != null and startDate != ''">
and m.admission_date_time >= CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120)
</when>
<when test="endDate != null and endDate != ''">
and m.admission_date_time &lt;= #{endDate,jdbcType=NCHAR}+ ' 23:59:59'
</when>
</choose>
<if test="checkDoctor != null">
and m.check_doctor = #{checkDoctor,jdbcType=NVARCHAR}
</if>
<if test="checkedDoctor != null">
and m.checked_doctor = #{checkedDoctor,jdbcType=NVARCHAR}
</if>
<if test="checkDatetime != null">
and m.check_datetime = #{checkDatetime,jdbcType=NVARCHAR}
</if>
<if test="checkedDatetime != null">
and m.checked_datetime = #{checkedDatetime,jdbcType=NVARCHAR}
</if>
<if test="lockinfo != null">
and m.LockInfo = #{lockinfo,jdbcType=NVARCHAR}
</if>
<if test="doctorInCharge != null">
and m.DOCTOR_IN_CHARGE = #{doctorInCharge,jdbcType=NVARCHAR}
</if>
<if test="dischargeDisposition != null">
and m.DISCHARGE_DISPOSITION = #{dischargeDisposition,jdbcType=NVARCHAR}
</if>
<if test="deptCodeLend != null">
and m.dept_code_lend = #{deptCodeLend,jdbcType=NVARCHAR}
</if>
<if test="isscaned != null and isscaned != ''">
and m.isscaned = #{isscaned,jdbcType=NVARCHAR}
</if>
<if test="isScanning != null and isScanning != ''">
and m.is_scanning = #{isScanning,jdbcType=NVARCHAR}
</if>
<if test="deathFlag != null and deathFlag != ''">
and m.death_flag = #{deathFlag,jdbcType=NVARCHAR}
</if>
</select>
</mapper>

@ -835,40 +835,40 @@
select a.archive_detail_id,a.creater,convert(varchar,a.create_time,120) create_time,m.inp_no,m.visit_id,m.name,a.content,convert(varchar,m.discharge_date_time,120)
discharge_date_time,m.dept_name,m.ArchiveState,isnull(m.score,0) score,m.DOCTOR_IN_CHARGE
from(
select DISTINCT archive_detail_id,content,creater,create_time from emr_fault_detail
where 1=1 and back_flag in(5,6) and assort_id is not null and assort_id!=''
select DISTINCT archive_detail_id,content,creater,create_time from emr_fault_detail
where 1=1 and back_flag in(5,6) and assort_id is not null and assort_id!=''
)a
left join(
select m.id,m.inp_no,m.visit_id,m.name,m.discharge_date_time,m.dept_name,m.ArchiveState, score,m.DOCTOR_IN_CHARGE
from Archive_Master m where 1=1 and ArchiveState not in('作废','已封存','') and ArchiveState is not null and Is_Valid!=1
)m
on a.archive_detail_id=m.id
<where> 1=1 and ArchiveState not in('作废','已封存','','取消入院') and ArchiveState is not null
<if test="archiveDetailId != null and archiveDetailId != ''">
and a.archive_detail_id=#{archiveDetailId,jdbcType=NCHAR}
</if>
<if test="updater!= null and updater!= ''">
and a.creater in
<foreach item="item" collection="updater.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="inpNo != null and inpNo != ''">
and m.inp_no like '%'+#{inpNo,jdbcType=NCHAR}+'%'
</if>
<if test="visitId != null and visitId != ''">
and m.visit_id=#{visitId,jdbcType=NCHAR}
</if>
<if test="name != null and name != ''">
and m.name like '%'+#{name,jdbcType=NCHAR}+'%'
</if>
<if test="deptName!= null and deptName!= ''">
and m.dept_name in
<foreach item="item" collection="deptName.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="deptAdmissionTo != null and deptAdmissionTo!=''">
<where> 1=1 and ArchiveState not in('作废','已封存','','取消入院') and ArchiveState is not null
<if test="archiveDetailId != null and archiveDetailId != ''">
and a.archive_detail_id=#{archiveDetailId,jdbcType=NCHAR}
</if>
<if test="updater!= null and updater!= ''">
and a.creater in
<foreach item="item" collection="updater.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="inpNo != null and inpNo != ''">
and m.inp_no like '%'+#{inpNo,jdbcType=NCHAR}+'%'
</if>
<if test="visitId != null and visitId != ''">
and m.visit_id=#{visitId,jdbcType=NCHAR}
</if>
<if test="name != null and name != ''">
and m.name like '%'+#{name,jdbcType=NCHAR}+'%'
</if>
<if test="deptName!= null and deptName!= ''">
and m.dept_name in
<foreach item="item" collection="deptName.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="deptAdmissionTo != null and deptAdmissionTo!=''">
and m.dept_admission_to in
<foreach item="item" collection="deptAdmissionTo.split(',')" open="(" separator="," close=")">
#{item}

@ -134,4 +134,16 @@
is_add = #{isAdd,jdbcType=INTEGER}
where master_id = #{masterId,jdbcType=VARCHAR}
</update>
<select id="selectWorkDateNum" parameterType="com.emr.vo.GetTime">
select count(id)
<where>
<if test="startTime != null and startTime!=''">AND DATE_FORMAT(a.date,'%Y-%m-%d') &gt;=
DATE_FORMAT(#{startTime},'%Y-%m-%d')</if>
<if test="endTime != null and endTime!=''">AND DATE_FORMAT(a.date,'%Y-%m-%d') &lt;=
DATE_FORMAT(#{endTime},'%Y-%m-%d')</if>
<if test="2==2">AND a.flag=2 </if>
</where>
from emr_holiday_set a
</select>
</mapper>

@ -0,0 +1,88 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.emr.dao.OverdueRemindMapper">
<select id="selectDoctorId" parameterType="com.emr.vo.OverdueRemindVO" resultType="java.lang.String">
select user_name from power_user where user_id=#{userId}
</select>
<select id="selectoverdueNumAndDoctorId" parameterType="com.emr.vo.OverdueRemindVO" resultType="java.lang.String">
select COUNT(*)as overdueNum from Archive_Master a
left JOIN power_user b on b.user_name=a.DOCTOR_IN_CHARGE
left JOIN Archive_Master_Following f on f.handle_name=a.DOCTOR_IN_CHARGE
where a.DOCTOR_IN_CHARGE=#{doctorInCharge} and a.DOCTOR_IN_CHARGE is not null and a.DOCTOR_IN_CHARGE!=''
and 3> (
CASE
WHEN (
(
SELECT
count(1)
FROM
emr_holiday_set
WHERE
flag = 1
AND date >= CONVERT (
VARCHAR (10),
a.discharge_date_time,
23
)
AND date &lt;= f.handle_time
) - 3
) &lt;= 0 THEN 0 else
(
(
SELECT
count(1)
FROM
emr_holiday_set
WHERE
flag = 1
AND date >= CONVERT (
VARCHAR (10),
a.discharge_date_time,
23
)
AND date &lt;= f.handle_time
) - 3
)
end)
GROUP BY a.DOCTOR_IN_CHARGE
</select>
<insert id="insertRemind" parameterType="com.emr.vo.OverdueRemindVO"
keyProperty="id" useGeneratedKeys="true">
INSERT INTO reminder_journal
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="DOCTOR_IN_CHARGE != null">DOCTOR_IN_CHARGE,</if>
REMINDER_STATUS,
REMINDER_TIME
</trim>
<trim prefix=" VALUES(" suffix=")" suffixOverrides=",">
<if test="DOCTOR_IN_CHARGE != null">#{DOCTOR_IN_CHARGE},</if>
1,
getdate()
</trim>
</insert>
<select id="selectOverdueStatcByDoctorId" parameterType="com.emr.vo.OverdueRemindVO" resultType="java.lang.Integer" >
select COUNT(*)
from reminder_journal
where DOCTOR_IN_CHARGE=#{doctorInCharge} and
REMINDER_STATUS='2' and
CONVERT(varchar(8),GETDATE(),112) &lt;= REMINDER_TIME and
REMINDER_TIME &lt;= dateadd(day,1,CONVERT(varchar(8),GETDATE(),112))
</select>
<update id="updatetOverdueStatcByDoctorId" parameterType="com.emr.vo.OverdueRemindVO">
update reminder_journal set REMINDER_STATUS='2'
where
DOCTOR_IN_CHARGE=#{doctorInCharge} and
CONVERT(varchar(8),GETDATE(),112) &lt;= REMINDER_TIME and
REMINDER_TIME &lt;= dateadd(day,1,CONVERT(varchar(8),GETDATE(),112))
</update>
</mapper>

@ -17,12 +17,13 @@
var strSplit = $("#strSplit").val();
var ws = new WebSocket("ws://" + webSocketUrl);
ws.onopen = function () {
ws.send(userId);
ws.send("emr_medical_record_"+userId);
console.log("连接...")
}
//处理服务器发送来的数据
ws.onmessage = function (e) {
debugger
var msg = e.data.split(strSplit);
var a1 = msg[0];
if (msg.length == 5 && msg[2] == 2) {
@ -49,9 +50,16 @@
text: text,
timeout: 1000 * 60,
buttons: [{
text: '查看详情',
text: '已读',
click: function (e) {
noticeManage1(noticeId)
$.ajax({
url:"${path}/font/updatetOverdueStatc",
type : "POST",
data:{"userId":userId},
success:function (data) {
}
})
}
}]
})

@ -162,6 +162,7 @@
</form>
<!--数据表格-->
<table id="table" class="table text-nowrap table-striped"></table>
<div id="toolbar" class="btn-group pull-right toolbarCss" >
@ -1179,7 +1180,7 @@
window.location.href = "${path}/fault/exportExcel?inpNo=" + inpNo + "&visitId=" + visitId +
"&name=" + name + "&startDate=" + startDate + "&endDate=" + endDate + "&archivestate=" + archivestate+
"&deptName="+ deptName + "&doctorInCharge=" + doctorInCharge
+ "&assortId=" + assortId + "&creater=" + creater+"&backFlag="+backFlag;
+ "&assortId=" + assortId + "&creater=" + creater+"&backFlag="+backFlag+"&score="+score;
});

@ -35,7 +35,17 @@
</style>
<script type="text/javascript">
$(function () {
let val = $("#userId").val();
$.ajax({
url:"${path}/font/sendMessageWith",
type:"post",
data:{"userId":val},
success:function (data) {
}
})
// $.ajaxSetup({
// contentType: "application/x-www-form-urlencoded;charset=utf-8",
// complete: function (XMLHttpRequest, textStatus) {

@ -3844,11 +3844,11 @@
var redFlag = row.numb;
if (redFlag != 0) {
//有退回给医生的缺陷
if(row.faultDoctorNum!= 0){
if(row.faultDoctorNum!= 0 && row.faultNurseNum!=null){
html = html + '<button type="button" class="btn btn-sm btn-info getQXDoctorInfo">医生查看缺陷</button>';
}
//有退回给护士的缺陷
if(row.faultNurseNum!= 0){
if(row.faultNurseNum!= 0 && row.faultNurseNum!=null){
html = html + '<button type="button" class="btn btn-sm btn-info getQXNurseInfo">护士查看缺陷</button>';
}
}

@ -306,8 +306,6 @@
//myTab
// var deptAdmissionTo = url.substring(url.lastIndexOf('&') + 1).replace("depts=", "");
// if (deptAdmissionTo == null || deptAdmissionTo == '') {
@ -330,9 +328,9 @@
var currDate30=getCurrDay30();
$('#startDate').val(currDate30);
$('#endDate').val(currDate);*/
function getDept() {
//获取科室列表
$.ajax({
url: "${path}/inHosp/getDept",
type: "POST",
@ -351,7 +349,7 @@
});
}
getDept();
getDept();
/**
* 根据两个日期,判断相差天数
@ -547,7 +545,6 @@
field: 'deathFlag',
align: 'center',
formatter: function (value, row, index) {
var result = "";
var days=0;//当天-出院-7
if (row.dischargeDateTime != null && row.dischargeDateTime != "") {
days = daysBetween(currDay, row.dischargeDateTime.split(" ")[0]);
@ -567,6 +564,7 @@
}
return result;
}
},
{
title: '间隔天数',
@ -576,21 +574,22 @@
},
{
title: '超期天数',
field: 'overdue',
field: 'overTime',
align: 'center',
valign: 'middle',
/* formatter: function (value, row, index) {
var overdueDays=$("#overdueDays").val();
if(overdueDays!=null && overdueDays>0){
return row.overdue-overdueDays;
}else{
return row.overdue;
}
}*/
<%--formatter: function (value, row, index) {--%>
<%--$.ajax({--%>
<%--url: "${path}/medicalOverdue/getTimeoutDay",--%>
<%--type: "POST",--%>
<%--data: {startTime: row.dischargeDateTime, endTime: row.handleTime},--%>
<%--success: function (TimeoutdData) {--%>
<%--alert(TimeoutdData)--%>
<%--}--%>
<%--});--%>
<%--}--%>
},
],
onLoadSuccess: function (result) { //加载成功时执行
// console.info("加载成功");
onLoadSuccess: function (result) {
tipLoad = 0;
},
onLoadError: function () { //加载失败时执行
@ -603,6 +602,8 @@
}
//查询
$('#searchBtn').click(function () {
if (tipLoad == 0) {

@ -3219,9 +3219,12 @@
if (redFlag == 0) {
if (value == 1) {
a = '<span style="color:orange;"><i class="glyphicon glyphicon-ok-circle" aria-hidden="true"></i>已提交</span>';
} else {
} else if (value !=1 &&row.nurseName==null) {
a = '<span style="color:red;"><i class="glyphicon glyphicon-ban-circle" aria-hidden="true"></i>未提交</span>';
}else {
a = '<span style="color:orange;"><i class="glyphicon glyphicon-ok-circle" aria-hidden="true"></i>已提交</span>';
}
} else {
//有缺陷显示红色
if (value == 1) {
@ -4092,7 +4095,7 @@
var deathFlag = $("#deathFlag").val();
var printNum = $("#printNum").val();
window.location.href = "${path}/unfile/exportExcel?inpNo=" + inpNo + "&visitId=" + visitId +
window.location.href = "${path}/unfile/exportExcel2?inpNo=" + inpNo + "&visitId=" + visitId +
"&name=" + name + "&deptName=" + deptName + "&deptAdmissionTo=" + deptAdmissionTo + "&archivestate=" + archivestate
+ "&startDateTo=" + startDateTo + "&endDateTo=" + endDateTo + "&startDate=" + startDate + "&endDate=" + endDate
+ "&bedNumber=" + bedNumber + "&deathFlag=" + deathFlag + "&printNum=" + printNum;

Loading…
Cancel
Save