新增 广总血透需求

BUG修改
master
jian.wang 2 years ago
parent b8198199d8
commit 86576c789c

@ -27,6 +27,8 @@ import com.emr.vo.EmrPrintOrDownLoadInfo.EmrPrintOrDownLoadInfoVo;
import com.emr.vo.FontVo.ScanAssortVo;
import com.emr.vo.browseRecords;
import com.emr.vo.commomSearch.*;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.util.CollectionUtils;
@ -47,6 +49,7 @@ import java.net.InetAddress;
import java.net.UnknownHostException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
* @ProjectName:CommomSearchController
@ -128,6 +131,68 @@ public class CommomSearchController {
return "recordManage/commomSearch/commomListqf";
}
@RequiresPermissions("/commom/imgStatisticsList")
@OptionalLog(module = "查看", methods = "常用查询页面")
@RequestMapping("imgStatisticsList")
public String imgStatisticsList(Model model, HttpServletRequest request) {
return "recordManage/commomSearch/imgStatisticsList";
}
/**
* @Description:
* @param page
* @param limit
* @param commomVo
* @return
*/
@RequestMapping("queryImgStatistics")
@ResponseBody
public String queryImgStatistics(Integer page, Integer limit,CommomVo commomVo){
if(null != page && null != limit){
PageHelper.startPage(page, limit);
}
try{
double totalImgSum = 0;
double totalPeriodsSum = 0;
//查询期数对应的图像数量
List<Map<String,Object>> dataImgMap = commomMapper.queryImgStatistics(commomVo);
//查询期数对应的条数
List<Map<String,Object>> dataCountMap = commomMapper.queryPeriodsStatistics(commomVo);
//合并
for(Map<String,Object> imgMap : dataImgMap){
for(Map<String,Object> countMap : dataCountMap){
if(imgMap.get("periods").equals(countMap.get("periods"))){
imgMap.put("periodsNum",countMap.get("periodsNum"));
break;
}
}
}
//计算图像数量总和
if(!CollectionUtils.isEmpty(dataImgMap)){
for(Map<String,Object> map : dataImgMap){
double imgNum = ObjectUtils.isEmpty(map.get("imgNum")) ? 0 : Double.parseDouble(map.get("imgNum").toString());
double periodsNum = ObjectUtils.isEmpty(map.get("periodsNum")) ? 0 : Double.parseDouble(map.get("periodsNum").toString());
totalImgSum += imgNum;
totalPeriodsSum += periodsNum;
}
}
Map<String,Object> totalMap = new HashMap<>();
totalMap.put("periods",0);
totalMap.put("imgNum",totalImgSum);
totalMap.put("periodsNum",totalPeriodsSum);
dataImgMap.add(totalMap);
PageInfo pageInfo = new PageInfo<>(dataImgMap);
return JSON.toJSONString(pageInfo);
}catch (Exception e){
ExceptionPrintUtil.printException(e);
e.printStackTrace();
return null;
}
}
/**
* @description:
* @params: Initialization

@ -1032,9 +1032,9 @@ public class ApproveController {
String applyType = request.getParameter("applyType");
String applyReason = request.getParameter("applyReason");
//属性名
String[] fieldNames = {"inpatientNo","name","admissTimes"};
String[] fieldNames = {"inpatientNo","name","admissTimes","disDate","bornDate"};
//判断集中类中的方法名
String[] judgeMethods = {"judgeInpatientNo1","judgeName","judgeAdmissTimes"};
String[] judgeMethods = {"judgeInpatientNo1","judgeName","judgeAdmissTimes",null,null};
Emr_Apply_Approve applyApprove = new Emr_Apply_Approve();
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER");

@ -29,6 +29,13 @@ public interface CommomMapper {
List<String> selectPatientIdByAdmissTimesAndInpatientNoAndName(
@Param("admissTimes") Short admissTimes,@Param("inpatientNo") String inpatientNo,
@Param("name")String name,@Param("startTime2")String startTime2,@Param("endTime2")String endTime2);
/**
* patientId
* */
List<String> selectRecordInfo(
@Param("admissTimes") Short admissTimes,@Param("inpatientNo") String inpatientNo,
@Param("name")String name,@Param("disDate")String disDate,@Param("bornDate")String bornDate);
/**
* patientId
* */
@ -153,4 +160,8 @@ public interface CommomMapper {
CommomVo getCommomTableList(@Param("inpatientNo") String inpatientNo, @Param("disDate") String disDate);
Map<String, Object> queryTableConfig(String dataSource);
List<Map<String, Object>> queryImgStatistics(CommomVo commomVo);
List<Map<String, Object>> queryPeriodsStatistics(CommomVo commomVo);
}

