湛江优化慢sql

master
linjj 2 years ago
parent 05fe98cb37
commit a2afd42fb2

@ -69,6 +69,7 @@
<cxf.version>3.1.8</cxf.version>
<poi.version>3.9</poi.version>
<lombok.version>1.18.8</lombok.version>
<fastjson.version>1.2.3</fastjson.version>
</properties>
<!-- maven依赖 -->
@ -127,6 +128,11 @@
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!-- 日志处理 -->
<dependency>
<groupId>org.slf4j</groupId>

@ -141,6 +141,8 @@ public class MedicalRecallController {
archiveMaster.setArchivestate("初审");
bol=archiveMasterService.updateByClo(archiveMaster);
if (bol == 1) {
//召回时删除commomtable对应数据
archiveMasterService.deleteRecordByInp(emrFaultDetail.getArchiveDetailId());
//删除该病案号和state不为空的记录
bol = emrFaultDetailService.delByArchiveId(emrFaultDetail);
//重新插入一条记录

@ -260,6 +260,22 @@ public class lastVerifyController {
archiveMaster.setCmtDoctor(1);
archiveMaster.setCmtNurse(1);
int bol = archiveMasterService.updateByClo(archiveMaster);
//归档记录添加到commomtable表
CommomVo commomVo = new CommomVo();
List<Archive_Master> archiveMasters = archiveMasterService.selectCommonlyUsed(emrFaultDetail.getArchiveDetailId());
for (Archive_Master list : archiveMasters) {
commomVo.setPatientId(list.getId());
commomVo.setAdmissTimes(list.getVisitId());
commomVo.setInpatientNo(list.getInpNo());
commomVo.setName(list.getName());
commomVo.setAdmissId(list.getPatientId());
commomVo.setSex(list.getSex());
commomVo.setAdmissDate(list.getAdmissionDateTime());
commomVo.setDisDate(list.getDischargeDateTime());
commomVo.setDisDept(list.getDeptName());
commomVo.setAttending(list.getDoctorInCharge());
archiveMasterService.insertCommonlyUsed(commomVo);
}
//添加初审内容
if (bol == 1) {
// 从session获取用户名

@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.emr.entity.*;
import com.emr.service.*;
import com.emr.util.HttpClientTool;
import com.emr.util.IDHelper;
import com.emr.util.ThreadExcelUtils;
import com.emr.util.XMLUtil;
@ -32,15 +33,16 @@ import javax.servlet.http.HttpServletResponse;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
import javax.xml.rpc.ServiceException;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.io.*;
import java.math.BigDecimal;
import java.net.URL;
import java.net.URLConnection;
import java.rmi.RemoteException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller
@RequestMapping("signList")
@ -74,6 +76,8 @@ public class signListController {
@Autowired
private FinishedDateTimeService finishedDateTimeService;
@Autowired
private AfCollectTaskService afCollectTaskService;
@RequestMapping(value = "/signLists")
public String faults(Model model) {
@ -125,7 +129,7 @@ public class signListController {
@Transactional
@ResponseBody
@RequestMapping(value = "/delotherId")
public String delotherId(HttpServletRequest request, HttpServletResponse response,String id) {
public String delotherId(HttpServletRequest request, HttpServletResponse response, String id) {
signListService.deleteSignListById(id);
return "取消签收成功!";
}
@ -683,166 +687,223 @@ public class signListController {
return result;
}
// @ResponseBody
// @RequestMapping(value = "/collection")
// public String collection(HttpServletRequest request, HttpServletResponse response, int flagNum, String id, String pid) throws Exception {
// response.setCharacterEncoding("utf-8");
// request.setCharacterEncoding("utf-8");
// // 从session获取用户名
// Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
// String username = user.getUserName();//工号
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// Date date_1801 = sdf.parse("1801-02-03 00:00:00");
//
// //新增ext表数据逻辑
// Archive_Master archive_master = archiveMasterService.selectById(id);
// if (archive_master != null) {
// //查ext表有无任务
// ArchiveOtherExt archiveOtherExtParm = new ArchiveOtherExt();
// archiveOtherExtParm.setMid(id);
// archiveOtherExtParm.setSysflag(-300);
// List<ArchiveOtherExt> extList = archiveOtherExtService.selectExtTaskIsExistOrNot(archiveOtherExtParm);
// if (!extList.isEmpty() && extList.size() == 1) {
// //有任务则ext表更新statusFlag=0对应C3-C8置空T1-T6置空其他不变
// //1.statusFlag=0
// extList.get(0).setStatusflag(0);
// //2.对应C3-C8置空T1-T6置空
// switch (flagNum) {
// //体温单
// case 1:
// extList.get(0).setC5("");
// extList.get(0).setT3(date_1801);
// break;
// //护理记录
// case 2:
// extList.get(0).setC6("");
// extList.get(0).setT4(date_1801);
// break;
// //首页
// case 3:
// extList.get(0).setC3("");
// extList.get(0).setT1(date_1801);
// break;
// //医生文书
// case 4:
// extList.get(0).setC4("");
// extList.get(0).setT2(date_1801);
// break;
// //评估单
// case 5:
// extList.get(0).setC8("");
// extList.get(0).setT6(date_1801);
// break;
// //护士文书
// case 6:
// extList.get(0).setC7("");
// extList.get(0).setT5(date_1801);
// break;
// }
// archiveOtherExtService.updateByPrimaryKeySelective(extList.get(0));
// } else if (extList.isEmpty() || extList.size() < 0) {
// //无任务,则新增
// OracleDateVo doctorNurseFinishedDatetime = finishedDateTimeService.findByID(archive_master.getInpNo(), archive_master.getVisitId());
// //V6医生最后完成时间
// String doctorFinishedDateTime = sdf.format(doctorNurseFinishedDatetime.getFinishedDateTime());
// //V6护士最后完成时间
// String nurseFinishedDateTime = sdf.format(doctorNurseFinishedDatetime.getMrCommitNurseDateTime());
// ArchiveOtherExt archiveOtherExt = new ArchiveOtherExt(IDHelper.NewID(), new Date(), "按需采集", 0L, -300, date_1801, pid,
// archive_master.getInpNo(), date_1801, date_1801, 0, "", id, archive_master.getVisitId(),
// doctorFinishedDateTime, nurseFinishedDateTime, "Done", "Done", "Done", "Done", "Done", "Done", "", archive_master.getName(),
// BigDecimal.valueOf(0.0000), BigDecimal.valueOf(0.0000), BigDecimal.valueOf(0.0000),
// date_1801, date_1801, date_1801, date_1801, date_1801, date_1801);
// //对应C3-C8置空,T无需置空
// switch (flagNum) {
// //体温单
// case 1:
// archiveOtherExt.setC5("");
// break;
// //护理记录
// case 2:
// archiveOtherExt.setC6("");
// break;
// //首页
// case 3:
// archiveOtherExt.setC3("");
// break;
// //医生文书
// case 4:
// archiveOtherExt.setC4("");
// break;
// //评估单
// case 5:
// archiveOtherExt.setC8("");
// break;
// //护士文书
// case 6:
// archiveOtherExt.setC7("");
// break;
// }
// archiveOtherExtService.insertSelective(archiveOtherExt);
// } else {
// //archive_Other_Ext表已经存在记录,且不只1条,删除多余或采集接口那边需要调整
// return "同一个病案ID,ext表只允许1条数据!";
// }
// }
//
// //新增other表数据逻辑
// Sign_List signList = new Sign_List();
// signList.setPid(pid);
// signList.setMasterID(id);
// int num = 0;
// switch (flagNum) {
// //体温单
// case 1:
// num = -401;
// break;
// //护理记录
// case 2:
// num = -402;
// break;
// //首页
// case 3:
// num = -403;
// break;
// //医生文书
// case 4:
// num = -404;
// break;
// //评估单
// case 5:
// num = -405;
// break;
// //护士文书
// case 6:
// num = -406;
// break;
// }
// signList.setSysFlag(num);
// signList.setC5("0");
// List<Sign_List> list = signListService.selectSignListWith(signList);
// if (list != null && list.size() > 0) {
// return "当前采集计划已存在,请勿重复发起!";
// } else {
// signList.setId(IDHelper.NewID());
// signList.setCreatedtime(sdf.format(new Date()));
// signList.setC1(username);
// signList.setIsFullText("0");
// signList.setOtherInfo("");
// signList.setDetailID("");
// signList.setdTime(sdf.format(sdf.parse("1801-02-03 00:00:00")));
// signList.setC2("");
// signList.setC3("");
// signList.setC4("");
// signList.setN1(BigDecimal.valueOf(0.0000));
// signList.setN2(BigDecimal.valueOf(0.0000));
// signList.setN3(BigDecimal.valueOf(0.0000));
// signList.setT1(sdf.format(sdf.parse("1801-02-03 00:00:00")));
// signList.setT2(sdf.format(sdf.parse("1801-02-03 00:00:00")));
// signList.setT3(sdf.format(sdf.parse("1801-02-03 00:00:00")));
// signListService.insertSignList(signList);
// return "采集计划已生成!";
// }
// }
@ResponseBody
@RequestMapping(value = "/collection")
public String collection(HttpServletRequest request, HttpServletResponse response, int flagNum, String id, String pid) throws Exception {
response.setCharacterEncoding("utf-8");
request.setCharacterEncoding("utf-8");
// 从session获取用户名
Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
String username = user.getUserName();//工号
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date_1801 = sdf.parse("1801-02-03 00:00:00");
public String collection(HttpServletRequest request, HttpServletResponse response, int flagNum, String id) throws Exception {
String taskId = afCollectTaskService.getTaskId(flagNum, id);
String url="http://127.0.0.1:9296/api/noviewtask/UrgentMakeUp";
String s = sendGet(url, taskId);
//查询新任务表id
return s;
}
//新增ext表数据逻辑
Archive_Master archive_master = archiveMasterService.selectById(id);
if (archive_master != null) {
//查ext表有无任务
ArchiveOtherExt archiveOtherExtParm = new ArchiveOtherExt();
archiveOtherExtParm.setMid(id);
archiveOtherExtParm.setSysflag(-300);
List<ArchiveOtherExt> extList = archiveOtherExtService.selectExtTaskIsExistOrNot(archiveOtherExtParm);
if (!extList.isEmpty() && extList.size() == 1) {
//有任务则ext表更新statusFlag=0对应C3-C8置空T1-T6置空其他不变
//1.statusFlag=0
extList.get(0).setStatusflag(0);
//2.对应C3-C8置空T1-T6置空
switch (flagNum) {
//体温单
case 1:
extList.get(0).setC5("");
extList.get(0).setT3(date_1801);
break;
//护理记录
case 2:
extList.get(0).setC6("");
extList.get(0).setT4(date_1801);
break;
//首页
case 3:
extList.get(0).setC3("");
extList.get(0).setT1(date_1801);
break;
//医生文书
case 4:
extList.get(0).setC4("");
extList.get(0).setT2(date_1801);
break;
//评估单
case 5:
extList.get(0).setC8("");
extList.get(0).setT6(date_1801);
break;
//护士文书
case 6:
extList.get(0).setC7("");
extList.get(0).setT5(date_1801);
break;
}
archiveOtherExtService.updateByPrimaryKeySelective(extList.get(0));
} else if (extList.isEmpty() || extList.size() < 0) {
//无任务,则新增
OracleDateVo doctorNurseFinishedDatetime = finishedDateTimeService.findByID(archive_master.getInpNo(), archive_master.getVisitId());
//V6医生最后完成时间
String doctorFinishedDateTime = sdf.format(doctorNurseFinishedDatetime.getFinishedDateTime());
//V6护士最后完成时间
String nurseFinishedDateTime = sdf.format(doctorNurseFinishedDatetime.getMrCommitNurseDateTime());
ArchiveOtherExt archiveOtherExt = new ArchiveOtherExt(IDHelper.NewID(), new Date(), "按需采集", 0L, -300, date_1801, pid,
archive_master.getInpNo(), date_1801, date_1801, 0, "", id, archive_master.getVisitId(),
doctorFinishedDateTime, nurseFinishedDateTime, "Done", "Done", "Done", "Done", "Done", "Done", "", archive_master.getName(),
BigDecimal.valueOf(0.0000), BigDecimal.valueOf(0.0000), BigDecimal.valueOf(0.0000),
date_1801, date_1801, date_1801, date_1801, date_1801, date_1801);
//对应C3-C8置空,T无需置空
switch (flagNum) {
//体温单
case 1:
archiveOtherExt.setC5("");
break;
//护理记录
case 2:
archiveOtherExt.setC6("");
break;
//首页
case 3:
archiveOtherExt.setC3("");
break;
//医生文书
case 4:
archiveOtherExt.setC4("");
break;
//评估单
case 5:
archiveOtherExt.setC8("");
break;
//护士文书
case 6:
archiveOtherExt.setC7("");
break;
}
archiveOtherExtService.insertSelective(archiveOtherExt);
} else {
//archive_Other_Ext表已经存在记录,且不只1条,删除多余或采集接口那边需要调整
return "同一个病案ID,ext表只允许1条数据!";
public static String sendGet(String url, String param) {
String result = "";
BufferedReader in = null;
try {
String urlNameString = url + "?" + param;
URL realUrl = new URL(urlNameString);
// 打开和URL之间的连接
URLConnection connection = realUrl.openConnection();
// 设置通用的请求属性
connection.setRequestProperty("accept", "*/*");
connection.setRequestProperty("connection", "Keep-Alive");
connection.setRequestProperty("user-agent",
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
// 建立实际的连接
connection.connect();
// 获取所有响应头字段
Map<String, List<String>> map = connection.getHeaderFields();
// 遍历所有的响应头字段
for (String key : map.keySet()) {
System.out.println(key + "--->" + map.get(key));
}
// 定义 BufferedReader输入流来读取URL的响应
in = new BufferedReader(new InputStreamReader(
connection.getInputStream()));
String line;
while ((line = in.readLine()) != null) {
result += line;
}
} catch (Exception e) {
System.out.println("发送GET请求出现异常" + e);
e.printStackTrace();
}
//新增other表数据逻辑
Sign_List signList = new Sign_List();
signList.setPid(pid);
signList.setMasterID(id);
int num = 0;
switch (flagNum) {
//体温单
case 1:
num = -401;
break;
//护理记录
case 2:
num = -402;
break;
//首页
case 3:
num = -403;
break;
//医生文书
case 4:
num = -404;
break;
//评估单
case 5:
num = -405;
break;
//护士文书
case 6:
num = -406;
break;
}
signList.setSysFlag(num);
signList.setC5("0");
List<Sign_List> list = signListService.selectSignListWith(signList);
if (list != null && list.size() > 0) {
return "当前采集计划已存在,请勿重复发起!";
} else {
signList.setId(IDHelper.NewID());
signList.setCreatedtime(sdf.format(new Date()));
signList.setC1(username);
signList.setIsFullText("0");
signList.setOtherInfo("");
signList.setDetailID("");
signList.setdTime(sdf.format(sdf.parse("1801-02-03 00:00:00")));
signList.setC2("");
signList.setC3("");
signList.setC4("");
signList.setN1(BigDecimal.valueOf(0.0000));
signList.setN2(BigDecimal.valueOf(0.0000));
signList.setN3(BigDecimal.valueOf(0.0000));
signList.setT1(sdf.format(sdf.parse("1801-02-03 00:00:00")));
signList.setT2(sdf.format(sdf.parse("1801-02-03 00:00:00")));
signList.setT3(sdf.format(sdf.parse("1801-02-03 00:00:00")));
signListService.insertSignList(signList);
return "采集计划已生成!";
// 使用finally块来关闭输入流
finally {
try {
if (in != null) {
in.close();
}
} catch (Exception e2) {
e2.printStackTrace();
}
}
return result;
}
}

@ -6,11 +6,23 @@
*/
package com.emr.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.emr.annotation.OptionalLog;
import com.emr.entity.*;
import com.emr.service.*;
import com.emr.util.ThreadExcelUtils;
import com.google.common.collect.Lists;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpRequest;
import org.apache.http.NameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;
@ -24,11 +36,19 @@ import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import static com.emr.controller.signListController.sendGet;
import static com.emr.util.HttpClientTool.doPost;
import static com.emr.util.HttpClientUtils.doPostJson;
import static com.emr.util.HttpClientUtils.httpPost;
@PropertySource(value = "classpath:config/jdbc.properties", encoding = "UTF-8")
@Controller
@RequestMapping("/storage")
@ -164,6 +184,11 @@ public class storageController {
archiveMasterFollowing.setHandleName(handleName);
archiveMasterFollowing.setRemark(emrFaultDetail.getRecallReason());
bol = archiveMasterFollowingService.insertSelective(archiveMasterFollowing);
String url = "http://10.6.1.127:9295/api/NoViewCollect/generateTaskByPatientId";
List<String> list = new ArrayList<String>();
list.add(emrFaultDetail.getArchiveDetailId());
String json = JSON.toJSONString(list);
doPostJson(url, json);
}
} else {
return result;

@ -0,0 +1,15 @@
package com.emr.dao;
import org.apache.ibatis.annotations.Param;
/**
* @InterfaceName AfCollectTaskMapper
* @Description
* @Author linjj
* @Date 2023/5/4 16:35
* @Version 1.0
*/
public interface AfCollectTaskMapper {
String getTaskId(@Param("flagNum")int flagNum, @Param("id")String id);
}

@ -119,6 +119,8 @@ public interface Archive_DetailMapper {
*/
List<Archive_Detail_Vo> detailByClo(Archive_Detail_Vo record);
List<Archive_Detail_Vo> detailByCloTop(Archive_Detail_Vo record);
/**
*
* @param record

@ -3,6 +3,7 @@ package com.emr.dao;
import com.emr.entity.Archive_Master;
import com.emr.entity.Archive_Master_Following;
import com.emr.entity.Archive_Master_Vo;
import com.emr.entity.CommomVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -64,6 +65,7 @@ public interface Archive_MasterMapper {
*/
List<Archive_Master_Vo> selectByLast(Archive_Master_Vo record);
/**
*
* @param record
@ -114,7 +116,8 @@ public interface Archive_MasterMapper {
*/
int updateByClo(Archive_Master record);
//根据id删除已归档数据
int deleteRecordByInp(@Param("masterId")String masterId);
/**
*
@ -130,6 +133,10 @@ public interface Archive_MasterMapper {
*/
int updateById(Archive_Master record);
List<Archive_Master> selectCommonlyUsed(String id);
int insertCommonlyUsed(CommomVo commomVo);
/**
*
* @param record

@ -57,6 +57,14 @@ public class Archive_Master {
private String emrDoctorCmt;
public String getDeptNameCode() {
return deptNameCode;
}
public void setDeptNameCode(String deptNameCode) {
this.deptNameCode = deptNameCode;
}
private String emrNureCmt;
private String deathFlag;
@ -68,6 +76,9 @@ public class Archive_Master {
// 科室是否纸质提交
private String isscaned;
private String deptNameCode;
//2020-1-13 新增扫描字段
private String isScanning;

@ -140,6 +140,8 @@ public class Archive_Master_Vo {
private String cmtNurseDate;
private Integer printFlag;
private String emrDoctorCmt;
private String emrNureCmt;

File diff suppressed because it is too large Load Diff

@ -8,6 +8,17 @@ public class Emr_Fault_Detail {
private String ArchiveStateFlag;
private Integer idPage;
private String StateFlag;
public String getStateFlag() {
return StateFlag;
}
public void setStateFlag(String stateFlag) {
StateFlag = stateFlag;
}
public String getArchiveStateFlag() {
return ArchiveStateFlag;
}

@ -0,0 +1,13 @@
package com.emr.service;
/**
* @InterfaceName AfCollectTaskService
* @Description
* @Author linjj
* @Date 2023/5/4 16:33
* @Version 1.0
*/
public interface AfCollectTaskService {
String getTaskId(int flagNum, String id);
}

@ -6,11 +6,9 @@
*/
package com.emr.service;
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.entity.*;
import com.emr.vo.GetTime;
import org.apache.ibatis.annotations.Param;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@ -22,6 +20,12 @@ public interface Archive_MasterService {
* @return
*/
Archive_Master selectById(String id);
List<Archive_Master> selectCommonlyUsed(String id);
int insertCommonlyUsed(CommomVo commomVo);
/**
*
* @param archiveMaster
@ -34,6 +38,13 @@ public interface Archive_MasterService {
* @return
*/
OffsetLimitPage selectByCol(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit);
/**
* @description: commomtable
* @params: commomVo
* @return: int
* @author linjj
* @date: 2023/5/30 16:08
*/
/**
*
@ -119,6 +130,8 @@ public interface Archive_MasterService {
*/
int updateByClo(Archive_Master record);
//根据id删除commomtable表已归档数据
int deleteRecordByInp(@Param("masterId")String masterId);
/**
*

@ -0,0 +1,24 @@
package com.emr.service.ipml;
import com.emr.dao.AfCollectTaskMapper;
import com.emr.service.AfCollectTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @ClassName AfCollectTaskServiceImpl
* @Description
* @Author linjj
* @Date 2023/5/4 16:33
* @Version 1.0
*/
@Service
public class AfCollectTaskServiceImpl implements AfCollectTaskService {
@Autowired
AfCollectTaskMapper afCollectTaskMapper;
@Override
public String getTaskId(int flagNum, String pid) {
return afCollectTaskMapper.getTaskId(flagNum,pid);
}
}

@ -15,6 +15,7 @@ import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.util.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -52,9 +53,9 @@ public class Archive_DetailServiceImpl implements Archive_DetailService {
public OffsetLimitPage selectChild(Archive_Detail_Vo record, Integer offset, Integer limit) {
PageHelper.offsetPage(offset, limit);
List<Archive_Detail_Vo> list = archiveDetailMapper.selectChild(record);
for(Archive_Detail_Vo returnList:list){
for (Archive_Detail_Vo returnList : list) {
//改变新生儿数据的title新格式为title+inpNo
returnList=changeTitle(returnList);
returnList = changeTitle(returnList);
}
return new OffsetLimitPage((Page) list);
}
@ -69,21 +70,34 @@ public class Archive_DetailServiceImpl implements Archive_DetailService {
public OffsetLimitPage detailByClo(Archive_Detail_Vo record, Integer offset, Integer limit) {
PageHelper.offsetPage(offset, limit);
//如果是进入新打开的页面,就把新生儿数据加上
if((record.getAssortId()==null||"".equals(record.getAssortId()))&&(!"".equals(record.getPatientId())&&record.getPatientId()!=null)){
List<Archive_Detail_Vo> list1= archiveDetailMapper.detailWithChildByClo(record);
for(Archive_Detail_Vo returnList:list1){
if(!record.getPatientId().equals(returnList.getMasterid())){
if ((record.getAssortId() == null || "".equals(record.getAssortId())) && (!"".equals(record.getPatientId()) && record.getPatientId() != null)) {
List<Archive_Detail_Vo> list1 = archiveDetailMapper.detailWithChildByClo(record);
for (Archive_Detail_Vo returnList : list1) {
if (!record.getPatientId().equals(returnList.getMasterid())) {
//改变新生儿数据的title新格式为title+inpNo
returnList=changeTitle(returnList);
returnList = changeTitle(returnList);
}
}
return new OffsetLimitPage((Page) list1);
}else{
} else {
List<Archive_Detail_Vo> list = archiveDetailMapper.detailByClo(record);
List<Archive_Detail_Vo> archiveDetailVos = archiveDetailMapper.detailByCloTop(record);
if (archiveDetailVos.size()>0){
Archive_Detail_Vo archiveDetailVo = archiveDetailVos.get(0);
for (Archive_Detail_Vo listTop : list) {
listTop.setCreateTime(archiveDetailVo.getCreateTime());
listTop.setCmtDoctorDate(archiveDetailVo.getCmtDoctorDate());
listTop.setCmtNurseDate(archiveDetailVo.getCmtNurseDate());
listTop.setArchivestate(archiveDetailVo.getArchivestate());
}
}
return new OffsetLimitPage((Page) list);
}
}
}
@Override
public List<Archive_Detail_Vo> sourceByClo(Archive_Detail_Vo record) {
return archiveDetailMapper.sourceByClo(record);
@ -141,7 +155,7 @@ public class Archive_DetailServiceImpl implements Archive_DetailService {
@Override
public List<Archive_Detail> selectTypeTreeByPatientIdAndAssortIds(String patientId, String assortIds) {
return archiveDetailMapper.selectTypeTreeByPatientIdAndAssortIds(patientId,assortIds);
return archiveDetailMapper.selectTypeTreeByPatientIdAndAssortIds(patientId, assortIds);
}
@Override
@ -149,18 +163,19 @@ public class Archive_DetailServiceImpl implements Archive_DetailService {
List<Archive_Detail> arList = archiveDetailMapper.selectByIdStr1(detail);
List<String> pdfList = mulFile2OneById(response, arList);
//存至session
session.setAttribute("showRecord",pdfList);
session.setAttribute("showRecord", pdfList);
}
/**
* pdf
*
* @param response
* @param arList
*/
@Override
public List<String> mulFile2OneById(HttpServletResponse response,List<Archive_Detail> arList) {
public List<String> mulFile2OneById(HttpServletResponse response, List<Archive_Detail> arList) {
response.setCharacterEncoding("utf-8");
List<String> pdfList = new ArrayList<>();
List<String> pdfList = new ArrayList<>();
if (arList != null && !arList.isEmpty()) {
//TODO 抽取首次病程记录
String strTemp = "首次病程";
@ -168,15 +183,15 @@ public class Archive_DetailServiceImpl implements Archive_DetailService {
//定义护理记录里的首次护理记录排前头
String nurseTemp = "首次护理";
String nurseAssortId = "C70E8C427A3648B79BE80798C08F4D12";
if(!CollectionUtils.isEmpty(arList)) {
if (!CollectionUtils.isEmpty(arList)) {
String strPath = "";
String nursePath = "";
for (int i = 0; i < arList.size(); i++) {
String assortid = arList.get(i).getAssortid();
if(StringUtils.isNotBlank(assortid) && assortid.equals(assortId) && arList.get(i).getTitle().contains(strTemp)){
if (StringUtils.isNotBlank(assortid) && assortid.equals(assortId) && arList.get(i).getTitle().contains(strTemp)) {
strPath = arList.get(i).getPdfPath();
}
if(StringUtils.isNotBlank(assortid) && assortid.equals(nurseAssortId) && arList.get(i).getTitle().contains(nurseTemp)){
if (StringUtils.isNotBlank(assortid) && assortid.equals(nurseAssortId) && arList.get(i).getTitle().contains(nurseTemp)) {
nursePath = arList.get(i).getPdfPath();
}
}
@ -196,7 +211,7 @@ public class Archive_DetailServiceImpl implements Archive_DetailService {
pdfList.add(nursePath);
nurseFlag = true;
}
if(!detail.getPdfPath().equals(strPath) && !detail.getPdfPath().equals(nursePath)){
if (!detail.getPdfPath().equals(strPath) && !detail.getPdfPath().equals(nursePath)) {
pdfList.add(str);
}
}
@ -208,8 +223,8 @@ public class Archive_DetailServiceImpl implements Archive_DetailService {
@Override
public void showPdf(HttpServletResponse response, HttpSession session, String pdfWater) {
List<String> pdfList = (List<String>)session.getAttribute("showRecord");
if(!CollectionUtils.isEmpty(pdfList)) {
List<String> pdfList = (List<String>) session.getAttribute("showRecord");
if (!CollectionUtils.isEmpty(pdfList)) {
Jpg2PdfUtil jpg2PdfUtil = Jpg2PdfUtil.getInstance();
jpg2PdfUtil.mulFile2One(response, pdfList, pdfWater);
}
@ -217,27 +232,27 @@ public class Archive_DetailServiceImpl implements Archive_DetailService {
session.removeAttribute("showRecord");
}
public List<Archive_Detail_Vo> getList(List<Archive_Detail_Vo> record){
List<Archive_Detail_Vo> list =new ArrayList<Archive_Detail_Vo>();
for (Archive_Detail_Vo newrecord:record){
public List<Archive_Detail_Vo> getList(List<Archive_Detail_Vo> record) {
List<Archive_Detail_Vo> list = new ArrayList<Archive_Detail_Vo>();
for (Archive_Detail_Vo newrecord : record) {
List<Archive_Detail_Vo> returnList = archiveDetailMapper.detailByClo(newrecord);
for (Archive_Detail_Vo newReturnList:returnList){
for (Archive_Detail_Vo newReturnList : returnList) {
list.add(newReturnList);
}
}
return list;
}
public Archive_Detail_Vo changeTitle(Archive_Detail_Vo newList){
//改变title变成title+inpNo
Archive_Master master= archiveMasterMapper.selectById(newList.getMasterid());
if (master!= null) {
String inpNo = master.getInpNo();
if (inpNo != null && !"".equals(inpNo)) {
//newList.setTitle(newList.getTitle() +"_"+ inpNo);
newList.setInpNo(inpNo);
}
}
public Archive_Detail_Vo changeTitle(Archive_Detail_Vo newList) {
//改变title变成title+inpNo
Archive_Master master = archiveMasterMapper.selectById(newList.getMasterid());
if (master != null) {
String inpNo = master.getInpNo();
if (inpNo != null && !"".equals(inpNo)) {
//newList.setTitle(newList.getTitle() +"_"+ inpNo);
newList.setInpNo(inpNo);
}
}
return newList;
}

@ -32,7 +32,6 @@ import java.io.IOException;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.OffsetDateTime;
import java.util.*;
@Slf4j
@ -76,6 +75,16 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
return archiveMasterMapper.selectById(id);
}
@Override
public List<Archive_Master> selectCommonlyUsed(String id) {
return archiveMasterMapper.selectCommonlyUsed(id);
}
@Override
public int insertCommonlyUsed(CommomVo commomVo) {
return archiveMasterMapper.insertCommonlyUsed(commomVo);
}
@Override
public List<Archive_Master> selByCol(Archive_Master archiveMaster) {
return archiveMasterMapper.selByCol(archiveMaster);
@ -448,6 +457,11 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
return archiveMasterMapper.updateByClo(record);
}
@Override
public int deleteRecordByInp(String masterId) {
return archiveMasterMapper.deleteRecordByInp(masterId);
}
@Override
public int updateByClo2(Archive_Master record) {

@ -3,7 +3,7 @@ log4j.appender.myLog=org.apache.log4j.DailyRollingFileAppender
log4j.appender.myLog.File=D:\\logs\\emr_medical_record\\info\\info_log
log4j.appender.myLog.DatePattern=-yyyy-MM-dd'.log'
log4j.appender.myLog.Append = true
log4j.appender.myLog.Threshold = info
log4j.appender.myLog.Threshold = debug
log4j.appender.myLog.layout=org.apache.log4j.PatternLayout
log4j.appender.myLog.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss}:%m%n
@ -12,7 +12,7 @@ log4j.appender.errorMsg=org.apache.log4j.DailyRollingFileAppender
log4j.appender.errorMsg.File=D:\\logs\\emr_medical_record\\error\\error_log
log4j.appender.errorMsg.DatePattern=-yyyy-MM-dd'.log'
log4j.appender.errorMsg.Append = true
log4j.appender.errorMsg.Threshold = error
log4j.appender.errorMsg.Threshold = debug
log4j.appender.errorMsg.layout=org.apache.log4j.PatternLayout
log4j.appender.errorMsg.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss}:%m%n
@ -23,5 +23,5 @@ log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern =%d %-5p [%c{5}] - %m%n
log4j.logger.com.emr=debug
log4j.logger.com.alibaba=error
log4j.logger.org=error
log4j.logger.com.alibaba=debug
log4j.logger.org=debug

@ -0,0 +1,7 @@
<?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.AfCollectTaskMapper" >
<select id="getTaskId" resultType="java.lang.String">
select id from af_collect_task where sysflag=#{flagNum} and patient_id=#{id}
</select>
</mapper>

@ -161,21 +161,10 @@
<select id="detailByClo" resultMap="BaseResultMap2" parameterType="com.emr.entity.Archive_Detail_Vo">
select
t.MasterID,t.id,t.PDF_PATH,t.Source,CONVERT(varchar(100),t.UpLoadDateTime, 120) UpLoadDateTime,t.SubAssort,t.Title,t.flag,t.page_number,
z.assort_id,z.assort_name,z.assort_sort,z.print_flag,s.create_time,s.cmt_doctor_date,s.cmt_nurse_date,s.ArchiveState
from zd_assort z
left join archive_detail t
z.assort_id,z.assort_name,z.assort_sort,z.print_flag
from archive_detail t
left join zd_assort z
on z.assort_id=t.AssortID
LEFT JOIN(
select top 1 f.id,m.create_time,f.cmt_doctor_date,f.cmt_nurse_date,f.ArchiveState from
emr_fault_detail m
left join archive_master f
on m.archive_detail_id=f.id
where 1=1 and m.back_flag= 3
<if test="patientId != null">
and f.id=#{patientId,jdbcType=VARCHAR}
</if>
) s
on s.id=t.MasterID
where 1=1
<if test="patientId != null">
and t.MasterID=#{patientId,jdbcType=VARCHAR}
@ -198,67 +187,94 @@
ORDER BY z.assort_sort,t.Title,t.page_number,t.UpLoadDateTime
</select>
<!-- <select id="detailWithChildByClo" resultMap="BaseResultMap2" parameterType="com.emr.entity.Archive_Detail_Vo">-->
<!-- select-->
<!-- t.MasterID,t.id,t.PDF_PATH,t.Source,CONVERT(varchar(100),t.UpLoadDateTime, 120) UpLoadDateTime,t.SubAssort,t.Title,t.flag,t.page_number,-->
<!-- z.assort_id,z.assort_name,z.assort_sort,z.print_flag,s.create_time,s.cmt_doctor_date,s.cmt_nurse_date,s.ArchiveState-->
<!-- from zd_assort z-->
<!-- left join archive_detail t-->
<!-- on z.assort_id=t.AssortID-->
<!-- LEFT JOIN(-->
<!-- select top 1 f.id,m.create_time,f.cmt_doctor_date,f.cmt_nurse_date,f.ArchiveState from-->
<!-- emr_fault_detail m-->
<!-- left join archive_master f-->
<!-- on m.archive_detail_id=f.id-->
<!-- <if test="patientId != null">-->
<!-- INNER JOIN (select id from archive_master where inp_no like '%'+(-->
<!-- select inp_no from archive_master where 1=1-->
<!-- <if test="patientId != null and patientId != ''">-->
<!-- and id=#{patientId,jdbcType=VARCHAR}-->
<!-- </if>-->
<!-- and admission_date_time in(select admission_date_time from Archive_Master where 1=1-->
<!-- <if test="patientId != null and patientId != ''">-->
<!-- and id=#{patientId,jdbcType=VARCHAR}-->
<!-- </if>)-->
<!-- )+'%'-->
<!-- and patindex('%B%',inp_no) != 0-->
<!-- union-->
<!-- select id from archive_master where id=#{patientId,jdbcType=VARCHAR}-->
<!-- )table1-->
<!-- on f.id=table1.id-->
<!-- where 1=1 and m.back_flag= 3-->
<!-- </if>-->
<!-- ) s-->
<!-- on s.id=t.MasterID-->
<!-- <if test="patientId != null">-->
<!-- INNER JOIN(select id from archive_master where inp_no like '%'+(-->
<!-- select inp_no from archive_master where 1=1-->
<!-- <if test="patientId != null and patientId != ''">-->
<!-- and id=#{patientId,jdbcType=VARCHAR}-->
<!-- </if>-->
<!-- )+'%'-->
<!-- and admission_date_time in(select admission_date_time from Archive_Master where 1=1-->
<!-- <if test="patientId != null and patientId != ''">-->
<!-- and id=#{patientId,jdbcType=VARCHAR}-->
<!-- </if>)-->
<!-- and patindex('%B%',inp_no) != 0-->
<!-- union-->
<!-- select id from archive_master where id=#{patientId,jdbcType=VARCHAR}-->
<!-- )table2-->
<!-- on t.MasterID=table2.id-->
<!-- </if>-->
<!-- <if test="source != null and source != '' and source!='-1'">-->
<!-- and t.Source=#{source,jdbcType=VARCHAR}-->
<!-- </if>-->
<!-- <if test="source=='-1'">-->
<!-- and t.Source is null-->
<!-- </if>-->
<!-- <if test="flag != null and flag != ''">-->
<!-- and t.flag = #{flag,jdbcType=NVARCHAR}-->
<!-- </if>-->
<!-- <if test="title != null and title != ''">-->
<!-- and t.title like '%'+#{title,jdbcType=VARCHAR}+'%'-->
<!-- </if>-->
<!-- </select>-->
<select id="detailWithChildByClo" resultMap="BaseResultMap2" parameterType="com.emr.entity.Archive_Detail_Vo">
select
t.MasterID,t.id,t.PDF_PATH,t.Source,CONVERT(varchar(100),t.UpLoadDateTime, 120) UpLoadDateTime,t.SubAssort,t.Title,t.flag,t.page_number,
z.assort_id,z.assort_name,z.assort_sort,z.print_flag,s.create_time,s.cmt_doctor_date,s.cmt_nurse_date,s.ArchiveState
from zd_assort z
left join archive_detail t
on z.assort_id=t.AssortID
LEFT JOIN(
select top 1 f.id,m.create_time,f.cmt_doctor_date,f.cmt_nurse_date,f.ArchiveState from
emr_fault_detail m
left join archive_master f
on m.archive_detail_id=f.id
<if test="patientId != null">
INNER JOIN (select id from archive_master where inp_no like '%'+(
select inp_no from archive_master where 1=1
<if test="patientId != null and patientId != ''">
and id=#{patientId,jdbcType=VARCHAR}
</if>
and admission_date_time in(select admission_date_time from Archive_Master where 1=1
<if test="patientId != null and patientId != ''">
and id=#{patientId,jdbcType=VARCHAR}
</if>)
)+'%'
and patindex('%B%',inp_no) != 0
union
select id from archive_master where id=#{patientId,jdbcType=VARCHAR}
)table1
on f.id=table1.id
where 1=1 and m.back_flag= 3
</if>
) s
on s.id=t.MasterID
<if test="patientId != null">
INNER JOIN(select id from archive_master where inp_no like '%'+(
select inp_no from archive_master where 1=1
<if test="patientId != null and patientId != ''">
and id=#{patientId,jdbcType=VARCHAR}
</if>
)+'%'
and admission_date_time in(select admission_date_time from Archive_Master where 1=1
<if test="patientId != null and patientId != ''">
and id=#{patientId,jdbcType=VARCHAR}
</if>)
and patindex('%B%',inp_no) != 0
union
select id from archive_master where id=#{patientId,jdbcType=VARCHAR}
)table2
on t.MasterID=table2.id
</if>
<if test="source != null and source != '' and source!='-1'">
and t.Source=#{source,jdbcType=VARCHAR}
</if>
<if test="source=='-1'">
and t.Source is null
</if>
<if test="flag != null and flag != ''">
and t.flag = #{flag,jdbcType=NVARCHAR}
</if>
<if test="title != null and title != ''">
and t.title like '%'+#{title,jdbcType=VARCHAR}+'%'
</if>
select
t.MasterID,t.id,t.PDF_PATH,t.Source,CONVERT(varchar(100),t.UpLoadDateTime, 120)
UpLoadDateTime,t.SubAssort,t.Title,t.flag,t.page_number,t.AssortID
from archive_detail t
<where>1=1
<if test="source != null and source != '' and source!='-1'">
and t.Source=#{source,jdbcType=VARCHAR}
</if>
<if test="source=='-1'">
and t.Source is null
</if>
<if test="flag != null and flag != ''">
and t.flag = #{flag,jdbcType=NVARCHAR}
</if>
<if test="title != null and title != ''">
and t.title like '%'+#{title,jdbcType=VARCHAR}+'%'
</if>
<if test="patientId != null and patientId != ''">
and t.MasterID =#{patientId}
</if>
</where>
</select>
<select id="sourceByClo" resultMap="BaseResultMap2" parameterType="com.emr.entity.Archive_Detail_Vo">
@ -691,4 +707,13 @@
</choose>
order by UpLoadDateTime desc
</select>
<select id="detailByCloTop" resultType="com.emr.entity.Archive_Detail_Vo">
select top 1 f.id,m.create_time,f.cmt_doctor_date,f.cmt_nurse_date,f.ArchiveState from
emr_fault_detail m
left join archive_master f
on m.archive_detail_id=f.id
where 1=1 and m.back_flag= 3
and f.id=#{patientId,jdbcType=VARCHAR}
</select>
</mapper>

@ -113,6 +113,8 @@
<result column="flag" jdbcType="INTEGER" property="flag" />
<result column="countNum" jdbcType="INTEGER" property="countNum" />
<result column="handleTimeMax1" jdbcType="NVARCHAR" property="handleTimeMax1"/>
<result column="print_flag" jdbcType="INTEGER" property="printFlag" />
</resultMap>
<sql id="Base_Column_List">
id, patient_id, inp_no, visit_id, name, sex, dept_name, discharge_date_time, ArchiveState,
@ -175,7 +177,7 @@
,ISNULL(printTable.num, 0) printNum
from archive_master m
LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where
typeCode='dept_code' )) d
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
@ -247,8 +249,6 @@
and m.admission_date_time &lt;= #{endDateTo,jdbcType=NCHAR}+ ' 23:59:59'
</when>
</choose>
<if test="checkDoctor != null">
and m.check_doctor = #{checkDoctor,jdbcType=NVARCHAR}
</if>
@ -415,12 +415,164 @@
ORDER BY discharge_date_time desc
</select>
<!-- <select id="selectByLast" parameterType="com.emr.entity.Archive_Master_Vo" resultMap="BaseResultMap2">-->
<!-- select m.id,m.patient_id,m.inp_no,m.visit_id,m.name,m.sex,m.dept_name,CONVERT(varchar(10),m.discharge_date_time, 120) discharge_date_time,m.ArchiveState,CONVERT(varchar(10),m.admission_date_time, 120) admission_date_time,-->
<!-- m.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.first_instance,-->
<!-- m.is_scanning,m.bed_number,ISNULL(s.numb, 0) numb,ao.C5 is_sign,ISNULL(sNurse.numb, 0) faultNurseNum,ISNULL(sDoctor.numb, 0) faultDoctorNum-->
<!-- ,case when emr_fault_detail.archive_detail_id is not null then '是' else '否' end isFault,ISNULL(printTable.num, 0) printNum-->
<!-- from archive_master m-->
<!-- left join (select distinct archive_detail_id from emr_fault_detail where back_flag in ('6','5')) emr_fault_detail-->
<!-- on emr_fault_detail.archive_detail_id = m.ID-->
<!-- 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 distinct masterID,C5 FROM archive_other where sysFlag = '1') ao-->
<!-- on m.id=ao.masterID-->
<!-- 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 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 MasterID,COUNT(*) num from archive_printInfo group by MasterID) printTable-->
<!-- on m.id=printTable.MasterID-->
<!-- where 1=1 and ArchiveState in('初审') and m.Is_Valid!=1-->
<!-- and patindex('%B%',m.inp_no) = 0 and inp_no not like 'LG%'-->
<!-- <if test="isFault != null and isFault != ''">-->
<!-- <if test="isFault == 1">-->
<!-- AND emr_fault_detail.archive_detail_id is not null-->
<!-- </if>-->
<!-- <if test="isFault == 0">-->
<!-- AND emr_fault_detail.archive_detail_id is null-->
<!-- </if>-->
<!-- </if>-->
<!-- <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(#{archivestate,jdbcType=NVARCHAR})-->
<!-- </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 = #{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="checkDatetime != null">-->
<!-- and m.check_datetime = #{checkDatetime,jdbcType=NVARCHAR}-->
<!-- </if>-->
<!-- <if test="checkedDoctor != null">-->
<!-- and m.checked_doctor = #{checkedDoctor,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="deathFlag != null and deathFlag != ''">-->
<!-- and m.death_flag = #{deathFlag,jdbcType=NVARCHAR}-->
<!-- </if>-->
<!-- <if test="isScanning != null and isScanning != ''">-->
<!-- and m.is_scanning = #{isScanning,jdbcType=NVARCHAR}-->
<!-- </if>-->
<!-- <if test="isSign != null ">-->
<!-- and ao.C5 = #{isSign,jdbcType=NVARCHAR}-->
<!-- </if>-->
<!-- <if test="signer != null and signer != ''">-->
<!-- and ao.C1 like '%'+#{signer,jdbcType=NCHAR}+'%'-->
<!-- </if>-->
<!-- <choose>-->
<!-- <when test="startSignDate != null and startSignDate != '' and endSignDate != null and endSignDate != ''">-->
<!-- and m.sign_time between CONVERT(VARCHAR(10),#{startSignDate,jdbcType=NCHAR},120) and-->
<!-- #{endSignDate,jdbcType=NCHAR}+ ' 23:59:59'-->
<!-- </when>-->
<!-- <when test="startSignDate != null and startSignDate != ''">-->
<!-- and m.sign_time >= CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120)-->
<!-- </when>-->
<!-- <when test="endSignDate != null and endSignDate != ''">-->
<!-- and m.sign_time &lt;= #{endSignDate,jdbcType=NCHAR}+ ' 23:59:59'-->
<!-- </when>-->
<!-- </choose>-->
<!-- ORDER BY discharge_date_time desc-->
<!-- </select>-->
<select id="selectByLast" parameterType="com.emr.entity.Archive_Master_Vo" resultMap="BaseResultMap2">
select m.id,m.patient_id,m.inp_no,m.visit_id,m.name,m.sex,m.dept_name,CONVERT(varchar(10),m.discharge_date_time, 120) discharge_date_time,m.ArchiveState,CONVERT(varchar(10),m.admission_date_time, 120) admission_date_time,
m.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.first_instance,
m.is_scanning,m.bed_number,ISNULL(s.numb, 0) numb,ao.C5 is_sign,ISNULL(sNurse.numb, 0) faultNurseNum,ISNULL(sDoctor.numb, 0) faultDoctorNum
,case when emr_fault_detail.archive_detail_id is not null then '是' else '否' end isFault,ISNULL(printTable.num, 0) printNum
,case when emr_fault_detail.archive_detail_id is not null then '是' else '否' end isFault,m.print_flag as printNum
from archive_master m
left join (select distinct archive_detail_id from emr_fault_detail where back_flag in ('6','5')) emr_fault_detail
on emr_fault_detail.archive_detail_id = m.ID
@ -432,8 +584,6 @@
on m.id=sNurse.archive_detail_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 MasterID,COUNT(*) num from archive_printInfo group by MasterID) printTable
on m.id=printTable.MasterID
where 1=1 and ArchiveState in('初审') and m.Is_Valid!=1
and patindex('%B%',m.inp_no) = 0 and inp_no not like 'LG%'
<if test="isFault != null and isFault != ''">
@ -444,14 +594,17 @@
AND emr_fault_detail.archive_detail_id is null
</if>
</if>
<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 test="printNum !=null and printNum !=''">
AND m.print_flag=#{printNum}
</if>
<!-- <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>
@ -564,6 +717,9 @@
ORDER BY discharge_date_time desc
</select>
<select id="selectByUnfile" parameterType="com.emr.entity.Archive_Master_Vo" resultMap="BaseResultMap2">
select m.id,m.patient_id,m.inp_no,m.visit_id,m.name,m.sex,ISNULL(f.name,m.dept_name) dept_name,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
@ -1084,6 +1240,9 @@
delete from archive_master
where id = #{id,jdbcType=NVARCHAR}
</delete>
<delete id="deleteRecordByInp">
DELETE FROM commomtable WHERE patient_id = #{masterId}
</delete>
<insert id="insert" parameterType="com.emr.entity.Archive_Master">
insert into archive_master (id, patient_id, inp_no,
visit_id, name, sex,
@ -1239,6 +1398,97 @@
</if>
</trim>
</insert>
<insert id="insertCommonlyUsed">
insert into commomtable
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="patientId != null">
patient_id,
</if>
<if test="admissTimes != null">
admiss_times,
</if>
<if test="inpatientNo != null">
inpatient_no,
</if>
<if test="name != null">
name,
</if>
<if test="sex != null">
sex,
</if>
<if test="age != null">
age,
</if>
<if test="admissDate != null">
admiss_date,
</if>
<if test="disDate != null">
dis_date,
</if>
<if test="disDept != null">
dis_dept,
</if>
<if test="checkedDatetime != null">
checked_datetime,
</if>
<if test="admissId != null">
admiss_id,
</if>
<if test="ageMonth != null">
age_month,
</if>
<if test="attending != null">
attending,
</if>
<if test="admissDays != null">
admiss_days,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="patientId != null">
#{patientId,jdbcType=NVARCHAR},
</if>
<if test="admissTimes != null">
#{admissTimes,jdbcType=INTEGER},
</if>
<if test="inpatientNo != null">
#{inpatientNo,jdbcType=NVARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=NVARCHAR},
</if>
<if test="sex != null">
#{sex,jdbcType=NVARCHAR},
</if>
<if test="age != null">
#{age,jdbcType=NVARCHAR},
</if>
<if test="admissDate != null">
#{admissDate},
</if>
<if test="disDate != null">
#{disDate},
</if>
<if test="disDept != null">
#{disDept,jdbcType=NVARCHAR},
</if>
<if test="checkedDatetime != null">
#{checkedDatetime,jdbcType=NVARCHAR},
</if>
<if test="admissId != null">
#{admissId,jdbcType=NVARCHAR},
</if>
<if test="ageMonth != null">
#{ageMonth,jdbcType=NVARCHAR},
</if>
<if test="attending != null">
#{attending,jdbcType=NVARCHAR},
</if>
<if test="admissDays != null">
#{admissDays,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByClo" parameterType="com.emr.entity.Archive_Master">
update archive_master
<set>
@ -2420,4 +2670,8 @@
</choose>
</where>
</select>
<select id="selectCommonlyUsed" resultType="com.emr.entity.Archive_Master">
select * from archive_master where id =#{id}
</select>
</mapper>

@ -488,7 +488,7 @@
and f.update_time = #{updateTime,jdbcType=NCHAR}
</if>
<if test="inpNo != null and inpNo != ''">
and m.inp_no like '%'+#{inpNo,jdbcType=NCHAR}+'%'
and m.inp_no = #{inpNo,jdbcType=NCHAR}
</if>
<if test="visitId != null and visitId != ''">
and m.visit_id=#{visitId,jdbcType=NCHAR}

@ -795,7 +795,7 @@
<button type="button" class="btn btn-info btn-sm" id="pdfBtn">查看分段PDF</button>
<button type="button" class="btn btn-success btn-sm" id="pdfBtn2">查看PDF</button>
<%-- <button type="button" class="btn btn-info btn-sm" id="pdfBtn3">查看扫描PDF</button>--%>
<%--<button type="button" class="btn btn-primary btn-sm" id="addBtn">添加清单</button>--%>
<%--<button type="button" class="btn btn-primagetAssortdetailry btn-sm" id="addBtn">添加清单</button>--%>
<button type="button" class="btn btn-warning btn-sm" id="updateStateBtn">选中作废
</button>
<button type="button" class="btn btn-primary btn-sm" id="updateStateBtn2">选中使用
@ -4665,7 +4665,7 @@
$.ajax({
url: "${path}/signList/collection",
type: "POST",
data: {flagNum: 1,id:$("#collectionID").val(),pid:$("#pid").val()},
data: {flagNum: 6,id:$("#collectionID").val(),pid:$("#pid").val()},
success: function (result) {
if (result != null) {
toastr.success(result);
@ -4681,7 +4681,7 @@
$.ajax({
url: "${path}/signList/collection",
type: "POST",
data: {flagNum: 2,id:$("#collectionID").val(),pid:$("#pid").val()},
data: {flagNum: 5,id:$("#collectionID").val(),pid:$("#pid").val()},
success: function (result) {
if (result != null) {
toastr.success(result);
@ -4696,7 +4696,7 @@
$.ajax({
url: "${path}/signList/collection",
type: "POST",
data: {flagNum: 3,id:$("#collectionID").val(),pid:$("#pid").val()},
data: {flagNum: 1,id:$("#collectionID").val(),pid:$("#pid").val()},
success: function (result) {
toastr.success(result);
}
@ -4710,7 +4710,7 @@
$.ajax({
url: "${path}/signList/collection",
type: "POST",
data: {flagNum: 4,id:$("#collectionID").val(),pid:$("#pid").val()},
data: {flagNum: 2,id:$("#collectionID").val(),pid:$("#pid").val()},
success: function (result) {
toastr.success(result);
}
@ -4724,7 +4724,7 @@
$.ajax({
url: "${path}/signList/collection",
type: "POST",
data: {flagNum: 6,id:$("#collectionID").val(),pid:$("#pid").val()},
data: {flagNum: 4,id:$("#collectionID").val(),pid:$("#pid").val()},
success: function (result) {
toastr.success(result);
}
@ -4738,7 +4738,7 @@
$.ajax({
url: "${path}/signList/collection",
type: "POST",
data: {flagNum: 5,id:$("#collectionID").val(),pid:$("#pid").val()},
data: {flagNum: 3,id:$("#collectionID").val(),pid:$("#pid").val()},
success: function (result) {
if (result != null) {
toastr.success(result);

@ -730,12 +730,12 @@
var archiveDetailId = $("#danganhao1").html();
var visitId = $("#visitId").html();
var id = archiveDetailId;
var ArchiveState = $("#archivestate").html();
var StateFlag = $("#archivestate").html();
var recallReason = $("#recallReason").val();
$.ajax({
url: "${path}/storage/updateState",
type: "POST",
data: {"ArchiveState": "已封存", "archiveDetailId": archiveDetailId, recallReason: recallReason,formToken:$("#formToken1").val(),ArchiveStateFlag:"0"},
data: {"ArchiveState": "已封存", "archiveDetailId": archiveDetailId, recallReason: recallReason,formToken:$("#formToken1").val(),ArchiveStateFlag:"0","StateFlag":StateFlag},
success: function (result) {
//刷新
$('#table').bootstrapTable('refresh');

Loading…
Cancel
Save