diff --git a/doc/emr_medical_record.bak b/doc/emr_medical_record.bak new file mode 100644 index 00000000..d808dbcf Binary files /dev/null and b/doc/emr_medical_record.bak differ diff --git a/pom.xml b/pom.xml index 5cc799e3..4b167cb6 100644 --- a/pom.xml +++ b/pom.xml @@ -34,7 +34,6 @@ 2.4 2.1 1.2 - 0.9.5.2 5.0.1.Final 9.2-1004-jdbc4 5.17.0 @@ -377,12 +376,6 @@ ${groovy.version} --> - - com.mchange - c3p0 - ${c3p0.version} - - org.postgresql postgresql diff --git a/src/main/java/com/emr/controller/JAXDynamicClientFactory.java b/src/main/java/com/emr/controller/JAXDynamicClientFactory.java new file mode 100644 index 00000000..bf16514b --- /dev/null +++ b/src/main/java/com/emr/controller/JAXDynamicClientFactory.java @@ -0,0 +1,51 @@ +package com.emr.controller; + +import org.apache.cxf.Bus; +import org.apache.cxf.bus.CXFBusFactory; +import org.apache.cxf.endpoint.EndpointImplFactory; +import org.apache.cxf.endpoint.dynamic.DynamicClientFactory; +import org.apache.cxf.jaxws.support.JaxWsEndpointImplFactory; + +import java.util.List; + +/** + * @ProjectName: + * @Description: + * @Param 传输参数 + * @Return + * @Author: 曾文和 + * @CreateDate: 2019/9/11 16:15 + * @UpdateUser: 曾文和 + * @UpdateDate: 2019/9/11 16:15 + * @UpdateRemark: 更新说明 + * @Version: 1.0 + */ +public class JAXDynamicClientFactory extends DynamicClientFactory { + protected JAXDynamicClientFactory(Bus bus) { + super(bus); + } + + @Override + protected EndpointImplFactory getEndpointImplFactory() { + return JaxWsEndpointImplFactory.getSingleton(); + } + @Override + protected boolean allowWrapperOps() { + return true; + } + + public static JAXDynamicClientFactory newInstance() { + Bus bus = CXFBusFactory.getThreadDefaultBus(); + return new JAXDynamicClientFactory(bus); + } + @Override + public boolean compileJavaSrc(String classPath, List srcList, String dest) { + org.apache.cxf.common.util.Compiler javaCompiler + = new org.apache.cxf.common.util.Compiler(); + javaCompiler.setEncoding("UTF-8"); + javaCompiler.setClassPath(classPath); + javaCompiler.setOutputDir(dest); + javaCompiler.setTarget("1.8"); + return javaCompiler.compileFiles(srcList); + } +} diff --git a/src/main/java/com/emr/controller/LoginController.java b/src/main/java/com/emr/controller/LoginController.java index 53a1c16b..01c81a1f 100644 --- a/src/main/java/com/emr/controller/LoginController.java +++ b/src/main/java/com/emr/controller/LoginController.java @@ -1,12 +1,11 @@ package com.emr.controller; import com.alibaba.fastjson.JSONObject; -import com.emr.util.ActionScopeUtils; +import com.emr.entity.Power_User; import com.emr.util.HttpClientUtils; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.cxf.endpoint.Client; import org.apache.shiro.SecurityUtils; -import org.apache.shiro.authc.AuthenticationException; -import org.apache.shiro.authc.IncorrectCredentialsException; -import org.apache.shiro.authc.UnknownAccountException; import org.apache.shiro.authc.UsernamePasswordToken; import org.apache.shiro.session.Session; import org.apache.shiro.subject.Subject; @@ -14,12 +13,9 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; import java.io.IOException; /** @@ -53,18 +49,32 @@ public class LoginController { //实现用户登录@PathVariable("username") @RequestMapping(value = "/login") - public String login(Model model, HttpServletRequest request) { + public String login(Model model, HttpServletRequest request) throws Exception{ String token = request.getParameter("token"); String userName = request.getParameter("userName"); - String name = request.getParameter("name"); UsernamePasswordToken userToken = new UsernamePasswordToken(userName, "456789"); Subject subject = SecurityUtils.getSubject(); subject.login(userToken); model.addAttribute("POWER_URLHEAD", POWER_JSP); request.getSession().setAttribute("token", token); - // request.getSession().setAttribute("userName", userName); - // request.getSession().setAttribute("userName", "123"); - + JAXDynamicClientFactory dcf = JAXDynamicClientFactory.newInstance(); + Client client = dcf.createClient(POWER_URLHEAD + "/WebService/PowerWebService?wsdl"); + Object[] objects = client.invoke("getInfosByUserId", token, "emr_medical_record"); + ObjectMapper mapper = new ObjectMapper(); + Power_User powerUser = mapper.readValue(objects[0].toString(), Power_User.class); + //设置进session + request.getSession().setAttribute("CURRENT_USER", powerUser); + String url = powerUrl+"?sysFlag=emr_medical_record&userName="+ userName; + JSONObject obj = HttpClientUtils.httpGet(url); + if(obj!=null) { + if ((obj.getString("code")).equals("100")) { + //当验证都通过后,把用户信息放在 session 里 + Session session = SecurityUtils.getSubject().getSession(); + //session.setTimeout(4 * 3600);//以秒为单位,即在没有活动4小时后,session将失效 + session.setTimeout(-1);//以秒为单位,session将失效 + session.setAttribute("menuList", obj); + } + } return "index"; } @@ -73,7 +83,6 @@ public class LoginController { return "index"; } - @RequestMapping(value = "/toError") public String error(Model model) { // 从session获取用户名 diff --git a/src/main/java/com/emr/controller/MedicalRecallController.java b/src/main/java/com/emr/controller/MedicalRecallController.java index 6eec146e..c55c160e 100644 --- a/src/main/java/com/emr/controller/MedicalRecallController.java +++ b/src/main/java/com/emr/controller/MedicalRecallController.java @@ -10,6 +10,7 @@ import com.emr.annotation.OptionalLog; import com.emr.entity.*; import com.emr.service.*; import com.emr.util.ThreadExcelUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.shiro.SecurityUtils; import org.apache.shiro.session.Session; import org.apache.shiro.subject.Subject; @@ -102,6 +103,10 @@ public class MedicalRecallController { @ResponseBody @RequestMapping(value = "/updateState") public int updateState(HttpServletRequest request, HttpServletResponse response, Emr_Fault_Detail emrFaultDetail) throws UnsupportedEncodingException { + String inpatientNo = emrFaultDetail.getContent(); + if(StringUtils.isBlank(inpatientNo)){ + return 0; + } response.setCharacterEncoding("utf-8"); Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER"); String handleName = user.getUserPosition();//姓名 @@ -131,17 +136,22 @@ public class MedicalRecallController { emrFaultDetail.setFirstTrial(null); bol = emrFaultDetailService.insertSel(emrFaultDetail); } - - //2021-01-30 初审成功日志 - Archive_Master_Following archive_master_following = new Archive_Master_Following(); - archive_master_following.setMasterId(emrFaultDetail.getArchiveDetailId()); - //following表中添加病案室审核操作记录 - archive_master_following.setFollowingType("10"); - archive_master_following.setFollowingContent("病案召回"); - archive_master_following.setHandleTime(nowTime); - archive_master_following.setHandleId(username); - archive_master_following.setHandleName(handleName); - archive_master_followingService.insertSelective(archive_master_following); + String lgFlag = inpatientNo.substring(0,2); + if(!"LG".equals(lgFlag)) { + //2021-01-30 初审成功日志 + Archive_Master_Following archive_master_following = new Archive_Master_Following(); + archive_master_following.setMasterId(emrFaultDetail.getArchiveDetailId()); + //following表中添加病案室审核操作记录 + archive_master_following.setFollowingType("10"); + archive_master_following.setFollowingContent("病案召回"); + archive_master_following.setHandleTime(nowTime); + archive_master_following.setHandleId(username); + archive_master_following.setHandleName(handleName); + archive_master_followingService.insertSelective(archive_master_following); + }else{ + //留观号召回推送第三方 + archiveMasterService.requestObservationRecord(inpatientNo,"RETURNED",emrFaultDetail.getRecallReason()); + } } return bol; } diff --git a/src/main/java/com/emr/controller/ObservationRecordController.java b/src/main/java/com/emr/controller/ObservationRecordController.java new file mode 100644 index 00000000..7c925550 --- /dev/null +++ b/src/main/java/com/emr/controller/ObservationRecordController.java @@ -0,0 +1,60 @@ +/** + * Copyright (C), 2015-2019 + * Author: HJL + * Date: 2019/7/19 14:39 + * Description:病案召回 + */ +package com.emr.controller; + +import com.emr.entity.*; +import com.emr.service.Archive_MasterService; +import com.emr.service.Archive_Master_FollowingService; +import com.emr.service.ipml.ObservationRecordService; +import com.emr.util.Msg; +import com.emr.util.ThreadExcelUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.PropertySource; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +@PropertySource(value = "classpath:config/jdbc.properties", encoding = "UTF-8") +@Controller +@RequestMapping("/observationRecord") +public class ObservationRecordController { + @Autowired + private ObservationRecordService observationRecordService; + @Autowired + private Archive_MasterService archiveMasterService; + @Autowired + private Archive_Master_FollowingService archiveMasterFollowingService; + + @ResponseBody + @RequestMapping(value = "/getObservationRecordList") + public OffsetLimitPage getObservationRecordList(Archive_Master_Vo master, Integer offset, Integer limit) { + OffsetLimitPage result = observationRecordService.getObservationRecordList(master, offset, limit); + return result; + } + + @ResponseBody + @RequestMapping(value = "/exportExcel") + public void exportExcel(HttpServletResponse response,Archive_Master_Vo master) throws Exception { + response.setContentType("application/vnd.ms-excel;charset=UTF-8"); + String[] header = {"患者ID","留观号","留观次数","姓名","留观开始日期","留观结束日期","归档状态","是否死亡"}; + String[] fileNames = {"patientId","inpNo","visitId","name","admissionDateTime","dischargeDateTime","archivestate","deathFlag"}; + //文件名 + String fileName = "留观病历信息数据" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls"; + //构造excel的数据 + List list = observationRecordService.getList(master); + ThreadExcelUtils utils = new ThreadExcelUtils(fileName, "", header, fileNames); + utils.exportExcelToFilePath(response,utils.listConvert(list)); + } +} + + diff --git a/src/main/java/com/emr/controller/UrlInterceptor.java b/src/main/java/com/emr/controller/UrlInterceptor.java index 12ac7d89..ed49f735 100644 --- a/src/main/java/com/emr/controller/UrlInterceptor.java +++ b/src/main/java/com/emr/controller/UrlInterceptor.java @@ -6,7 +6,10 @@ */ package com.emr.controller; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; import com.emr.entity.Power_User; +import com.emr.util.HttpClientTool; import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.commons.lang3.StringUtils; import org.apache.cxf.endpoint.Client; @@ -22,6 +25,8 @@ import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import java.io.IOException; import java.io.OutputStreamWriter; +import java.util.HashMap; +import java.util.Map; public class UrlInterceptor implements HandlerInterceptor { @Value("${POWER_URLHEAD}") @@ -72,21 +77,19 @@ public class UrlInterceptor implements HandlerInterceptor { String token = (String) request.getSession().getAttribute("token"); if (!"/login".equals(url) && StringUtils.isNoneBlank(token)) { try { - JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance(); - Client client = dcf.createClient(POWER_URLHEAD + "/WebService/PowerWebService?wsdl"); - Object[] objects = client.invoke("getInfosByUserId", token, "emr_medical_record"); - ObjectMapper mapper = new ObjectMapper(); - Power_User powerUser = mapper.readValue(objects[0].toString(), Power_User.class); - //设置进session - request.getSession().setAttribute("CURRENT_USER", powerUser); - if (null == powerUser.getUserId()) { - response.sendRedirect( "/emr_medical_record/error.jsp"); - - //request.setAttribute("param", "重新登录"); + // 创建url + String requestUrl = POWER_URLHEAD + "/font/checkToken"; + // 执行请求 + Map params = new HashMap<>(); + params.put("token", token); + String resultString = HttpClientTool.doPost(requestUrl, params); + String code = JSONArray.toJSONString(JSON.parseObject(resultString).get("code")); + if ("200".equals(code)) { + response.sendRedirect(POWER_URLHEAD + "/login"); return false; } } catch (Exception e) { - response.sendRedirect("/emr_medical_record/error.jsp"); + response.sendRedirect(POWER_URLHEAD + "/login"); e.printStackTrace(); // response.sendRedirect(POWER_URLHEAD + "/login"); //request.setAttribute("param", "重新登录"); diff --git a/src/main/java/com/emr/controller/beHospitaledController.java b/src/main/java/com/emr/controller/beHospitaledController.java index 2d37abfe..5f11ea0a 100644 --- a/src/main/java/com/emr/controller/beHospitaledController.java +++ b/src/main/java/com/emr/controller/beHospitaledController.java @@ -64,7 +64,7 @@ public class beHospitaledController { @ResponseBody @RequestMapping(value = "/beHospList") - public OffsetLimitPage beHospList(HttpServletRequest request, HttpServletResponse response, Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit) { + public OffsetLimitPage beHospList( Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit) { OffsetLimitPage result = archiveMasterService.selectByColumn(archiveMasterVo, offset, limit); return result; } @@ -73,12 +73,12 @@ public class beHospitaledController { @RequestMapping(value = "/exportExcel") 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","emrDoctorCmt","emrNureCmt","deathFlag"}; + String[] header = {"住院号","住院次数","姓名","性别","床号","出院科室","出院日期","归档医生是否提交","医生","医生提交日期","归档护士是否提交","护士","护士提交日期","电子病历医生提交","电子病历护士提交","是否死亡","是否打印"}; + String[] fileNames = {"inpNo","visitId","name","sex","bedNumber","deptName","dischargeDateTime","doctorInCharge","archivestate","cmtDoctor","doctorName","cmtDoctorDate","cmtNurse","nurseName","cmtDurseDate","emrDoctorCmt","emrNureCmt","deathFlag","printNum"}; //文件名 String fileName = "出院浏览" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls"; //构造excel的数据beHospList - List list = archiveMasterService.selectByColumn(archiveMasterVo); + List list = archiveMasterService.selectBeHospitalByColumn(archiveMasterVo,null,null); ThreadExcelUtils utils = new ThreadExcelUtils(fileName, "", header, fileNames); String result=utils.exportExcelToFilePath(response,utils.listConvert(list)); } @@ -161,7 +161,6 @@ public class beHospitaledController { archiveMaster.setCmtDoctor(1); archiveMaster.setCmtNurse(1); int bol = archiveMasterService.updateByClo(archiveMaster); - //添加初审内容 if (bol == 1) { //参数输入 diff --git a/src/main/java/com/emr/controller/lastVerifyController.java b/src/main/java/com/emr/controller/lastVerifyController.java index aa372464..9fabee08 100644 --- a/src/main/java/com/emr/controller/lastVerifyController.java +++ b/src/main/java/com/emr/controller/lastVerifyController.java @@ -12,9 +12,11 @@ import com.emr.util.ThreadExcelUtils; import com.emr.util.XMLUtil; import com.emr.webservice.MedicalRecordShowBackContent.MR_FILE_CALLBACK_RECORD; import com.emr.webservice.MedicalRecordShowBackContent.MR_FILE_INDEX_CALLBACK; +import lombok.extern.slf4j.Slf4j; import org.apache.axis.client.Call; import org.apache.axis.client.Service; import org.apache.axis.encoding.XMLType; +import org.apache.commons.lang3.StringUtils; import org.apache.cxf.endpoint.Client; import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory; import org.apache.shiro.SecurityUtils; @@ -41,7 +43,6 @@ import java.rmi.RemoteException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; - @Controller @RequestMapping("lastVerify") public class lastVerifyController { @@ -53,9 +54,6 @@ public class lastVerifyController { @Autowired private Archive_MasterService archiveMasterService; - @Autowired - private Emr_DictionaryService emrDictionaryService; - @Autowired private Emr_Fault_TypeService emrFaultTypeService; @@ -124,77 +122,77 @@ public class lastVerifyController { Archive_Master archiveMaster = archiveMasterService.selectById(emrFaultDetail.getArchiveDetailId()); if(archiveMaster!=null) { archiveMaster.setArchivestate(emrFaultDetail.getState()); - //查询该病案号缺陷,如果有医生就退回医生如果有护士则退回护士否则不退回提示 - Emr_Fault_Detail entityFault=new Emr_Fault_Detail(); - entityFault.setArchiveDetailId(emrFaultDetail.getArchiveDetailId()); - List list=emrFaultDetailService.selectByArchiveId(entityFault); - int doctorFlagNum=0; - int nurseFlagNum=0; - if(list!=null && list.size()>0){ - // 从session获取用户名 - Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER"); - String handleName = user.getUserPosition();//姓名 - String username = user.getUserName();//工号 - SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String nowTime = format1.format(new Date()); - - //2021-01-30 - Archive_Master_Following archive_master_following = new Archive_Master_Following(); - archive_master_following.setMasterId(emrFaultDetail.getArchiveDetailId()); - if (emrFaultDetail.getState().equals("主任退回")) { - //1医生 ,2护士 - for (int k = 0; k < list.size(); k++) { - if ("1".equals(list.get(k).getBackFlag()) || "5".equals(list.get(k).getBackFlag())) { - doctorFlagNum+=1; - } - if ("2".equals(list.get(k).getBackFlag()) || "6".equals(list.get(k).getBackFlag())) { - nurseFlagNum+=1; - } - } - - if(doctorFlagNum>0){ - archiveMaster.setCmtDoctor(0); - archiveMaster.setDoctorName(""); - archiveMaster.setCmtDoctorDate(""); - - //2021-01-30 following表中添加科主任退回主管医生操作记录 - archive_master_following.setFollowingType("7"); - archive_master_following.setFollowingContent("科主任退回主管医生"); - archive_master_following.setHandleTime(nowTime); - archive_master_following.setHandleId(username); - archive_master_following.setHandleName(handleName); - archive_master_followingService.insertSelective(archive_master_following); - } - if(nurseFlagNum>0){ - archiveMaster.setCmtNurse(0); - archiveMaster.setNurseName(""); - archiveMaster.setCmtNurseDate(""); - - //2021-01-30 following表中添加科主任退回护士长操作记录 - archive_master_following.setFollowingType("6"); - archive_master_following.setFollowingContent("科主任退回护士长"); - archive_master_following.setHandleTime(nowTime); - archive_master_following.setHandleId(username); - archive_master_following.setHandleName(handleName); - archive_master_followingService.insertSelective(archive_master_following); + //查询该病案号缺陷,如果有医生就退回医生如果有护士则退回护士否则不退回提示 + Emr_Fault_Detail entityFault=new Emr_Fault_Detail(); + entityFault.setArchiveDetailId(emrFaultDetail.getArchiveDetailId()); + List list=emrFaultDetailService.selectByArchiveId(entityFault); + int doctorFlagNum=0; + int nurseFlagNum=0; + if(list!=null && list.size()>0){ + // 从session获取用户名 + Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER"); + String handleName = user.getUserPosition();//姓名 + String username = user.getUserName();//工号 + SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String nowTime = format1.format(new Date()); + + //2021-01-30 + Archive_Master_Following archive_master_following = new Archive_Master_Following(); + archive_master_following.setMasterId(emrFaultDetail.getArchiveDetailId()); + if (emrFaultDetail.getState().equals("主任退回")) { + //1医生 ,2护士 + for (int k = 0; k < list.size(); k++) { + if ("1".equals(list.get(k).getBackFlag()) || "5".equals(list.get(k).getBackFlag())) { + doctorFlagNum+=1; } - - //修改复审内容 - if (bol == 1) { - //判断缺陷记录是否有医生或护士(有则退回状态改1) - //参数输入 - emrFaultDetail.setCreater(username); - emrFaultDetail.setCreateTime(nowTime); - //插入缺陷记录 - bol = emrFaultDetailService.insertSel(emrFaultDetail); + if ("2".equals(list.get(k).getBackFlag()) || "6".equals(list.get(k).getBackFlag())) { + nurseFlagNum+=1; } } - if(doctorFlagNum==0 && nurseFlagNum==0){ - archiveMaster.setCmtDoctor(1); - archiveMaster.setCmtNurse(1); + if(doctorFlagNum>0){ + archiveMaster.setCmtDoctor(0); + archiveMaster.setDoctorName(""); + archiveMaster.setCmtDoctorDate(""); + //2021-01-30 following表中添加科主任退回主管医生操作记录 + archive_master_following.setFollowingType("7"); + archive_master_following.setFollowingContent("科主任退回主管医生"); + archive_master_following.setHandleTime(nowTime); + archive_master_following.setHandleId(username); + archive_master_following.setHandleName(handleName); + archive_master_followingService.insertSelective(archive_master_following); + } + if(nurseFlagNum>0){ + archiveMaster.setCmtNurse(0); + archiveMaster.setNurseName(""); + archiveMaster.setCmtNurseDate(""); + //2021-01-30 following表中添加科主任退回护士长操作记录 + archive_master_following.setFollowingType("6"); + archive_master_following.setFollowingContent("科主任退回护士长"); + archive_master_following.setHandleTime(nowTime); + archive_master_following.setHandleId(username); + archive_master_following.setHandleName(handleName); + archive_master_followingService.insertSelective(archive_master_following); + } + //修改复审内容 + if (bol == 1) { + //判断缺陷记录是否有医生或护士(有则退回状态改1) + //参数输入 + emrFaultDetail.setCreater(username); + emrFaultDetail.setCreateTime(nowTime); + //插入缺陷记录 + bol = emrFaultDetailService.insertSel(emrFaultDetail); } - bol = archiveMasterService.updateByClo(archiveMaster); - if (emrFaultDetail.getState().equals("复审退回")){ + } + if(doctorFlagNum==0 && nurseFlagNum==0){ + archiveMaster.setCmtDoctor(1); + archiveMaster.setCmtNurse(1); + } + bol = archiveMasterService.updateByClo(archiveMaster); + String inpatientNo = archiveMaster.getInpNo(); + //获取留观标识,“LG” + String lgFlag = inpatientNo.substring(0,2); + if(!"LG".equals(lgFlag)) { + if (emrFaultDetail.getState().equals("复审退回")) { //2021-01-30 following表中添加病案室退回操作记录 archive_master_following.setFollowingType("9"); archive_master_following.setFollowingContent("病案室退回科主任"); @@ -203,9 +201,13 @@ public class lastVerifyController { archive_master_following.setHandleName(handleName); archive_master_followingService.insertSelective(archive_master_following); } - }else{ - bol=2; + }else { + //留观号审核推送第三方 + archiveMasterService.requestObservationRecord(inpatientNo, "RETURNED", emrFaultDetail.getBackContent()); } + }else{ + bol=2; + } } return bol; } @@ -214,6 +216,11 @@ public class lastVerifyController { @ResponseBody @RequestMapping(value = "/updateStateByArchivId") public int updateStateByArchivId(HttpServletRequest request, HttpServletResponse response, Emr_Fault_Detail emrFaultDetail) throws UnsupportedEncodingException { + String inpatientNo = emrFaultDetail.getContent(); + if(StringUtils.isBlank(inpatientNo)){ + Archive_Master archiveMaster = archiveMasterService.selectById(emrFaultDetail.getArchiveDetailId()); + inpatientNo = archiveMaster.getInpNo(); + } request.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8"); //修改病案归档状态 @@ -223,7 +230,6 @@ public class lastVerifyController { archiveMaster.setCmtDoctor(1); archiveMaster.setCmtNurse(1); int bol = archiveMasterService.updateByClo(archiveMaster); - //添加初审内容 if (bol == 1) { // 从session获取用户名 @@ -250,19 +256,24 @@ public class lastVerifyController { }else{ bol = emrFaultDetailService.insertSel(emrFaultDetail); } - - //初审成功日志 - Archive_Master_Following archive_master_following = new Archive_Master_Following(); - archive_master_following.setMasterId(emrFaultDetail.getArchiveDetailId()); - //following表中添加病案室审核操作记录 - archive_master_following.setFollowingType("8"); - archive_master_following.setFollowingContent("病案室审核(已归档)"); - archive_master_following.setHandleTime(nowTime); - archive_master_following.setHandleId(username); - archive_master_following.setHandleName(handleName); - archive_master_followingService.insertSelective(archive_master_following); + //获取留观标识,“LG” + String lgFlag = inpatientNo.substring(0,2); + if(!"LG".equals(lgFlag)) { + //初审成功日志 + Archive_Master_Following archive_master_following = new Archive_Master_Following(); + archive_master_following.setMasterId(emrFaultDetail.getArchiveDetailId()); + //following表中添加病案室审核操作记录 + archive_master_following.setFollowingType("8"); + archive_master_following.setFollowingContent("病案室审核(已归档)"); + archive_master_following.setHandleTime(nowTime); + archive_master_following.setHandleId(username); + archive_master_following.setHandleName(handleName); + archive_master_followingService.insertSelective(archive_master_following); + }else{ + //留观号审核推送第三方 + archiveMasterService.requestObservationRecord(inpatientNo,"AUDITED",null); + } } - return bol; } diff --git a/src/main/java/com/emr/dao/ArchivePrintinfoMapper.java b/src/main/java/com/emr/dao/ArchivePrintinfoMapper.java new file mode 100644 index 00000000..91659646 --- /dev/null +++ b/src/main/java/com/emr/dao/ArchivePrintinfoMapper.java @@ -0,0 +1,22 @@ +package com.emr.dao; + +import com.emr.entity.ArchivePrintinfo; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface ArchivePrintinfoMapper { + int deleteByPrimaryKey(Long id); + + int insert(ArchivePrintinfo record); + + int insertSelective(ArchivePrintinfo record); + + ArchivePrintinfo selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(ArchivePrintinfo record); + + int updateByPrimaryKey(ArchivePrintinfo record); + + List selectPrintCountByMasterId(@Param("masterIds") String masterIds); +} \ No newline at end of file diff --git a/src/main/java/com/emr/dao/Archive_MasterMapper.java b/src/main/java/com/emr/dao/Archive_MasterMapper.java index a458ff4e..e08e90d7 100644 --- a/src/main/java/com/emr/dao/Archive_MasterMapper.java +++ b/src/main/java/com/emr/dao/Archive_MasterMapper.java @@ -142,4 +142,11 @@ public interface Archive_MasterMapper { * 查询病案是否存在 * */ List selectByObject(@Param(value = "patientId") String patientId,@Param(value = "visitId")String visitId); + + /** + * 查询留观病历列表 + * @param master + * @return + */ + List getObservationRecordList(Archive_Master_Vo master); } \ No newline at end of file diff --git a/src/main/java/com/emr/entity/ArchivePrintinfo.java b/src/main/java/com/emr/entity/ArchivePrintinfo.java new file mode 100644 index 00000000..7a5025e2 --- /dev/null +++ b/src/main/java/com/emr/entity/ArchivePrintinfo.java @@ -0,0 +1,249 @@ +package com.emr.entity; + +import java.io.Serializable; +import java.util.Date; + +public class ArchivePrintinfo implements Serializable { + private Long id; + + private String printUserid; + + private String printUsername; + + private Date printCreatetime; + + private String archiveDetailId; + + private String masterid; + + private String patientId; + + private String name; + + private String admissId; + + private Integer admissTimes; + + private String assortId; + + private String assortName; + + private String filetitle; + + private Integer pagecount; + + private String sys; + + private String c1; + + private String c2; + + private Integer d1; + + private Integer d2; + + private Date t1; + + private Date t2; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getPrintUserid() { + return printUserid; + } + + public void setPrintUserid(String printUserid) { + this.printUserid = printUserid == null ? null : printUserid.trim(); + } + + public String getPrintUsername() { + return printUsername; + } + + public void setPrintUsername(String printUsername) { + this.printUsername = printUsername == null ? null : printUsername.trim(); + } + + public Date getPrintCreatetime() { + return printCreatetime; + } + + public void setPrintCreatetime(Date printCreatetime) { + this.printCreatetime = printCreatetime; + } + + public String getArchiveDetailId() { + return archiveDetailId; + } + + public void setArchiveDetailId(String archiveDetailId) { + this.archiveDetailId = archiveDetailId == null ? null : archiveDetailId.trim(); + } + + public String getMasterid() { + return masterid; + } + + public void setMasterid(String masterid) { + this.masterid = masterid == null ? null : masterid.trim(); + } + + public String getPatientId() { + return patientId; + } + + public void setPatientId(String patientId) { + this.patientId = patientId == null ? null : patientId.trim(); + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public String getAdmissId() { + return admissId; + } + + public void setAdmissId(String admissId) { + this.admissId = admissId == null ? null : admissId.trim(); + } + + public Integer getAdmissTimes() { + return admissTimes; + } + + public void setAdmissTimes(Integer admissTimes) { + this.admissTimes = admissTimes; + } + + public String getAssortId() { + return assortId; + } + + public void setAssortId(String assortId) { + this.assortId = assortId == null ? null : assortId.trim(); + } + + public String getAssortName() { + return assortName; + } + + public void setAssortName(String assortName) { + this.assortName = assortName == null ? null : assortName.trim(); + } + + public String getFiletitle() { + return filetitle; + } + + public void setFiletitle(String filetitle) { + this.filetitle = filetitle == null ? null : filetitle.trim(); + } + + public Integer getPagecount() { + return pagecount; + } + + public void setPagecount(Integer pagecount) { + this.pagecount = pagecount; + } + + public String getSys() { + return sys; + } + + public void setSys(String sys) { + this.sys = sys == null ? null : sys.trim(); + } + + public String getC1() { + return c1; + } + + public void setC1(String c1) { + this.c1 = c1 == null ? null : c1.trim(); + } + + public String getC2() { + return c2; + } + + public void setC2(String c2) { + this.c2 = c2 == null ? null : c2.trim(); + } + + public Integer getD1() { + return d1; + } + + public void setD1(Integer d1) { + this.d1 = d1; + } + + public Integer getD2() { + return d2; + } + + public void setD2(Integer d2) { + this.d2 = d2; + } + + public Date getT1() { + return t1; + } + + public void setT1(Date t1) { + this.t1 = t1; + } + + public Date getT2() { + return t2; + } + + public void setT2(Date t2) { + this.t2 = t2; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", printUserid=").append(printUserid); + sb.append(", printUsername=").append(printUsername); + sb.append(", printCreatetime=").append(printCreatetime); + sb.append(", archiveDetailId=").append(archiveDetailId); + sb.append(", masterid=").append(masterid); + sb.append(", patientId=").append(patientId); + sb.append(", name=").append(name); + sb.append(", admissId=").append(admissId); + sb.append(", admissTimes=").append(admissTimes); + sb.append(", assortId=").append(assortId); + sb.append(", assortName=").append(assortName); + sb.append(", filetitle=").append(filetitle); + sb.append(", pagecount=").append(pagecount); + sb.append(", sys=").append(sys); + sb.append(", c1=").append(c1); + sb.append(", c2=").append(c2); + sb.append(", d1=").append(d1); + sb.append(", d2=").append(d2); + sb.append(", t1=").append(t1); + sb.append(", t2=").append(t2); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/src/main/java/com/emr/service/Archive_MasterService.java b/src/main/java/com/emr/service/Archive_MasterService.java index 9a86501c..82ec2ef6 100644 --- a/src/main/java/com/emr/service/Archive_MasterService.java +++ b/src/main/java/com/emr/service/Archive_MasterService.java @@ -93,6 +93,13 @@ public interface Archive_MasterService { */ OffsetLimitPage selectByColumn(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit); + /** + * 根据条件查找病案'归档中','审核退回'列表分页 + * + * @param archiveMasterVo + * @return + */ + List selectBeHospitalByColumn(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit); /** * 根据条件查找未归档列表分页 @@ -208,7 +215,7 @@ public interface Archive_MasterService { /** * 封存日志 * - * @param record + * @param * @return */ List selectByFollowinglog(Archive_Master_Vo archiveMasterVo); @@ -217,6 +224,8 @@ public interface Archive_MasterService { * 查询病案是否存在 * */ List selectByObject(String patientId,String visitId); + + void requestObservationRecord(String inpatientNo, String status,String reason); } diff --git a/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java b/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java index f124b5ac..68717ecb 100644 --- a/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java +++ b/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java @@ -8,38 +8,47 @@ package com.emr.service.ipml; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; -import com.emr.dao.Archive_DetailMapper; +import com.emr.dao.ArchivePrintinfoMapper; import com.emr.dao.Archive_MasterMapper; import com.emr.dao.MedicalRecordHomepageCacheMapper; +import com.emr.util.HttpClientTool; +import com.emr.vo.Power_User_Dto; import com.emr.entity.*; import com.emr.service.Archive_MasterService; -import com.emr.service.Emr_DictionaryService; import com.emr.service.PowerUserService; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import com.google.common.base.Function; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import com.google.common.collect.Maps; +import org.springframework.util.CollectionUtils; +import java.io.IOException; import java.util.*; +@Slf4j @Service public class Archive_MasterServiceImpl implements Archive_MasterService { @Autowired private Archive_MasterMapper archiveMasterMapper; - @Autowired - private Emr_DictionaryService emrDictionaryService; - @Autowired private PowerUserService powerUserService; @Autowired private MedicalRecordHomepageCacheMapper medicalRecordHomepageCacheMapper; + @Autowired + private ArchivePrintinfoMapper archivePrintinfoMapper; + + @Value("${observationRecordRequestUrl}") + private String observationRecordRequestUrl; + @Override public Archive_Master selectById(String id) { return archiveMasterMapper.selectById(id); @@ -122,70 +131,146 @@ public class Archive_MasterServiceImpl implements Archive_MasterService { @Override public OffsetLimitPage selectByColumn(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit) { - PageHelper.offsetPage(offset, limit); - List list = archiveMasterMapper.selectByColumn(archiveMasterVo); - - JSONArray powerUsers = powerUserService.getPowerUserList("1"); - List powerUserList = JSONArray.parseArray(powerUsers.toJSONString(), JSONObject.class); - if (powerUserList != null){ - Map mappedMovies = Maps.uniqueIndex(powerUserList, new Function() { - @Override - public String apply(JSONObject temp) { - return temp.getString("userName"); - }}); + List list = selectBeHospitalByColumn(archiveMasterVo,offset,limit); + return new OffsetLimitPage((Page) list); + } - for (Archive_Master_Vo archive_master : list) { - JSONObject userInfo = mappedMovies.get(archive_master.getDoctorName()); - if (userInfo==null){ - archive_master.setDoctorName(archive_master.getDoctorName()); - }else { - archive_master.setDoctorName(userInfo.getString("name")); + /** + * 根据是否打印设置id + * @param archiveMasterVo + */ + private void setIdByPrintNum(Archive_Master_Vo archiveMasterVo){ + //是否查询打印情况 + if(StringUtils.isNotBlank(archiveMasterVo.getPrintNum())){ + List archivePrintinfos = archivePrintinfoMapper.selectPrintCountByMasterId(null); + //定义masterIds + StringBuilder masterIds = new StringBuilder(); + if(!CollectionUtils.isEmpty(archivePrintinfos)){ + for(ArchivePrintinfo archivePrintinfo : archivePrintinfos){ + if(StringUtils.isNotBlank(masterIds)){ + masterIds.append(","); + } + masterIds.append(archivePrintinfo.getMasterid()); } + }else{ + masterIds = new StringBuilder("notAll"); + } + archiveMasterVo.setId(masterIds.toString()); + } + } - userInfo = mappedMovies.get(archive_master.getNurseName()); - if (userInfo==null){ - archive_master.setNurseName(archive_master.getNurseName()); - }else { - archive_master.setNurseName(userInfo.getString("name")); + @Override + public List selectBeHospitalByColumn(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit) { + setIdByPrintNum(archiveMasterVo); + //根据条件查询记录 + if(null != offset && null != limit) { + PageHelper.offsetPage(offset, limit); + } + List list = archiveMasterMapper.selectByColumn(archiveMasterVo); + if(!CollectionUtils.isEmpty(list)) { + //查询用户集合 + JSONArray powerUsers = powerUserService.getPowerUserList("1"); + List powerUserList = null; + if(!CollectionUtils.isEmpty(powerUsers)) { + //转换对象 + powerUserList = JSONArray.parseArray(powerUsers.toJSONString(), Power_User_Dto.class); + } + //定义查询的masterId集合 + StringBuilder masterIds = new StringBuilder(); + //遍历赋值 + for (Archive_Master_Vo archiveMaster : list) { + if(null != powerUserList) { + //获取医生工号 + String doctorName = archiveMaster.getDoctorName(); + //获取护士工号 + String nurseName = archiveMaster.getNurseName(); + //遍历匹配工号赋值姓名 + for(Power_User_Dto powerUserDto : powerUserList){ + String name = powerUserDto.getName(); + if(StringUtils.isNotBlank(doctorName) && powerUserDto.getUserName().equals(doctorName)){ + archiveMaster.setDoctorName(name); + } + if(StringUtils.isNotBlank(nurseName) && powerUserDto.getUserName().equals(nurseName)){ + archiveMaster.setNurseName(name); + } + } + } + //是否打印条件不为空,直接赋值打印标识 + if(StringUtils.isNotBlank(archiveMasterVo.getPrintNum())){ + String printFlag = "未打印"; + if("1".equals(archiveMasterVo.getPrintNum())){ + printFlag = "已打印"; + } + archiveMaster.setPrintNum(printFlag); + }else{ + if(StringUtils.isNotBlank(masterIds)){ + masterIds.append(","); + } + masterIds.append(archiveMaster.getId()); + } + } + //查询打印情况 + if(StringUtils.isNotBlank(masterIds)){ + List archivePrintinfos = archivePrintinfoMapper.selectPrintCountByMasterId(masterIds.toString()); + //定义初始化打印状态 + String printFlag = "未打印"; + for (Archive_Master_Vo archiveMaster : list) { + if(!CollectionUtils.isEmpty(archivePrintinfos)){ + for(ArchivePrintinfo archivePrintinfo : archivePrintinfos){ + if(archivePrintinfo.getMasterid().equals(archiveMaster.getId())){ + printFlag = "已打印"; + break; + } + } + } + archiveMaster.setPrintNum(printFlag); } } + } + return list; + } + /** + * 设置医生和护士姓名 + * @param list + */ + private void setDoctorAndNurseName(List list){ + if(!CollectionUtils.isEmpty(list)) { + //查询用户集合 + JSONArray powerUsers = powerUserService.getPowerUserList("1"); + List powerUserList = null; + if (!CollectionUtils.isEmpty(powerUsers)) { + //转换对象 + powerUserList = JSONArray.parseArray(powerUsers.toJSONString(), Power_User_Dto.class); + } + //遍历赋值 + for (Archive_Master_Vo archiveMaster : list) { + if (null != powerUserList) { + //获取医生工号 + String doctorName = archiveMaster.getDoctorName(); + //获取护士工号 + String nurseName = archiveMaster.getNurseName(); + //遍历匹配工号赋值姓名 + for (Power_User_Dto powerUserDto : powerUserList) { + String name = powerUserDto.getName(); + if (StringUtils.isNotBlank(doctorName) && powerUserDto.getUserName().equals(doctorName)) { + archiveMaster.setDoctorName(name); + } + if (StringUtils.isNotBlank(nurseName) && powerUserDto.getUserName().equals(nurseName)) { + archiveMaster.setNurseName(name); + } + } + } + } } - return new OffsetLimitPage((Page) list); } @Override public OffsetLimitPage selectByUnfile(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit) { PageHelper.offsetPage(offset, limit); List list = archiveMasterMapper.selectByUnfileNew(archiveMasterVo); - - JSONArray powerUsers = powerUserService.getPowerUserList("1"); - List powerUserList = JSONArray.parseArray(powerUsers.toJSONString(), JSONObject.class); - if (powerUserList != null){ - Map mappedMovies = Maps.uniqueIndex(powerUserList, new Function() { - @Override - public String apply(JSONObject temp) { - return temp.getString("userName"); - }}); - - for (Archive_Master_Vo archive_master : list) { - - JSONObject userInfo = mappedMovies.get(archive_master.getDoctorName()); - if (userInfo==null){ - archive_master.setDoctorName(archive_master.getDoctorName()); - }else { - archive_master.setDoctorName(userInfo.getString("name")); - } - - userInfo = mappedMovies.get(archive_master.getNurseName()); - if (userInfo==null){ - archive_master.setNurseName(archive_master.getNurseName()); - }else { - archive_master.setNurseName(userInfo.getString("name")); - } - } - - } + //设置医生和护士姓名 + setDoctorAndNurseName(list); return new OffsetLimitPage((Page) list); } @@ -193,38 +278,8 @@ public class Archive_MasterServiceImpl implements Archive_MasterService { public OffsetLimitPage selectByLast(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit) { PageHelper.offsetPage(offset, limit); List list = archiveMasterMapper.selectByLast(archiveMasterVo); - - JSONArray powerUsers = powerUserService.getPowerUserList("1"); - List powerUserList = JSONArray.parseArray(powerUsers.toJSONString(), JSONObject.class); - - if (powerUserList != null) { - Map mappedMovies = Maps.uniqueIndex(powerUserList, temp -> temp.getString("userName")); - - for (Archive_Master_Vo archive_master : list) { - - JSONObject userInfo = mappedMovies.get(archive_master.getDoctorName()); - if (userInfo == null) { - archive_master.setDoctorName(archive_master.getDoctorName()); - } else { - archive_master.setDoctorName(userInfo.getString("name")); - } - - userInfo = mappedMovies.get(archive_master.getNurseName()); - if (userInfo == null) { - archive_master.setNurseName(archive_master.getNurseName()); - } else { - archive_master.setNurseName(userInfo.getString("name")); - } - - userInfo = mappedMovies.get(archive_master.getFirstInstance()); - if (userInfo == null) { - archive_master.setFirstInstance(archive_master.getFirstInstance()); - } else { - archive_master.setFirstInstance(userInfo.getString("name")); - } - } - } - + //设置医生和护士姓名 + setDoctorAndNurseName(list); return new OffsetLimitPage((Page) list); } @@ -232,34 +287,8 @@ public class Archive_MasterServiceImpl implements Archive_MasterService { public OffsetLimitPage selectByCmtCol(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit) { PageHelper.offsetPage(offset, limit); List list = archiveMasterMapper.selectByCmtCol(archiveMasterVo); - - JSONArray powerUsers = powerUserService.getPowerUserList("1"); - List powerUserList = JSONArray.parseArray(powerUsers.toJSONString(), JSONObject.class); - if (powerUserList != null){ - Map mappedMovies = Maps.uniqueIndex(powerUserList, new Function() { - @Override - public String apply(JSONObject temp) { - return temp.getString("userName"); - }}); - - for (Archive_Master_Vo archive_master : list) { - - JSONObject userInfo = mappedMovies.get(archive_master.getDoctorName()); - if (userInfo==null){ - archive_master.setDoctorName(archive_master.getDoctorName()); - }else { - archive_master.setDoctorName(userInfo.getString("name")); - } - - userInfo = mappedMovies.get(archive_master.getNurseName()); - if (userInfo==null){ - archive_master.setNurseName(archive_master.getNurseName()); - }else { - archive_master.setNurseName(userInfo.getString("name")); - } - } - - } + //设置医生和护士姓名 + setDoctorAndNurseName(list); return new OffsetLimitPage((Page) list); } @@ -381,6 +410,26 @@ public class Archive_MasterServiceImpl implements Archive_MasterService { return archiveMasterMapper.selectByObject(patientId,visitId); } + @Override + public void requestObservationRecord(String inpatientNo, String status,String reason) { + //留观推送第三方 http://10.162.0.51:8091/sanshuyun-ems-function/file/away/updateStatus + Map params = new HashMap<>(); + //留观号 + params.put("watchNo",inpatientNo); + //status状态 AUDITED审核,RETURNED 退回 + params.put("status",status); + if (StringUtils.isNotBlank(reason)) { + params.put("reason",reason); + } + try { + HttpClientTool.doPost(observationRecordRequestUrl,params); + } catch (IOException e) { + e.printStackTrace(); + String errorStr = "留观病历操作推送第三方失败,inpatientNo:" + inpatientNo + ";status:" + status; + System.out.println(errorStr); + log.error(errorStr); + } + } } diff --git a/src/main/java/com/emr/service/ipml/ObservationRecordService.java b/src/main/java/com/emr/service/ipml/ObservationRecordService.java new file mode 100644 index 00000000..495bde43 --- /dev/null +++ b/src/main/java/com/emr/service/ipml/ObservationRecordService.java @@ -0,0 +1,76 @@ +package com.emr.service.ipml; + +import com.emr.dao.ArchivePrintinfoMapper; +import com.emr.dao.Archive_MasterMapper; +import com.emr.entity.ArchivePrintinfo; +import com.emr.entity.Archive_Master; +import com.emr.entity.Archive_Master_Vo; +import com.emr.entity.OffsetLimitPage; +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.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * @ProjectName: + * @Description: + * @Param 传输参数 + * @Return + * @Author: 曾文和 + * @CreateDate: 2021/11/15 14:19 + * @UpdateUser: 曾文和 + * @UpdateDate: 2021/11/15 14:19 + * @UpdateRemark: 更新说明 + * @Version: 1.0 + */ +@Service +@Transactional +public class ObservationRecordService { + @Autowired + private Archive_MasterMapper archiveMasterMapper; + @Autowired + private ArchivePrintinfoMapper archivePrintinfoMapper; + public OffsetLimitPage getObservationRecordList(Archive_Master_Vo master, Integer offset, Integer limit) { + PageHelper.offsetPage(offset, limit); + List list = getList(master); + //查询打印次数 + selectPrintCountByMasterId(list); + return new OffsetLimitPage((Page) list); + } + + /** + * 查询打印次数 + * @param list + */ + private void selectPrintCountByMasterId(List list) { + if(!CollectionUtils.isEmpty(list)){ + StringBuilder masterIds = new StringBuilder(); + for(Archive_Master master : list){ + if(StringUtils.isNotBlank(masterIds)){ + masterIds.append(","); + } + masterIds.append(master.getId()); + } + List archivePrintinfos = archivePrintinfoMapper.selectPrintCountByMasterId(masterIds.toString()); + if(!CollectionUtils.isEmpty(archivePrintinfos)){ + for(Archive_Master master : list){ + for(ArchivePrintinfo archivePrintinfo :archivePrintinfos){ + if(master.getId().equals(archivePrintinfo.getMasterid())){ + master.setPrintNum(archivePrintinfo.getAdmissTimes().toString()); + break; + } + } + } + } + } + } + + public List getList(Archive_Master_Vo master){ + return archiveMasterMapper.getObservationRecordList(master); + } +} diff --git a/src/main/java/com/emr/shiro/MyRealm.java b/src/main/java/com/emr/shiro/MyRealm.java index 94e5d355..b01f3b09 100644 --- a/src/main/java/com/emr/shiro/MyRealm.java +++ b/src/main/java/com/emr/shiro/MyRealm.java @@ -84,36 +84,7 @@ public class MyRealm extends AuthorizingRealm { //通过表单接收的用户名 String username = token.getUsername(); String userpwd = String.valueOf(token.getPassword()); - - if (username != null && !"".equals(username)) { - /*User user = userService.getUserByUsername(username); - if (user != null) { - return new SimpleAuthenticationInfo(user.getUsername(), user.getPassword(), getName()); - } - http://120.27.212.36:8888/power/font/getMenusByUserIdAndSysFlag?sysFlag=emr_medical_record&userName=admin*/ - String url = powerUrl+"?sysFlag=emr_medical_record&userName="+ username; - JSONObject obj = HttpClientUtils.httpGet(url); - if(obj!=null){ - if((obj.getString("code")).equals("100")){ - //当验证都通过后,把用户信息放在 session 里 - Session session = SecurityUtils.getSubject().getSession(); - //session.setTimeout(4 * 3600);//以秒为单位,即在没有活动4小时后,session将失效 - session.setTimeout(-1);//以秒为单位,session将失效 - session.setAttribute("menuList", obj); - //session.setAttribute("userSession",username); - //session.setAttribute("userSessionId", users.get(0).getId()); - //session.setAttribute("userRoles", org.apache.commons.lang.StringUtils.join(roleList, ",")); - //当验证都通过后,把用户信息放在 session 里 - JSONObject list= (JSONObject) obj.getJSONObject("extend"); - //System.out.println(list); - session.setAttribute("userSession", username); - return new SimpleAuthenticationInfo(username, userpwd, getName()); - } - } - - } - - return null; + return new SimpleAuthenticationInfo(username, userpwd, getName()); } } diff --git a/src/main/java/com/emr/util/HttpClientTool.java b/src/main/java/com/emr/util/HttpClientTool.java new file mode 100644 index 00000000..e738c7e1 --- /dev/null +++ b/src/main/java/com/emr/util/HttpClientTool.java @@ -0,0 +1,139 @@ +package com.emr.util; + +import org.apache.commons.lang3.StringUtils; +import org.apache.http.HttpEntity; +import org.apache.http.NameValuePair; +import org.apache.http.ParseException; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.util.EntityUtils; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * 基于 httpclient 4.5版本的 http工具类 + * + * @author + * + */ +public class HttpClientTool { + private static final CloseableHttpClient httpClient; + public static final String CHARSET = "UTF-8"; + // 采用静态代码块,初始化超时时间配置,再根据配置生成默认httpClient对象 + static { + RequestConfig config = RequestConfig.custom().setConnectTimeout(60000).setSocketTimeout(15000).build(); + httpClient = HttpClientBuilder.create().setDefaultRequestConfig(config).build(); + } + + public static String doGet(String url, Map params) { + return doGet(url, params, CHARSET); + } + + public static String doPost(String url, Map params) throws IOException { + return doPost(url, params, CHARSET); + } + + /** + * HTTP Get 获取内容 + * @param url 请求的url地址 ?之前的地址 + * @param params 请求的参数 + * @param charset 编码格式 + * @return 页面内容 + */ + public static String doGet(String url, Map params, String charset) { + if (StringUtils.isBlank(url)) { + return null; + } + try { + if (params != null && !params.isEmpty()) { + List pairs = new ArrayList(params.size()); + for (Map.Entry entry : params.entrySet()) { + String value = entry.getValue(); + if (value != null) { + pairs.add(new BasicNameValuePair(entry.getKey(), value)); + } + } + // 将请求参数和url进行拼接 + url += "?" + EntityUtils.toString(new UrlEncodedFormEntity(pairs, charset)); + } + HttpGet httpGet = new HttpGet(url); + CloseableHttpResponse response = httpClient.execute(httpGet); + int statusCode = response.getStatusLine().getStatusCode(); + if (statusCode != 200) { + httpGet.abort(); + throw new RuntimeException("HttpClient,error status code :" + statusCode); + } + HttpEntity entity = response.getEntity(); + String result = null; + if (entity != null) { + result = EntityUtils.toString(entity, "utf-8"); + } + EntityUtils.consume(entity); + response.close(); + return result; + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + + /** + * HTTP Post 获取内容 + * @param url 请求的url地址 ?之前的地址 + * @param params 请求的参数 + * @param charset 编码格式 + * @return 页面内容 + * @throws IOException + */ + public static String doPost(String url, Map params, String charset) + throws IOException { + if (StringUtils.isBlank(url)) { + return null; + } + List pairs = null; + if (params != null && !params.isEmpty()) { + pairs = new ArrayList(params.size()); + for (Map.Entry entry : params.entrySet()) { + String value = entry.getValue(); + if (value != null) { + pairs.add(new BasicNameValuePair(entry.getKey(), value)); + } + } + } + HttpPost httpPost = new HttpPost(url); + if (pairs != null && pairs.size() > 0) { + httpPost.setEntity(new UrlEncodedFormEntity(pairs, CHARSET)); + } + CloseableHttpResponse response = null; + try { + response = httpClient.execute(httpPost); + int statusCode = response.getStatusLine().getStatusCode(); + if (statusCode != 200) { + httpPost.abort(); + throw new RuntimeException("HttpClient,error status code :" + statusCode); + } + HttpEntity entity = response.getEntity(); + String result = null; + if (entity != null) { + result = EntityUtils.toString(entity, "utf-8"); + } + EntityUtils.consume(entity); + return result; + } catch (ParseException e) { + e.printStackTrace(); + } finally { + if (response != null) + response.close(); + } + return null; + } +} diff --git a/src/main/java/com/emr/vo/Power_User_Dto.java b/src/main/java/com/emr/vo/Power_User_Dto.java new file mode 100644 index 00000000..dd818ffc --- /dev/null +++ b/src/main/java/com/emr/vo/Power_User_Dto.java @@ -0,0 +1,32 @@ +package com.emr.vo; + +import lombok.Data; + +/** + * @ProjectName: + * @Description: + * @Param 传输参数 + * @Return + * @Author: 曾文和 + * @CreateDate: 2021/11/16 10:36 + * @UpdateUser: 曾文和 + * @UpdateDate: 2021/11/16 10:36 + * @UpdateRemark: 更新说明 + * @Version: 1.0 + */ +@Data +public class Power_User_Dto { + private Integer roleId; + + private String roleName; + + private String deptId; + + private String name; + + private String userName; + + private Integer userId; + + private String deptCode; +} diff --git a/src/main/resources/config/applicationContext.xml b/src/main/resources/config/applicationContext.xml index 7c957374..bb4d6ece 100644 --- a/src/main/resources/config/applicationContext.xml +++ b/src/main/resources/config/applicationContext.xml @@ -30,19 +30,32 @@ - + - - - - + + + + - - - - + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/config/config.properties b/src/main/resources/config/config.properties new file mode 100644 index 00000000..c3b99720 --- /dev/null +++ b/src/main/resources/config/config.properties @@ -0,0 +1,2 @@ +#留观推送第三方接口地址 +observationRecordRequestUrl = http://10.162.0.51:8091/sanshuyun-ems-function/file/away/updateStatus diff --git a/src/main/resources/config/jdbc.properties b/src/main/resources/config/jdbc.properties index c3ac1d41..c928ea44 100644 --- a/src/main/resources/config/jdbc.properties +++ b/src/main/resources/config/jdbc.properties @@ -1,8 +1,8 @@ jdbc.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver -jdbc.url=jdbc:sqlserver://120.27.212.36:1433;databaseName=emr_recode_test -#jdbc.url=jdbc:sqlserver://localhost:1433;databaseName=emr_recode_test +#jdbc.url=jdbc:sqlserver://120.27.212.36:1433;databaseName=emr_recode_test +jdbc.url=jdbc:sqlserver://localhost:1433;databaseName=zj_record_new jdbc.username=sa -jdbc.password=docus@702 +jdbc.password=docus702 #hibernate config hibernate.dialect=org.hibernate.dialect.SQLServerDialect hibernate.show_sql=true diff --git a/src/main/resources/config/log4j.properties b/src/main/resources/config/log4j.properties deleted file mode 100644 index ae403fd7..00000000 --- a/src/main/resources/config/log4j.properties +++ /dev/null @@ -1,38 +0,0 @@ - -#Debug,info,warning,error -#log4j.rootLogger=debug,stdout,logfile -#log4j.addivity.org.apache=true -# \u5E94\u7528\u4E8E\u63A7\u5236\u53F0 -#log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender -#log4j.appender.Threshold=DEBUG -#log4j.appender.CONSOLE.Target=System.out -#log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout -#log4j.appender.CONSOLE.layout.ConversionPattern=%d{yyyy-MM-dd HH\:mm\:ss,SSS} %l %m%n -#log4j.appender.CONSOLE.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss} - %c -%-4r [%t] %-5p %c %x - %m%n -#log4j.appender.CONSOLE.layout.ConversionPattern=%d{yyyy-MM-dd HH\:mm\:ss,SSS} %X{ClientIPAddress} %c{1}(%M) %L %m%n -#log4j.appender.FILE=org.apache.log4j.FileAppender -#log4j.appender.FILE=org.apache.log4j.DailyRollingFileAppender -#log4j.appender.FILE.BufferSize=10 -#log4j.appender.FILE.File=C\:\\Users\\WQ\\webApp-Logs\\log4j.Log -#log4j.appender.FILE.File=logs/customer.log -#log4j.appender.FILE.layout=org.apache.log4j.PatternLayout -#log4j.appender.FILE.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss} - %c -%-4r [%t] %-5p %c %x - %m%n -#log4j.appender.FILE.layout.ConversionPattern=%d{yyyy-MM-dd HH\:mm\:ss,SSS} %X{ClientIPAddress} %l %m%n -#log4j.appender.stdout=org.apache.log4j.ConsoleAppender -#log4j.appender.stdout.layout=org.apache.log4j.SimpleLayout -#log4j.logger.com.ibatis=DEBUG -#log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=DEBUG -#log4j.logger.com.ibatis.common.jdbc.ScriptRunner=DEBUG -#log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=DEBUG -#log4j.logger.Java.sql.Connection=DEBUG -#log4j.logger.java.sql.Statement=DEBUG -#log4j.logger.java.sql.PreparedStatement=DEBUG -# General Apache libraries -#log4j.logger.org.apache=WARN -# Spring -#log4j.logger.org.springframework=WARN -# Default Shiro logging -#log4j.logger.org.apache.shiro=TRACE -# Disable verbose logging -#log4j.logger.org.apache.shiro.util.ThreadContext=WARN -#log4j.logger.org.apache.shiro.cache.ehcache.EhCache=WARN diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j.properties new file mode 100644 index 00000000..31d451d8 --- /dev/null +++ b/src/main/resources/log4j.properties @@ -0,0 +1,27 @@ +log4j.logger.myLog=debug,myLog +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.layout=org.apache.log4j.PatternLayout +log4j.appender.myLog.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss}:%m%n + +log4j.logger.errorMsg=error,errorMsg +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.layout=org.apache.log4j.PatternLayout +log4j.appender.errorMsg.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss}:%m%n + +#Console sql +#log4j.rootLogger=debug,myLog,errorMsg,compeleteMsg,CONSOLE +log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender +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 diff --git a/src/main/resources/mapper/ArchivePrintinfoMapper.xml b/src/main/resources/mapper/ArchivePrintinfoMapper.xml new file mode 100644 index 00000000..b33ea8fd --- /dev/null +++ b/src/main/resources/mapper/ArchivePrintinfoMapper.xml @@ -0,0 +1,291 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + ID, print_userid, print_username, print_createtime, archive_detail_id, MasterID, + patient_id, name, admiss_id, admiss_times, assort_id, assort_name, FileTitle, PageCount, + sys, C1, C2, D1, D2, T1, T2 + + + + delete from archive_printInfo + where ID = #{id,jdbcType=BIGINT} + + + insert into archive_printInfo (ID, print_userid, print_username, + print_createtime, archive_detail_id, MasterID, + patient_id, name, admiss_id, + admiss_times, assort_id, assort_name, + FileTitle, PageCount, sys, + C1, C2, D1, D2, + T1, T2) + values (#{id,jdbcType=BIGINT}, #{printUserid,jdbcType=NVARCHAR}, #{printUsername,jdbcType=NVARCHAR}, + #{printCreatetime,jdbcType=TIMESTAMP}, #{archiveDetailId,jdbcType=NVARCHAR}, #{masterid,jdbcType=NVARCHAR}, + #{patientId,jdbcType=NVARCHAR}, #{name,jdbcType=NVARCHAR}, #{admissId,jdbcType=NVARCHAR}, + #{admissTimes,jdbcType=INTEGER}, #{assortId,jdbcType=NVARCHAR}, #{assortName,jdbcType=NVARCHAR}, + #{filetitle,jdbcType=NVARCHAR}, #{pagecount,jdbcType=INTEGER}, #{sys,jdbcType=NVARCHAR}, + #{c1,jdbcType=NVARCHAR}, #{c2,jdbcType=NVARCHAR}, #{d1,jdbcType=INTEGER}, #{d2,jdbcType=INTEGER}, + #{t1,jdbcType=TIMESTAMP}, #{t2,jdbcType=TIMESTAMP}) + + + insert into archive_printInfo + + + ID, + + + print_userid, + + + print_username, + + + print_createtime, + + + archive_detail_id, + + + MasterID, + + + patient_id, + + + name, + + + admiss_id, + + + admiss_times, + + + assort_id, + + + assort_name, + + + FileTitle, + + + PageCount, + + + sys, + + + C1, + + + C2, + + + D1, + + + D2, + + + T1, + + + T2, + + + + + #{id,jdbcType=BIGINT}, + + + #{printUserid,jdbcType=NVARCHAR}, + + + #{printUsername,jdbcType=NVARCHAR}, + + + #{printCreatetime,jdbcType=TIMESTAMP}, + + + #{archiveDetailId,jdbcType=NVARCHAR}, + + + #{masterid,jdbcType=NVARCHAR}, + + + #{patientId,jdbcType=NVARCHAR}, + + + #{name,jdbcType=NVARCHAR}, + + + #{admissId,jdbcType=NVARCHAR}, + + + #{admissTimes,jdbcType=INTEGER}, + + + #{assortId,jdbcType=NVARCHAR}, + + + #{assortName,jdbcType=NVARCHAR}, + + + #{filetitle,jdbcType=NVARCHAR}, + + + #{pagecount,jdbcType=INTEGER}, + + + #{sys,jdbcType=NVARCHAR}, + + + #{c1,jdbcType=NVARCHAR}, + + + #{c2,jdbcType=NVARCHAR}, + + + #{d1,jdbcType=INTEGER}, + + + #{d2,jdbcType=INTEGER}, + + + #{t1,jdbcType=TIMESTAMP}, + + + #{t2,jdbcType=TIMESTAMP}, + + + + + update archive_printInfo + + + print_userid = #{printUserid,jdbcType=NVARCHAR}, + + + print_username = #{printUsername,jdbcType=NVARCHAR}, + + + print_createtime = #{printCreatetime,jdbcType=TIMESTAMP}, + + + archive_detail_id = #{archiveDetailId,jdbcType=NVARCHAR}, + + + MasterID = #{masterid,jdbcType=NVARCHAR}, + + + patient_id = #{patientId,jdbcType=NVARCHAR}, + + + name = #{name,jdbcType=NVARCHAR}, + + + admiss_id = #{admissId,jdbcType=NVARCHAR}, + + + admiss_times = #{admissTimes,jdbcType=INTEGER}, + + + assort_id = #{assortId,jdbcType=NVARCHAR}, + + + assort_name = #{assortName,jdbcType=NVARCHAR}, + + + FileTitle = #{filetitle,jdbcType=NVARCHAR}, + + + PageCount = #{pagecount,jdbcType=INTEGER}, + + + sys = #{sys,jdbcType=NVARCHAR}, + + + C1 = #{c1,jdbcType=NVARCHAR}, + + + C2 = #{c2,jdbcType=NVARCHAR}, + + + D1 = #{d1,jdbcType=INTEGER}, + + + D2 = #{d2,jdbcType=INTEGER}, + + + T1 = #{t1,jdbcType=TIMESTAMP}, + + + T2 = #{t2,jdbcType=TIMESTAMP}, + + + where ID = #{id,jdbcType=BIGINT} + + + update archive_printInfo + set print_userid = #{printUserid,jdbcType=NVARCHAR}, + print_username = #{printUsername,jdbcType=NVARCHAR}, + print_createtime = #{printCreatetime,jdbcType=TIMESTAMP}, + archive_detail_id = #{archiveDetailId,jdbcType=NVARCHAR}, + MasterID = #{masterid,jdbcType=NVARCHAR}, + patient_id = #{patientId,jdbcType=NVARCHAR}, + name = #{name,jdbcType=NVARCHAR}, + admiss_id = #{admissId,jdbcType=NVARCHAR}, + admiss_times = #{admissTimes,jdbcType=INTEGER}, + assort_id = #{assortId,jdbcType=NVARCHAR}, + assort_name = #{assortName,jdbcType=NVARCHAR}, + FileTitle = #{filetitle,jdbcType=NVARCHAR}, + PageCount = #{pagecount,jdbcType=INTEGER}, + sys = #{sys,jdbcType=NVARCHAR}, + C1 = #{c1,jdbcType=NVARCHAR}, + C2 = #{c2,jdbcType=NVARCHAR}, + D1 = #{d1,jdbcType=INTEGER}, + D2 = #{d2,jdbcType=INTEGER}, + T1 = #{t1,jdbcType=TIMESTAMP}, + T2 = #{t2,jdbcType=TIMESTAMP} + where ID = #{id,jdbcType=BIGINT} + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/Archive_MasterMapper.xml b/src/main/resources/mapper/Archive_MasterMapper.xml index 24a36527..c4e9f17e 100644 --- a/src/main/resources/mapper/Archive_MasterMapper.xml +++ b/src/main/resources/mapper/Archive_MasterMapper.xml @@ -169,7 +169,7 @@ 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) = 0 + and patindex('%B%',m.inp_no) = 0 and inp_no not like 'LG%' and (m.dept_admission_to in @@ -269,7 +269,7 @@ 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,d.name 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.is_scanning, 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.bed_number,ISNULL(s.numb, 0) numb - ,ISNULL(sDoctor.numb, 0) faultDoctorNum,ISNULL(sNurse.numb, 0) faultNurseNum,ISNULL(printTable.num, 0) printNum,ISNULL(extDoctor.num, 0) doctorNum,ISNULL(extNurse.num, 0) nurseNum + ,ISNULL(sDoctor.numb, 0) faultDoctorNum,ISNULL(sNurse.numb, 0) faultNurseNum,ISNULL(extDoctor.num, 0) doctorNum,ISNULL(extNurse.num, 0) nurseNum 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 @@ -283,8 +283,6 @@ 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 MasterID,COUNT(*) num from archive_printInfo group by MasterID) printTable - on m.id=printTable.MasterID LEFT JOIN (select zyh,jzh,COUNT(*) num from archive_other_ext where T1!='1801-02-03 00:00:00.000' group by zyh,jzh) extDoctor on m.inp_no=extDoctor.zyh and m.visit_id=extDoctor.jzh @@ -292,7 +290,7 @@ on m.inp_no=extNurse.zyh and m.visit_id=extNurse.jzh where 1=1 and ArchiveState in('归档中','提交','主任退回') - and patindex('%B%',m.inp_no) = 0 + and patindex('%B%',m.inp_no) = 0 and inp_no not like 'LG%' and m.emr_doctor_cmt='提交' @@ -301,8 +299,19 @@ and m.emr_nure_cmt='提交' - - and m.id = #{id,jdbcType=NVARCHAR} + + and m.id + + + in + + not in + + ( + + #{item} + + ) and m.inp_no like '%'+#{inpNo,jdbcType=NCHAR}+'%' @@ -416,7 +425,7 @@ 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 patindex('%B%',m.inp_no) = 0 + and patindex('%B%',m.inp_no) = 0 and inp_no not like 'LG%' and m.id = #{id,jdbcType=NVARCHAR} @@ -546,7 +555,7 @@ 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 where 1=1 - and m.ArchiveState not in('作废','已封存') + and m.ArchiveState not in('作废','已封存') and inp_no not like 'LG%' and m.id = #{id,jdbcType=NVARCHAR} @@ -679,7 +688,7 @@ on m.id=printTable.MasterID where 1=1 and patindex('%B%',m.inp_no) in (0,1) - and m.ArchiveState not in('作废','已封存') + and m.ArchiveState not in('作废','已封存') and inp_no not like 'LG%' and m.id = #{id,jdbcType=NVARCHAR} @@ -808,7 +817,7 @@ 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 patindex('%B%',m.inp_no) = 0 + and patindex('%B%',m.inp_no) = 0 and inp_no not like 'LG%' and m.id = #{id,jdbcType=NVARCHAR} @@ -1562,4 +1571,68 @@ ORDER BY f.handle_time desc + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jspf/comm.jspf b/src/main/webapp/WEB-INF/jspf/comm.jspf index ae6887c5..a51d4d6f 100644 --- a/src/main/webapp/WEB-INF/jspf/comm.jspf +++ b/src/main/webapp/WEB-INF/jspf/comm.jspf @@ -2,7 +2,7 @@ <%----%> - + <%----%> @@ -13,7 +13,7 @@ - + diff --git a/src/main/webapp/WEB-INF/jspf/common.jspf b/src/main/webapp/WEB-INF/jspf/common.jspf index 29aaecf3..12ea8d9c 100644 --- a/src/main/webapp/WEB-INF/jspf/common.jspf +++ b/src/main/webapp/WEB-INF/jspf/common.jspf @@ -17,7 +17,7 @@ --%> <%----%> - + @@ -32,7 +32,7 @@ <%----%> - + diff --git a/src/main/webapp/WEB-INF/views/beHospitaledDir/beHospList.jsp b/src/main/webapp/WEB-INF/views/beHospitaledDir/beHospList.jsp index c67c14e4..fbc16882 100644 --- a/src/main/webapp/WEB-INF/views/beHospitaledDir/beHospList.jsp +++ b/src/main/webapp/WEB-INF/views/beHospitaledDir/beHospList.jsp @@ -34,24 +34,6 @@ padding: 5px; } - .seal-result { - width: 60px; - height: 60px; - transform: rotate(30deg); - border: solid 2px red; - border-radius: 100%; - text-align: center; - color: red; - font-size: 16px; - font-weight: bold; - line-height: 60px; - left: 17.5%; - top: 6%; - position: absolute; - background-color: rgba(255, 255, 255, 0.8); - z-index: 1000; - } - .divCss { margin-top: 5px; } @@ -507,10 +489,6 @@
- <%--
--%> - <%----%> - <%----%> - <%--
--%>
@@ -523,21 +501,8 @@
- <%--
--%> - <%----%> - <%----%> - <%--
--%>
- <%----%>
@@ -585,9 +546,16 @@
+
+ + +
-
@@ -613,34 +581,6 @@ -<%--缺陷窗口--%> -<%----%> - -<%----%> -