@ -65,6 +65,16 @@ public class Emr_Apply_Approve {
private String deptName;
private Date bornDate;
public Date getBornDate() {
return bornDate;
}
public void setBornDate(Date bornDate) {
this.bornDate = bornDate;
}
public String getDeptName() {
return deptName;
}

@ -4,6 +4,7 @@ import com.emr.dao.CommomMapper;
import com.emr.dao.ExportTaskDetailsMapper;
import com.emr.dao.ExportTaskMapper;
import com.emr.dao.approve.Emr_Apply_ApproveMapper;
import com.emr.dao.bloodPurification.BloodPurificationMapper;
import com.emr.entity.ExportTask;
import com.emr.entity.ExportTaskDetails;
import com.emr.entity.Power_User;
@ -53,12 +54,12 @@ public class ImportExcelJudgeMethod {
private CommomMapper commomMapper;
@Autowired
private Emr_Apply_ApproveMapper applyApproveMapper;
@Autowired
private ExportTaskMapper exportTaskMapper;
@Autowired
private ExportTaskDetailsMapper exportTaskDetailsMapper;
@Autowired
private BloodPurificationMapper bloodPurificationMapper;
/****************************************导入公共判断******************************************************/
/**
@ -149,7 +150,10 @@ public class ImportExcelJudgeMethod {
/****************************************自定义验证记录合法******************************************************/
public String judgeRecord(String fieldName, String value, Field f, Object object, String head)throws Exception{
Emr_Apply_Approve applyApprove = (Emr_Apply_Approve)object;
List<String> patientIdList = commomMapper.selectPatientIdByAdmissTimesAndInpatientNoAndName(applyApprove.getAdmissTimes(), applyApprove.getInpatientNo(), applyApprove.getName(),null,null);
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
String disDate = ObjectUtils.isEmpty(applyApprove.getDisDate()) ? null : dateFormat.format(applyApprove.getDisDate());
String bornDate = ObjectUtils.isEmpty(applyApprove.getBornDate()) ? null : dateFormat.format(applyApprove.getBornDate());
List<String> patientIdList = commomMapper.selectRecordInfo(applyApprove.getAdmissTimes(), applyApprove.getInpatientNo(), applyApprove.getName(),disDate, bornDate);
if(null != patientIdList && !patientIdList.isEmpty()){
if(patientIdList.size() == 1){
HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest();

@ -6,6 +6,7 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.*;
import org.springframework.util.ObjectUtils;
import org.springframework.web.context.ContextLoader;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.multipart.MultipartFile;
@ -14,6 +15,8 @@ import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
/**
@ -254,6 +257,163 @@ public class ImportExcelUtil {
excelEntity.setWorkBookKey(workBookKey);
return excelEntity;
}
public static ImportExcelEntity fileImportByBloodPurification(MultipartFile multipartFile, String[] fieldNames, String[] judgeMethods, String jedgeMethod) {
Workbook workbook = null;
int successCount = 0;
int wrongCount = 0;
String workBookKey = "";
//正确行数下角标
List<Integer> wrongRowIndex = new ArrayList<>();
try {
/*把文件流copy读取到文件中*/
workbook = WorkbookFactory.create(multipartFile.getInputStream());
/*遍历sheet页*/
for (int i = 0; i < workbook.getNumberOfSheets(); i++) {
Sheet sheet = workbook.getSheetAt(i);
if (sheet == null) {
continue;
}
//获取表头行
//Row head = sheet.getRow(0);
//处理多级表头
//Map<String, Object> headerMap = handleRow(sheet);
String[] head = {"序号","检查日期","患者姓名","透析日期","记录填写不完整","医嘱执行签名不规范","医护未签名","未做宣教","宣教填写不完整体","护患未签名","医生未签名","患者家属关系缺项","通路名称不规范","其他","责任护士","整改日期","整改签名","备注"};
List<Object> list = new ArrayList<>();
for (int j = 4; j < sheet.getPhysicalNumberOfRows(); j++) {
Row row = sheet.getRow(j);
boolean flag = isRowEmpty(row);
if (!flag) {
if (row.getPhysicalNumberOfCells() != 0) {
StringBuilder wrongStr = new StringBuilder();
for (int k = 0; k < fieldNames.length; k++) {
//对象赋值后返回错误对象
wrongStr.append(getValueByField(object, fieldNames[k], getCellValue(row.getCell(k)), head[k], null));
}
//有错误信息在行尾创建cell并标红提示文字
if (StringUtils.isBlank(wrongStr)) {
Constructor constructor = ObjectClass.getDeclaredConstructor();
Object obj = (Object) constructor.newInstance();
//判断是否有自定义条件
if (StringUtils.isNotBlank(jedgeMethod)) {
//判断是否有报错信息,有报错信息添加到报错信息
String valueByField = judgeMethod(jedgeMethod);
if (StringUtils.isNotBlank(valueByField)) {
wrongStr.append(valueByField);
} else {
successCount++;
wrongRowIndex.add(j);
//复制
copy(object, obj);
list.add(obj);
}
} else {
successCount++;
wrongRowIndex.add(j);
//复制
copy(object, obj);
list.add(obj);
}
}
if (StringUtils.isNotBlank(wrongStr)) {
//设置错误信息字体为红色加粗
Font font = workbook.createFont();
font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
font.setColor(HSSFColor.RED.index);
CellStyle cellStyle = workbook.createCellStyle();
cellStyle.setFont(font);
Cell cell = row.createCell(fieldNames.length);
cell.setCellStyle(cellStyle);
cell.setCellType(HSSFCell.CELL_TYPE_STRING);
wrongStr = new StringBuilder(wrongStr.substring(0, wrongStr.length() - 1));
cell.setCellValue(wrongStr.toString());
wrongCount++;
}
}
}
}
//批量新增成功记录
SimpleInsert(list);
//删除正确行
if (!wrongRowIndex.isEmpty()) {
//定义删除次数,对应后方下角标都要减去删除次数
int deleteCount = 0;
//递归删除
removeSheet(sheet, deleteCount, wrongRowIndex);
}
}
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException();
}
//错误excel加入缓存
if (wrongCount != 0) {
workBookKey = UUIDUtils.getUUID();
workBookMap.put(workBookKey, workbook);
}
ImportExcelEntity excelEntity = new ImportExcelEntity();
excelEntity.setSuccessCount(successCount);
excelEntity.setWrongCount(wrongCount);
excelEntity.setWorkBookKey(workBookKey);
return excelEntity;
}
private static Map<String, Object> handleRow(Sheet sheet) {
// 创建一个Map来存储表头信息
Map<String, Object> headerMap = new HashMap<>();
//读取真实行数
int physicalNumberOfRows = readExcelValueRows(sheet);
for (int i = 0; i <= physicalNumberOfRows - 1; i++) {
List<Object> fieldNames = new ArrayList<>();
// 获取第表头
Row headerRow = sheet.getRow(i);
int physicalNumberOfCells = headerRow.getPhysicalNumberOfCells();
for (int j = 0; j < physicalNumberOfCells; j++) {
// 获取表头
Cell cell = headerRow.getCell(j);
// 获取表头值
String value = getCellValue(cell);
if(!ObjectUtils.isEmpty(value)){
fieldNames.add(value);
}
}
// 存储表头信息
headerMap.put("head" + i, fieldNames);
}
return headerMap;
}
/**
*
* @param sheet Excelexcel簿
* @return
*
*/
public static int readExcelValueRows(Sheet sheet) {
int realRow = 0;// 返回的真实行数
for (int i = 1; i <= sheet.getLastRowNum(); i++) {
//i从1开始不判断第一行标题行
Row row = sheet.getRow(i);
if (row == null){
continue;
}
for (Cell cell : row) {
if (cell == null){
continue;
}
String value = getCellValue(cell);
if (value == null || "".equals(value)){
continue;
} else{
realRow++;
break;
}
}
}
return realRow;
}
//批量新增成功数据方法
private static int SimpleInsert(List<Object> list)throws Exception{
if(null != list && !list.isEmpty()){
@ -348,11 +508,15 @@ public class ImportExcelUtil {
String typeName = filedType.getName();
if("java.lang.Integer".equals(typeName)){
f.set(object,Integer.valueOf(value));
}if("java.lang.Short".equals(typeName)){
}else if("java.lang.Short".equals(typeName)){
f.set(object,Short.valueOf(value));
}else if("java.util.Date".equals(typeName)){
f.set(object,new SimpleDateFormat("yyyy-MM-dd").parse(value));
}else{
f.set(object,value);
}
}else{
f.set(object,value);
}
}
break;

@ -467,8 +467,16 @@ public class CommomVo {
private String radiotherapyNo;
private String periods;
private String dataSource;
public String getPeriods() {
return periods;
}
public void setPeriods(String periods) {
this.periods = periods;
}
public String getRadiotherapyNo() {
return radiotherapyNo;

@ -81,6 +81,29 @@
AND dis_date between #{startTime2} + ' 00:00:00' and #{endTime2} + ' 23:59:59'
</if>
</select>
<select id="selectRecordInfo" resultType="java.lang.String"
parameterType="java.lang.String">
SELECT
patient_id
FROM
commomtable
WHERE
inpatient_no = #{inpatientNo}
<if test="admissTimes != null">
AND admiss_times = #{admissTimes}
</if>
<if test="name != null and name != ''">
AND name = #{name}
</if>
<if test="disDate != null and disDate != ''">
AND dis_date = #{disDate}
</if>
<if test="bornDate != null and bornDate != ''">
AND born_date = #{bornDate}
</if>
</select>
<!--根据住院次数和病案号和姓名查询patientId-->
<select id="selectAllInfo" resultType="com.emr.vo.commomSearch.CommomVo">
select
@ -1408,4 +1431,36 @@
</choose>
</where>
</select>
<select id="queryImgStatistics" parameterType="com.emr.vo.commomSearch.CommomVo" resultType="map">
select
a.periods,
count(b.scan_page) imgNum
from commomtable a join t_scan_assort b on a.patient_id = b.patient_id
<where>
<if test="inpatientNo != null and inpatientNo != ''">
and a.inpatient_no like '%' + #{inpatientNo} + '%'
</if>
<if test="periods != null and periods !=''">
and a.periods like '%' + #{periods} + '%'
</if>
</where>
group by a.periods
</select>
<select id="queryPeriodsStatistics" parameterType="com.emr.vo.commomSearch.CommomVo" resultType="map">
select
periods,
count(1) periodsNum
from commomtable
<where>
<if test="inpatientNo != null and inpatientNo != ''">
and inpatient_no like '%' + #{inpatientNo} + '%'
</if>
<if test="periods != null and periods !=''">
and periods like '%' + #{periods} + '%'
</if>
</where>
group by periods
</select>
</mapper>

@ -27,13 +27,13 @@
overflow-y:scroll;
}*/
.labelDiv {
padding-top: 2%;
padding: 1%;
padding-right: 0;
text-align: right;
}
.radioDiv {
padding-top: 2%;
padding: 1%;
}
/*搜索区域*/
@ -176,7 +176,7 @@
<div class="headDiv">
<div class="headSpanDiv">
<span class="headspan">
血透查询
常用查询
</span>
</div>
</div>
@ -620,7 +620,7 @@
<div class="form-group">
<div class="col-sm-3 labelDiv"></div>
<div class="col-sm-8 inputDiv">
<input type="checkbox" id="isOper"
<input type="checkbox" id="isOper" style="margin: 0% 2%;"
class="otherTable operTable isOperInput"><label for="isOper"
class="checkBoxClass">限手术</label>
</div>

@ -104,7 +104,7 @@
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<li class="user user-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" onclick="noticeManage1(-1)">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" onclick="noticeManage1('emr_record')">
<span class="label label-warning" id="noticeCount">0</span>
<i class="fa fa-envelope-o" style="font-size: 25px;"></i>
</a>

@ -344,11 +344,17 @@ function getSql() {
$("#fromTableSql").val('');
var dataSource = $("#dataSource").val();
var inputValue = getInputValue();
//from语句字符串
var fromTableNames = '';
//where语句字符串
var whereNames = ' where ';
//拼接where语句
var name = '';
if(!isEmpty(dataSource)){
name = 'data_source';
whereNames += commomtable + "." + name + " = '" + dataSource + "' AND ";
}
if (inputValue != '') {
//from语句字符串
var fromTableNames = '';
//where语句字符串
var whereNames = ' where ';
//判断是否多表
var tables = false;
$('.otherTable').each(function () {
@ -357,12 +363,6 @@ function getSql() {
return false;
}
})
//拼接where语句
var name = '';
if(!isEmpty(dataSource)){
name = 'data_source';
whereNames += commomtable + "." + name + " = '" + dataSource + "' AND ";
}
//姓名
var searchName = $("#name").val();
if (!isEmpty(searchName)) {
@ -737,12 +737,11 @@ function getSql() {
name = 'outpatient_no';
whereNames += commomtable + "." + name + " LIKE '%" + $("#" + name).val() + "%' AND ";
}
if (whereNames != ' where ') {
whereNames = whereNames.substring(0, whereNames.length - 4);
$("#whereSql").val(whereNames);
$("#fromTableSql").val(fromTableNames);
}
}
if (whereNames != ' where ') {
whereNames = whereNames.substring(0, whereNames.length - 4);
$("#whereSql").val(whereNames);
$("#fromTableSql").val(fromTableNames);
}
}

@ -32,31 +32,40 @@ var menu = {
success: function (data) {
$("#assortIds").val("");
if (data != null) {
//图片相对路径集合
var scanPages = '';
//图片来源集合
var sources = '';
for (var i = 0; i < data.length; i++) {
if (data[i].parentId != null && data[i].parentId != 1 && data[i].checked == 'true') {
scanPages += data[i].assortName + ",";
sources += data[i].source + ",";
let scanPages = '';
let sources = '';
$.fn.zTree.init($("#ztree"), menu.setting, data);
const zTree = $.fn.zTree.getZTreeObj("ztree");
zTree.checkAllNodes(false);// 取消选中所有复选框
// 获取节点注意增加了对nodes是否存在的检查
const nodes = zTree.getNodes();
if (nodes && nodes.length > 0) {
for (let i = 0; i < nodes.length; i++) { // 设置节点展开
zTree.expandNode(nodes[i], true, false, true);
}
// 选择父节点的第一个子节点,增加了对子节点数组是否存在的检查
if (nodes[0].children && nodes[0].children.length > 0) {
zTree.checkNode(nodes[0].children[0], true, true);
const selectNodes = nodes[0].children[0].children;
// 使用数组和join来提高性能和代码可读性
scanPages += selectNodes.map(node => node.assortName).join(',');
sources += selectNodes.map(node => node.source).join(',');
$("#assortIds").val(scanPages);
$("#sources").val(sources);
}
} else {
console.error("No nodes found in zTree.");
}
//去掉后面逗号
if (scanPages != '') {
scanPages = scanPages.substring(0, scanPages.length - 1);
$("#assortIds").val(scanPages);
sources = sources.substring(0, sources.length - 1);
$("#sources").val(sources);
}
$.fn.zTree.init($("#ztree"), menu.setting, data);
zTree = $.fn.zTree.getZTreeObj("ztree");
var nodes = zTree.getNodes();
for (var i = 0; i < nodes.length; i++) { //设置节点展开
zTree.expandNode(nodes[i], true, false, true);
// 加载pdf此处假设onloadPdf已经具备基本的错误处理
try {
onloadPdf(scanPages, sources);
} catch (error) {
console.error("Failed to load PDF:", error);
}
//加载pdf
onloadPdf(scanPages, sources);
}
}
})

@ -56,6 +56,28 @@ document.onkeydown = function(e) {
HandTool.toggle()
}
}
/**
* 监听鼠标滚轮事件
*/
document.addEventListener('wheel', function(e) {
// 鼠标滚轮向上滚动时放大图片
if (e.deltaY < 0) {
PDFViewerApplication.zoomIn();
}
// 鼠标滚轮向下滚动时缩小图片
else if (e.deltaY > 0) {
PDFViewerApplication.zoomOut();
}
}, {passive: true});
/**
* 监听鼠标按下事件
*/
document.addEventListener('mousedown', function(e) {
HandTool.toggle()
});
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
/* Copyright 2012 Mozilla Foundation

Loading…
Cancel
Save