From 00c425a04513725cd201f89b7101e31e5e3e74b4 Mon Sep 17 00:00:00 2001 From: wangxh Date: Sat, 11 Apr 2020 14:51:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commomSearch/CommomSearchController.java | 933 +++++------ .../EmrPrintDownloadInfo.java | 35 +- src/main/resources/mapper/CommomMapper.xml | 1412 +++++++++-------- .../EmrPrintDownloadInfoMapper.xml | 416 ++--- src/main/webapp/index.jsp | 2 +- 5 files changed, 1476 insertions(+), 1322 deletions(-) diff --git a/src/main/java/com/emr/controller/commomSearch/CommomSearchController.java b/src/main/java/com/emr/controller/commomSearch/CommomSearchController.java index def02fb..ed49e00 100644 --- a/src/main/java/com/emr/controller/commomSearch/CommomSearchController.java +++ b/src/main/java/com/emr/controller/commomSearch/CommomSearchController.java @@ -183,13 +183,30 @@ public class CommomSearchController { } } + //阿拉伯数字转中文 + private static String toChinese(String str) { + String[] s1 = {"零", "一", "二", "三", "四", "五", "六", "七", "八", "九"}; + String[] s2 = {"十", "百", "千", "万", "十", "百", "千", "亿", "十", "百", "千"}; + String result = ""; + int n = str.length(); + for (int i = 0; i < n; i++) { + int num = str.charAt(i) - '0'; + if (i != n - 1 && num != 0) { + result += s1[num] + s2[n - 2 - i]; + } else { + result += s1[num]; + } + } + return result; + } + //加载科室 @RequestMapping("getDept") @ResponseBody - public String getDept(){ + public String getDept() { try { //加载科室集合 - List deptList = dictionaryMapper.selectDictionaryByTypeCode("dept_code"); + List deptList = dictionaryMapper.selectDictionaryByTypeCode(""); return JSON.toJSONString(deptList); }catch (Exception e){ e.printStackTrace(); @@ -197,9 +214,14 @@ public class CommomSearchController { } } + /** + * 加载公共表信息 + * + * @return + */ @RequestMapping("getCommonInfo") @ResponseBody - public String getCommonInfo(){ + public String getCommonInfo() { try { List commomVoList = commomMapper.selectAllInfo(); return JSON.toJSONString(commomVoList); @@ -211,11 +233,11 @@ public class CommomSearchController { @RequestMapping("getDept174") @ResponseBody - public String getDept174(){ + public String getDept174() { try { //加载科室集合 return JSON.toJSONString(deptCodeMapper.selectAll()); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return null; } @@ -224,33 +246,35 @@ public class CommomSearchController { //加载转归情况 @RequestMapping("getDiagStatus") @ResponseBody - public String getDiagStatus(){ + public String getDiagStatus() { try { //加载病状转归集合 List diagStatusList = dictionaryMapper.selectDictionaryByTypeCode("dis_diag_status"); return JSON.toJSONString(diagStatusList); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return null; } } + /*******************************************病案预览操作*********************************************************/ + //加载转归情况 @RequestMapping("getDiagStatus174") @ResponseBody - public String getDiagStatus174(){ + public String getDiagStatus174() { try { //加载病状转归集合 return JSON.toJSONString(disDiagStatusMapper.selectAll()); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return null; } } - /*******************************************病案预览操作*********************************************************/ + /** * @MethodName: showRecord * @Description: 跳转到病案预览 - * @Param String patientId:patientId + * @Param String patientId:patientId * @Return * @Author: 曾文和 * @CreateDate: 2019-05-29 @@ -259,16 +283,16 @@ public class CommomSearchController { * @UpdateRemark: 更新说明 * @Version: 1.0 */ - @OptionalLog(module = "查看",methods = "病案预览页面") + @OptionalLog(module = "查看", methods = "病案预览页面") @RequestMapping("showRecord") - public String showRecord(String patientId,Model model,HttpServletRequest request){ + public String showRecord(String patientId, Model model, HttpServletRequest request) { try { - model.addAttribute("patientId",patientId); + model.addAttribute("patientId", patientId); //加载登陆者 - Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER"); - model.addAttribute("user",user); - model.addAttribute("roleId",user.getRoleId()); - }catch (Exception e){ + Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER"); + model.addAttribute("user", user); + model.addAttribute("roleId", user.getRoleId()); + } catch (Exception e) { e.printStackTrace(); } return "recordManage/commomSearch/showRecord"; @@ -277,7 +301,7 @@ public class CommomSearchController { /** * @MethodName: showRecordBlood * @Description: 跳转到档案预览 - * @Param String patientId:patientId + * @Param String patientId:patientId * @Return * @Author: 曾文和 * @CreateDate: 2019-05-29 @@ -286,20 +310,20 @@ public class CommomSearchController { * @UpdateRemark: 更新说明 * @Version: 1.0 */ - @OptionalLog(module = "查看",methods = "档案预览页面") + @OptionalLog(module = "查看", methods = "档案预览页面") @RequestMapping("showRecordBlood") - public String showRecordBlood(String patientId,Model model,HttpServletRequest request){ + public String showRecordBlood(String patientId, Model model, HttpServletRequest request) { try { - model.addAttribute("patientId",patientId); + model.addAttribute("patientId", patientId); //加载登陆者 - Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER"); - model.addAttribute("user",user); - model.addAttribute("roleId",user.getRoleId()); + Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER"); + model.addAttribute("user", user); + model.addAttribute("roleId", user.getRoleId()); List printCount = printOrDownLoadInfoService.getPrintCount(patientId); - if(null != printCount && !printCount.isEmpty()){ - model.addAttribute("printCount",1); + if (null != printCount && !printCount.isEmpty()) { + model.addAttribute("printCount", 1); } - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); } return "recordManage/commomSearch/showRecordBlood"; @@ -308,7 +332,7 @@ public class CommomSearchController { /** * @MethodName: showRecord174 * @Description: 跳转到档案预览 - * @Param String patientId:patientId + * @Param String patientId:patientId * @Return * @Author: 曾文和 * @CreateDate: 2019-05-29 @@ -318,20 +342,20 @@ public class CommomSearchController { * @Version: 1.0 */ @RequestMapping("showRecord174") - public String showRecord174(String patientId,Model model,HttpServletRequest request){ + public String showRecord174(String patientId, Model model, HttpServletRequest request) { try { - model.addAttribute("patientId",patientId); + model.addAttribute("patientId", patientId); //加载登陆者 - Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER"); - if(null != user){ - model.addAttribute("user",user); - model.addAttribute("roleId",user.getRoleId()); + Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER"); + if (null != user) { + model.addAttribute("user", user); + model.addAttribute("roleId", user.getRoleId()); } List printCount = printOrDownLoadInfoService.getPrintCount(patientId); - if(null != printCount && !printCount.isEmpty()){ - model.addAttribute("printCount",1); + if (null != printCount && !printCount.isEmpty()) { + model.addAttribute("printCount", 1); } - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); } return "recordManage/commomSearch/showRecord174"; @@ -340,13 +364,13 @@ public class CommomSearchController { //加载病案信息 @RequestMapping("getRecord") @ResponseBody - public String getRecord(String patientId){ - if(StringUtils.isNoneBlank(patientId)) { + public String getRecord(String patientId) { + if (StringUtils.isNoneBlank(patientId)) { try { //根据patientId查询包含其他诊断的基本信息 List commomVos = commomMapper.selectOtherDiagByPatientId(patientId); return JSON.toJSONString(commomVos.get(0)); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return null; } @@ -357,19 +381,19 @@ public class CommomSearchController { //加载住院次数 @RequestMapping("getAdmissTimes") @ResponseBody - public String getAdmissTimes(String name,String inpatientNo){ - if(StringUtils.isNoneBlank(name) && StringUtils.isNotBlank(inpatientNo)) { + public String getAdmissTimes(String name, String inpatientNo) { + if (StringUtils.isNoneBlank(name) && StringUtils.isNotBlank(inpatientNo)) { try { //根据名字病案号查询住院次数集合 - List admissTimes = commomMapper.selectAdmissTimesByNameAndNo(name,inpatientNo); - if(null != admissTimes && !admissTimes.isEmpty()) { + List admissTimes = commomMapper.selectAdmissTimesByNameAndNo(name, inpatientNo); + if (null != admissTimes && !admissTimes.isEmpty()) { for (int i = 0; i < admissTimes.size(); i++) { //设置住院次数下拉框text中文名称 admissTimes.get(i).setAdmissTimesName("第" + toChinese(admissTimes.get(i).getAdmissTimes() + "") + "次"); } } return JSON.toJSONString(admissTimes); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return null; } @@ -379,20 +403,20 @@ public class CommomSearchController { /** * 加载上传图片的分类 - * */ + */ @RequestMapping("getAssortList") @ResponseBody - public ResultUtil getAssortList(HttpServletRequest request){ - try{ - Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER"); - List zdAssorts = new ArrayList<>(); - if(user.getRoleId() == 0 || user.getRoleId() == -100){ + public ResultUtil getAssortList(HttpServletRequest request) { + try { + Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER"); + List zdAssorts = new ArrayList<>(); + if (user.getRoleId() == 0 || user.getRoleId() == -100) { zdAssorts = assortMapper.selectAll(new Zd_Assort()); - }else{ - zdAssorts = assortMapper.selectAllAndUserReaderByUserIdAndRoleId(user.getUserId(),user.getRoleId()); + } else { + zdAssorts = assortMapper.selectAllAndUserReaderByUserIdAndRoleId(user.getUserId(), user.getRoleId()); } return ResultUtil.ok(zdAssorts); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return ResultUtil.error("查询图片分类出错了,请联系系统管理员!"); } @@ -400,8 +424,8 @@ public class CommomSearchController { /** * @MethodName: showRecordIframe - * @Description: 病案预览Iframe,按住院次数显示页面 - * @Param String patientId:patientId + * @Description: 病案预览Iframe, 按住院次数显示页面 + * @Param String patientId:patientId * @Return * @Author: 曾文和 * @CreateDate: 2019-06-04 @@ -411,12 +435,12 @@ public class CommomSearchController { * @Version: 1.0 */ @RequestMapping("showRecordIframe") - public String showRecordIframe(String patientId,Model model,HttpServletRequest request){ - model.addAttribute("patientId",patientId); - Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER"); + public String showRecordIframe(String patientId, Model model, HttpServletRequest request) { + model.addAttribute("patientId", patientId); + Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER"); //打印分类集合 - List emrTypes = emrTypeService.selectAllByCreater(1,request); - model.addAttribute("emrTypes",emrTypes); + List emrTypes = emrTypeService.selectAllByCreater(1, request); + model.addAttribute("emrTypes", emrTypes); //病案分段集合 //TODO 重新分页注释 /* List zdAssorts = new ArrayList<>(); @@ -426,66 +450,67 @@ public class CommomSearchController { zdAssorts = assortMapper.selectAllAndUserReaderByUserIdAndRoleId(user.getUserId(),user.getRoleId()); } model.addAttribute("zdAssorts",zdAssorts);*/ - model.addAttribute("user",user); + model.addAttribute("user", user); return "recordManage/commomSearch/showRecordIframe"; } + //脐血库 @RequestMapping("showRecordIframeBlood") - public String showRecordIframeBlood(String patientId,String flag,Model model,HttpServletRequest request){ - model.addAttribute("patientId",patientId); - model.addAttribute("flag",flag); - Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER"); + public String showRecordIframeBlood(String patientId, String flag, Model model, HttpServletRequest request) { + model.addAttribute("patientId", patientId); + model.addAttribute("flag", flag); + Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER"); //打印分类集合 - List emrTypes = emrTypeService.selectAllByCreater(1,request); - model.addAttribute("emrTypes",emrTypes); + List emrTypes = emrTypeService.selectAllByCreater(1, request); + model.addAttribute("emrTypes", emrTypes); //病案分段集合 //TODO 重新分页注释 - List zdAssorts = assortService.selectAllByPower(user); - model.addAttribute("zdAssorts",zdAssorts); + List zdAssorts = assortService.selectAllByPower(user); + model.addAttribute("zdAssorts", zdAssorts); int isDownload = apply_approveMapper.selectIsPowerByUser(user.getUserName(), patientId, 3); - model.addAttribute("isDownload",isDownload); + model.addAttribute("isDownload", isDownload); //查询是否有打印权限 Integer printFlag = 0; Set menus = user.getMenus(); - for(String menu : menus){ - if(StringUtils.isNotBlank(menu)){ - if("/commom/printPdf".equals(menu)){ + for (String menu : menus) { + if (StringUtils.isNotBlank(menu)) { + if ("/commom/printPdf".equals(menu)) { printFlag = 1; break; } } } - model.addAttribute("printFlag",printFlag); + model.addAttribute("printFlag", printFlag); return "recordManage/commomSearch/showRecordIframeBlood"; } //查询分段集合 @RequestMapping("selectIsPowerByUser") @ResponseBody - public String selectIsPowerByUser(HttpServletRequest request){ - Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER"); - List zdAssorts = assortService.selectAllByPower(user); + public String selectIsPowerByUser(HttpServletRequest request) { + Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER"); + List zdAssorts = assortService.selectAllByPower(user); return JSON.toJSONString(zdAssorts); } - //脐血库 //获取病案图片根路径 @RequestMapping("getFilePath") @ResponseBody - public ResultUtil getFilePath(String patientId){ - try{ + public ResultUtil getFilePath(String patientId) { + try { CommomVo commomVo = commomMapper.selectByPrimaryKey(patientId); return ResultUtil.ok(commomVo); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return ResultUtil.error("出错了,请联系系统管理员!"); } } + /** * @MethodName: getOtherDiagNameByAdmissTimesAndInpatientNo * @Description: 根据admissTimes和inpatientNo查询包含其他诊断名称的基本信息 - * @Param Integer admissTimes:住院次数,String inpatientNo:病案号 + * @Param Integer admissTimes:住院次数,String inpatientNo:病案号 * @Return * @Author: 曾文和 * @CreateDate: 2019-06-05 @@ -494,54 +519,55 @@ public class CommomSearchController { * @UpdateRemark: 更新说明 * @Version: 1.0 */ - @RequestMapping(value="getOtherDiagNameByAdmissTimesAndInpatientNo",produces = {"text/json;charset=UTF-8"}) + @RequestMapping(value = "getOtherDiagNameByAdmissTimesAndInpatientNo", produces = {"text/json;charset=UTF-8"}) @ResponseBody - public String getOtherDiagNameByAdmissTimesAndInpatientNo(String name,Short admissTimes, String inpatientNo,String startTime2){ - if(StringUtils.isNoneBlank(name) && admissTimes != null && StringUtils.isNoneBlank(inpatientNo)){ + public String getOtherDiagNameByAdmissTimesAndInpatientNo(String name, Short admissTimes, String inpatientNo, String startTime2) { + if (StringUtils.isNoneBlank(name) && admissTimes != null && StringUtils.isNoneBlank(inpatientNo)) { try { - if(StringUtils.isNotBlank(startTime2)){ - startTime2 = startTime2.substring(0,10); + if (StringUtils.isNotBlank(startTime2)) { + startTime2 = startTime2.substring(0, 10); } //根据病案号,住院次数,姓名查询对应的patientId - List patientIdList = commomMapper.selectPatientIdByAdmissTimesAndInpatientNoAndName(admissTimes,inpatientNo,name,null,null); + List patientIdList = commomMapper.selectPatientIdByAdmissTimesAndInpatientNoAndName(admissTimes, inpatientNo, name, null, null); String patientId = ""; - if(null != patientIdList && !patientIdList.isEmpty()){ - if(patientIdList.size() == 1){ + if (null != patientIdList && !patientIdList.isEmpty()) { + if (patientIdList.size() == 1) { patientId = patientIdList.get(0); - }else{ - return "查询结果不唯一,符合条件共计"+patientIdList.size()+"条"; + } else { + return "查询结果不唯一,符合条件共计" + patientIdList.size() + "条"; } - }else{ + } else { return "查询无该档案"; } - if(StringUtils.isNoneBlank(patientId)){ + if (StringUtils.isNoneBlank(patientId)) { List commomVos = commomMapper.selectOtherDiagByPatientId(patientId); - try{ - if(null != commomVos && !commomVos.isEmpty()){ + try { + if (null != commomVos && !commomVos.isEmpty()) { ObjectMapper mapper = new ObjectMapper(); String json = mapper.writeValueAsString(commomVos.get(0)); return json; - }else{ + } else { return null; } - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return null; } - }else{ + } else { return null; } - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); } } return null; } + //脐血库 /** * @MethodName: getRecordTypeTree * @Description: 根据patientId组织病案分类集合树 - * @Param String patientId:patientId + * @Param String patientId:patientId * @Return * @Author: 曾文和 * @CreateDate: 2019-06-04 @@ -550,37 +576,37 @@ public class CommomSearchController { * @UpdateRemark: 更新说明 * @Version: 1.0 */ - @RequestMapping(value="getRecordTypeTree",produces = {"text/json;charset=UTF-8"}) + @RequestMapping(value = "getRecordTypeTree", produces = {"text/json;charset=UTF-8"}) @ResponseBody - public String getRecordTypeTree(String patientId,Integer typeId,HttpServletRequest request){ + public String getRecordTypeTree(String patientId, Integer typeId, HttpServletRequest request) { List treeList = new ArrayList<>(); //查询该有的权限分类 - try{ + try { Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER"); List commomVos = new ArrayList<>(); //先查归档表 - if(user.getRoleId() == 0 || user.getRoleId() == -100){ - commomVos = commomMapper.selectScanCountByMedicalPatientId(patientId,null,null); - }else{ - commomVos = commomMapper.selectScanCountByMedicalPatientId(patientId,user.getRoleId(),user.getUserId()); + if (user.getRoleId() == 0 || user.getRoleId() == -100) { + commomVos = commomMapper.selectScanCountByMedicalPatientId(patientId, null, null); + } else { + commomVos = commomMapper.selectScanCountByMedicalPatientId(patientId, user.getRoleId(), user.getUserId()); } //归档不表不存在,查病案数据表 //从归档查type为1 int type = 1; - if(null == commomVos || commomVos.isEmpty()){ - if(user.getRoleId() == 0 || user.getRoleId() == -100){ - commomVos = commomMapper.selectScanCountByPatientId(patientId,null,null); - }else{ - commomVos = commomMapper.selectScanCountByPatientId(patientId,user.getRoleId(),user.getUserId()); + if (null == commomVos || commomVos.isEmpty()) { + if (user.getRoleId() == 0 || user.getRoleId() == -100) { + commomVos = commomMapper.selectScanCountByPatientId(patientId, null, null); + } else { + commomVos = commomMapper.selectScanCountByPatientId(patientId, user.getRoleId(), user.getUserId()); } type = 2; } //返回每个分段pdf页数 - if(null != commomVos && !commomVos.isEmpty()){ - Map map = setPdfPageWithAssorts(patientId,type); + if (null != commomVos && !commomVos.isEmpty()) { + Map map = setPdfPageWithAssorts(patientId, type); for (int i = 0; i < commomVos.size(); i++) { - for(Map.Entry entry : map.entrySet()){ - if(StringUtils.isNotBlank(commomVos.get(i).getAssortId()) && commomVos.get(i).getAssortId().equals(entry.getKey())){ + for (Map.Entry entry : map.entrySet()) { + if (StringUtils.isNotBlank(commomVos.get(i).getAssortId()) && commomVos.get(i).getAssortId().equals(entry.getKey())) { commomVos.get(i).setAssortCount(entry.getValue()); continue; } @@ -589,7 +615,7 @@ public class CommomSearchController { } //按打印分类id查询归属分类集合 List typeRelateds = new ArrayList<>(); - if(typeId != null){ + if (typeId != null) { typeRelateds = typeRelatedService.selectAssortIdsByTypeId(typeId); } //第一级:全部影像资料 @@ -598,18 +624,18 @@ public class CommomSearchController { tree1.setId(id); tree1.setAssortName("全部影像资料"); treeList.add(tree1); - if(null != commomVos && !commomVos.isEmpty()){ + if (null != commomVos && !commomVos.isEmpty()) { for (int i = 0; i < commomVos.size(); i++) { id++; CommomTree tree2 = new CommomTree(); tree2.setId(id); tree2.setParentId(1); - tree2.setAssortName(commomVos.get(i).getAssortName()+"("+commomVos.get(i).getAssortCount()+")"); + tree2.setAssortName(commomVos.get(i).getAssortName() + "(" + commomVos.get(i).getAssortCount() + ")"); tree2.setAssortId(commomVos.get(i).getAssortId()); //判断选中 - if(null != typeRelateds && !typeRelateds.isEmpty()){ + if (null != typeRelateds && !typeRelateds.isEmpty()) { for (int j = 0; j < typeRelateds.size(); j++) { - if(StringUtils.isNotBlank(commomVos.get(i).getAssortId()) && commomVos.get(i).getAssortId().equals(typeRelateds.get(j).getAssortId())){ + if (StringUtils.isNotBlank(commomVos.get(i).getAssortId()) && commomVos.get(i).getAssortId().equals(typeRelateds.get(j).getAssortId())) { tree2.setChecked("true"); break; } @@ -621,16 +647,16 @@ public class CommomSearchController { ObjectMapper mapper = new ObjectMapper(); String json = mapper.writeValueAsString(treeList); return json; - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return null; } } - //脐血库 + /** * @MethodName: getRecordTree * @Description: 根据patientId组织病案集合树 - * @Param String patientId:patientId + * @Param String patientId:patientId * @Return * @Author: 曾文和 * @CreateDate: 2019-06-04 @@ -639,37 +665,37 @@ public class CommomSearchController { * @UpdateRemark: 更新说明 * @Version: 1.0 */ - @RequestMapping(value="getRecordTree",produces = {"text/json;charset=UTF-8"}) + @RequestMapping(value = "getRecordTree", produces = {"text/json;charset=UTF-8"}) @ResponseBody - public String getRecordTree(String patientId,Integer typeId,HttpServletRequest request){ + public String getRecordTree(String patientId, Integer typeId, HttpServletRequest request) { long start = System.currentTimeMillis(); List treeList = new ArrayList<>(); //查询该有的权限分类 - try{ + try { Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER"); List commomVos = new ArrayList<>(); //先查归档表 - if(user.getRoleId() == 0 || user.getRoleId() == -100){ - commomVos = commomMapper.selectScanCountByMedicalPatientId(patientId,null,null); - }else{ - commomVos = commomMapper.selectScanCountByMedicalPatientId(patientId,user.getRoleId(),user.getUserId()); + if (user.getRoleId() == 0 || user.getRoleId() == -100) { + commomVos = commomMapper.selectScanCountByMedicalPatientId(patientId, null, null); + } else { + commomVos = commomMapper.selectScanCountByMedicalPatientId(patientId, user.getRoleId(), user.getUserId()); } //归档不表不存在,查病案数据表 //从归档查type为1 int type = 1; - if(null == commomVos || commomVos.isEmpty()){ - if(user.getRoleId() == 0 || user.getRoleId() == -100){ - commomVos = commomMapper.selectScanPathByPatientId(patientId,null,null); - }else{ - commomVos = commomMapper.selectScanPathByPatientId(patientId,user.getRoleId(),user.getUserId()); + if (null == commomVos || commomVos.isEmpty()) { + if (user.getRoleId() == 0 || user.getRoleId() == -100) { + commomVos = commomMapper.selectScanPathByPatientId(patientId, null, null); + } else { + commomVos = commomMapper.selectScanPathByPatientId(patientId, user.getRoleId(), user.getUserId()); } type = 2; } long end = System.currentTimeMillis(); - System.out.println((end-start)/1000+"s"); + System.out.println((end - start) / 1000 + "s"); //按打印分类id查询归属分类集合 List typeRelateds = new ArrayList<>(); - if(typeId != null){ + if (typeId != null) { typeRelateds = typeRelatedService.selectAssortIdsByTypeId(typeId); } @@ -678,14 +704,14 @@ public class CommomSearchController { Integer id = 1; tree1.setId(id); tree1.setAssortName("全部影像资料"); - if(null != commomVos && !commomVos.isEmpty()){ + if (null != commomVos && !commomVos.isEmpty()) { //去重,取出不重复的分类集合 - Map assortMap = new LinkedHashMap<>(); + Map assortMap = new LinkedHashMap<>(); for (int i = 0; i < commomVos.size(); i++) { - assortMap.put(commomVos.get(i).getAssortId(),commomVos.get(i)); + assortMap.put(commomVos.get(i).getAssortId(), commomVos.get(i)); } //判断分类是否全选,全选,父类跟着全选 - if(null != typeRelateds && !typeRelateds.isEmpty()) { + if (null != typeRelateds && !typeRelateds.isEmpty()) { Boolean checkedFlag = true; for (Map.Entry map : assortMap.entrySet()) { //定义是否存在 @@ -707,7 +733,7 @@ public class CommomSearchController { } treeList.add(tree1); int oneId = 0; - for (Map.Entry map : assortMap.entrySet()) { + for (Map.Entry map : assortMap.entrySet()) { id++; oneId = id; String assortId = map.getValue().getAssortId(); @@ -717,9 +743,9 @@ public class CommomSearchController { tree2.setAssortId(map.getValue().getAssortId()); //判断选中 Boolean checkFlag = false; - if(null != typeRelateds && !typeRelateds.isEmpty()){ + if (null != typeRelateds && !typeRelateds.isEmpty()) { for (int j = 0; j < typeRelateds.size(); j++) { - if(StringUtils.isNotBlank(assortId) && assortId.equals(typeRelateds.get(j).getAssortId())){ + if (StringUtils.isNotBlank(assortId) && assortId.equals(typeRelateds.get(j).getAssortId())) { tree2.setChecked("true"); checkFlag = true; break; @@ -730,14 +756,14 @@ public class CommomSearchController { int scanPathCount = 0; //第二层 图片 for (int i = 0; i < commomVos.size(); i++) { - if(StringUtils.isNotBlank(assortId) && StringUtils.isNotBlank(commomVos.get(i).getAssortId()) && - assortId.equals(commomVos.get(i).getAssortId())){ + if (StringUtils.isNotBlank(assortId) && StringUtils.isNotBlank(commomVos.get(i).getAssortId()) && + assortId.equals(commomVos.get(i).getAssortId())) { id++; CommomTree tree3 = new CommomTree(); tree3.setId(id); tree3.setParentId(oneId); tree3.setAssortId(assortId); - if(checkFlag){ + if (checkFlag) { tree3.setChecked("true"); } tree3.setAssortName(commomVos.get(i).getScanPage()); @@ -745,38 +771,39 @@ public class CommomSearchController { scanPathCount++; } } - tree2.setAssortName(map.getValue().getAssortName()+"("+scanPathCount+")"); + tree2.setAssortName(map.getValue().getAssortName() + "(" + scanPathCount + ")"); treeList.add(tree2); } } ObjectMapper mapper = new ObjectMapper(); String json = mapper.writeValueAsString(treeList); return json; - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return null; } } + //脐血库 - @RequestMapping(value="getBloodRecordTree",produces = {"text/json;charset=UTF-8"}) + @RequestMapping(value = "getBloodRecordTree", produces = {"text/json;charset=UTF-8"}) @ResponseBody - public String getBloodRecordTree(String patientId,Integer typeId,HttpServletRequest request){ + public String getBloodRecordTree(String patientId, Integer typeId, HttpServletRequest request) { List treeList = new ArrayList<>(); //查询该有的权限分类 - try{ + try { Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER"); List commomVos = new ArrayList<>(); - if(null == commomVos || commomVos.isEmpty()){ - if(user.getRoleId() == 0 || user.getRoleId() == -100 || user.getRoleId() == -999){ - commomVos = commomMapper.selectScanPathByPatientId(patientId,null,null); - }else{ - commomVos = commomMapper.selectScanPathByPatientId(patientId,user.getRoleId(),user.getUserId()); + if (null == commomVos || commomVos.isEmpty()) { + if (user.getRoleId() == 0 || user.getRoleId() == -100 || user.getRoleId() == -999) { + commomVos = commomMapper.selectScanPathByPatientId(patientId, null, null); + } else { + commomVos = commomMapper.selectScanPathByPatientId(patientId, user.getRoleId(), user.getUserId()); } } //按打印分类id查询归属分类集合 List typeRelateds = new ArrayList<>(); - if(typeId != null){ + if (typeId != null) { typeRelateds = typeRelatedService.selectAssortIdsByTypeId(typeId); } //第一级:全部影像资料 @@ -784,14 +811,14 @@ public class CommomSearchController { Integer id = 1; tree1.setId(id); tree1.setAssortName("全部影像资料"); - if(null != commomVos && !commomVos.isEmpty()){ + if (null != commomVos && !commomVos.isEmpty()) { //去重,取出不重复的分类集合 - Map assortMap = new LinkedHashMap<>(); + Map assortMap = new LinkedHashMap<>(); for (int i = 0; i < commomVos.size(); i++) { - assortMap.put(commomVos.get(i).getAssortId(),commomVos.get(i)); + assortMap.put(commomVos.get(i).getAssortId(), commomVos.get(i)); } //判断分类是否全选,全选,父类跟着全选 - if(null != typeRelateds && !typeRelateds.isEmpty()) { + if (null != typeRelateds && !typeRelateds.isEmpty()) { Boolean checkedFlag = true; for (Map.Entry map : assortMap.entrySet()) { //定义是否存在 @@ -810,12 +837,12 @@ public class CommomSearchController { if (checkedFlag) { tree1.setChecked("true"); } - }else{ + } else { tree1.setChecked("true"); } treeList.add(tree1); int oneId = 0; - for (Map.Entry map : assortMap.entrySet()) { + for (Map.Entry map : assortMap.entrySet()) { id++; oneId = id; String assortId = map.getValue().getAssortId(); @@ -825,15 +852,15 @@ public class CommomSearchController { tree2.setAssortId(map.getValue().getAssortId()); //判断选中 Boolean checkFlag = false; - if(null != typeRelateds && !typeRelateds.isEmpty()){ + if (null != typeRelateds && !typeRelateds.isEmpty()) { for (int j = 0; j < typeRelateds.size(); j++) { - if(StringUtils.isNotBlank(assortId) && assortId.equals(typeRelateds.get(j).getAssortId())){ + if (StringUtils.isNotBlank(assortId) && assortId.equals(typeRelateds.get(j).getAssortId())) { tree2.setChecked("true"); checkFlag = true; break; } } - }else{ + } else { checkFlag = true; tree2.setChecked("true"); } @@ -841,14 +868,14 @@ public class CommomSearchController { int scanPathCount = 0; //第二层 图片 for (int i = 0; i < commomVos.size(); i++) { - if(StringUtils.isNotBlank(assortId) && StringUtils.isNotBlank(commomVos.get(i).getAssortId()) && - assortId.equals(commomVos.get(i).getAssortId())){ + if (StringUtils.isNotBlank(assortId) && StringUtils.isNotBlank(commomVos.get(i).getAssortId()) && + assortId.equals(commomVos.get(i).getAssortId())) { id++; CommomTree tree3 = new CommomTree(); tree3.setId(id); tree3.setParentId(oneId); tree3.setAssortId(assortId); - if(checkFlag){ + if (checkFlag) { tree3.setChecked("true"); } tree3.setAssortName(commomVos.get(i).getScanPage()); @@ -856,37 +883,37 @@ public class CommomSearchController { scanPathCount++; } } - tree2.setAssortName(map.getValue().getAssortName()+"("+scanPathCount+")"); + tree2.setAssortName(map.getValue().getAssortName() + "(" + scanPathCount + ")"); treeList.add(tree2); } } ObjectMapper mapper = new ObjectMapper(); String json = mapper.writeValueAsString(treeList); return json; - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return null; } } - private Map setPdfPageWithAssorts(String patientId,int type)throws Exception{ + private Map setPdfPageWithAssorts(String patientId, int type) throws Exception { //定义分段map - Map map = new HashMap<>(); + Map map = new HashMap<>(); //计算pdf的条数 - if(type == 1){ + if (type == 1) { List archive_details = archiveDetailMapper.selectPdfCountByMasterId(patientId); - if(null != archive_details && !archive_details.isEmpty()){ + if (null != archive_details && !archive_details.isEmpty()) { for (int i = 0; i < archive_details.size(); i++) { String pdfPath = archive_details.get(i).getPdfPath(); int count = 0; - if(StringUtils.isNoneBlank(pdfPath)){ + if (StringUtils.isNoneBlank(pdfPath)) { String[] pdfPaths = pdfPath.split(","); for (String pdfFile : pdfPaths) { - if(StringUtils.isNotBlank(pdfFile)){ + if (StringUtils.isNotBlank(pdfFile)) { File file = new File(pdfFile); - if(file.isFile()){ + if (file.isFile()) { boolean flag = Jpg2PdfUtil.check(pdfFile); - if(flag){ + if (flag) { PdfReader pdfReader = new PdfReader(new FileInputStream(pdfFile)); int pages = pdfReader.getNumberOfPages(); count += pages; @@ -896,11 +923,11 @@ public class CommomSearchController { } } } - map.put(archive_details.get(i).getAssortid(),count); + map.put(archive_details.get(i).getAssortid(), count); } } return map; - }else{ + } else { //计算病案数据的页数 FontCommom commom = new FontCommom(); commom.setPatientId(patientId); @@ -985,7 +1012,7 @@ public class CommomSearchController { } } } - map.put(scanAssortVos.get(j).getAssortId(),pageCount); + map.put(scanAssortVos.get(j).getAssortId(), pageCount); } } } @@ -996,7 +1023,7 @@ public class CommomSearchController { /** * @MethodName: showRecordContent * @Description: 显示病案pdf内容,加载pdf - * @Param String patientId:patientId String assortIds:病案分段id集合 + * @Param String patientId:patientId String assortIds:病案分段id集合 * @Return * @Author: 曾文和 * @CreateDate: 2019-06-06 @@ -1005,80 +1032,80 @@ public class CommomSearchController { * @UpdateRemark: 更新说明 * @Version: 1.0 */ - @RequestMapping(value="showRecordContent/{patientId}/{assortIds}",produces = {"text/json;charset=UTF-8"}) + @RequestMapping(value = "showRecordContent/{patientId}/{assortIds}", produces = {"text/json;charset=UTF-8"}) @ResponseBody - public void showRecordContent(@PathVariable("patientId") String patientId,@PathVariable("assortIds") String assortIds, HttpServletResponse response){ + public void showRecordContent(@PathVariable("patientId") String patientId, @PathVariable("assortIds") String assortIds, HttpServletResponse response) { if (StringUtils.isNoneBlank(patientId)) { String pdfName = "数字病案PDF"; - patientId = "'"+patientId+"'"; + patientId = "'" + patientId + "'"; try { //查询归档的病案是否存在 List pdfPathList = archiveDetailMapper.selectPdfPathByPatient(patientId, assortIds); - if(null != pdfPathList && !pdfPathList.isEmpty()){ + if (null != pdfPathList && !pdfPathList.isEmpty()) { List fileList = new ArrayList<>(); for (int i = 0; i < pdfPathList.size(); i++) { String pdfPath = pdfPathList.get(i).getPdfPath(); - if(StringUtils.isNotBlank(pdfPath)){ + if (StringUtils.isNotBlank(pdfPath)) { fileList.add(pdfPath); } } - Jpg2PdfUtil.mulFile2One(response,fileList,pdfWater); - }else{ + Jpg2PdfUtil.mulFile2One(response, fileList, pdfWater); + } else { //否则话读取图片集合 //根据patient和分类集合查询图片地址对象集合 - List scanPathVos = scanPathMapper.selectScanFileByPatientIds(patientId,assortIds); + List scanPathVos = scanPathMapper.selectScanFileByPatientIds(patientId, assortIds); //组织图片地址集合 List filePaths = new ArrayList<>(); - if(null != scanPathVos && !scanPathVos.isEmpty()){ + if (null != scanPathVos && !scanPathVos.isEmpty()) { for (int i = 0; i < scanPathVos.size(); i++) { String fileRealPath = scanPathVos.get(i).getFileRealPath(); - if(StringUtils.isNoneBlank(fileRealPath)){ + if (StringUtils.isNoneBlank(fileRealPath)) { File file = new File(fileRealPath); - if(file.isFile()){ + if (file.isFile()) { filePaths.add(fileRealPath); } } } - if(null != filePaths && !filePaths.isEmpty()){ + if (null != filePaths && !filePaths.isEmpty()) { //根据图片路径转换pdf EmrPdfWaterSet emrPdfWaterSet = pdfWaterSetMapper.selectByPrimaryKey(1); - img2PdfUtil.imageToPdf(response,filePaths,pdfName,emrPdfWaterSet); + img2PdfUtil.imageToPdf(response, filePaths, pdfName, emrPdfWaterSet); } } } - }catch (Exception e){ + } catch (Exception e) { //e.printStackTrace(); } } } //脐血库 - @RequestMapping(value="showRecordContentBlood/{flag}/{patientId}/{assortIds}") + @RequestMapping(value = "showRecordContentBlood/{flag}/{patientId}/{assortIds}") @ResponseBody public void showRecordContentBlood(@PathVariable("patientId") String patientId, @PathVariable("assortIds") String assortIds, - @PathVariable("flag") String flag,HttpServletResponse response){ + @PathVariable("flag") String flag, HttpServletResponse response) { String pdfName = "档案管理PDF"; try { - if(StringUtils.isNotBlank(patientId)){ + if (StringUtils.isNotBlank(patientId)) { patientId = patientId.replace("\'", ""); CommomVo commomVo = new CommomVo(); - if(StringUtils.isNotBlank(flag) && "file_path".equals(flag)){ + if (StringUtils.isNotBlank(flag) && "file_path".equals(flag)) { commomVo = commomMapper.selectByPrimaryKeyPath(patientId); - }else{ + } else { commomVo = commomMapper.selectByPrimaryKey(patientId); } String[] scanPaths = assortIds.split(","); //组织图片地址集合 List filePaths = new ArrayList<>(); - if(null != scanPaths) { + if (null != scanPaths) { flag = FieldPropertyConvert.fieldToProperty(flag); Field declaredField = commomVo.getClass().getDeclaredField(flag); declaredField.setAccessible(true); - String src = (String)declaredField.get(commomVo); + String src = (String) declaredField.get(commomVo); for (int i = 0; i < scanPaths.length; i++) { - if(StringUtils.isNotBlank(scanPaths[i])){ + if (StringUtils.isNotBlank(scanPaths[i])) { String fileRealPath = src + "/" + scanPaths[i]; File file = new File(fileRealPath); if (file.isFile()) { @@ -1089,20 +1116,21 @@ public class CommomSearchController { if (null != filePaths && !filePaths.isEmpty()) { //根据图片路径转换pdf EmrPdfWaterSet emrPdfWaterSet = pdfWaterSetMapper.selectByPrimaryKey(1); - img2PdfUtil.imageToPdf(response, filePaths, pdfName,emrPdfWaterSet); + img2PdfUtil.imageToPdf(response, filePaths, pdfName, emrPdfWaterSet); } } } - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); } } + //脐血库 /** * @MethodName: updateScanAssort * @Description: 重新分页 - * @Param String patientId,String assortIds:病案分段id集合,Integer index:pdf当前页数 + * @Param String patientId,String assortIds:病案分段id集合,Integer index:pdf当前页数 * @Return * @Author: 曾文和 * @CreateDate: 2019-06-06 @@ -1112,38 +1140,38 @@ public class CommomSearchController { * @Version: 1.0 */ @RequiresPermissions("/commom/updateScanAssort") - @OptionalLog(module = "修改",methods = "病案预览页面病案图片重新分类") - @RequestMapping(value="updateScanAssort") + @OptionalLog(module = "修改", methods = "病案预览页面病案图片重新分类") + @RequestMapping(value = "updateScanAssort") @ResponseBody - public ResultUtil updateScanAssort(String patientId,String assortIds,Integer index,String newAssortId){ + public ResultUtil updateScanAssort(String patientId, String assortIds, Integer index, String newAssortId) { if (StringUtils.isNoneBlank(patientId) && StringUtils.isNoneBlank(assortIds) && null != index && StringUtils.isNoneBlank(newAssortId)) { try { //根据index:当前pdf页数,patientId,admissIds获取pdf信息 - List scanPathVos = getPdfPathVo(index,patientId,assortIds); + List scanPathVos = getPdfPathVo(index, patientId, assortIds); List list = new ArrayList<>(); - if(null != scanPathVos && !scanPathVos.isEmpty()){ + if (null != scanPathVos && !scanPathVos.isEmpty()) { for (ScanPathVo scanPathVo : scanPathVos) { list.add(scanPathVo.getScanPage()); } //批量更新 - scanAssortService.SimpleUpdate(patientId,newAssortId,list); + scanAssortService.SimpleUpdate(patientId, newAssortId, list); return ResultUtil.ok(); - }else{ + } else { return ResultUtil.error("无图片"); } - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return null; } } return null; } - //脐血库 + /** * @MethodName: updateScanAssortByBlood * @Description: 重新分页 - * @Param String patientId,String assortIds:病案图片集合,newAssortId新的分类id + * @Param String patientId,String assortIds:病案图片集合,newAssortId新的分类id * @Return * @Author: 曾文和 * @CreateDate: 2020-03-09 @@ -1153,10 +1181,10 @@ public class CommomSearchController { * @Version: 1.0 */ @RequiresPermissions("/commom/updateScanAssort") - @OptionalLog(module = "修改",methods = "病案预览页面病案图片重新分类") - @RequestMapping(value="updateScanAssortByBlood",method = RequestMethod.POST) + @OptionalLog(module = "修改", methods = "病案预览页面病案图片重新分类") + @RequestMapping(value = "updateScanAssortByBlood", method = RequestMethod.POST) @ResponseBody - public ResultUtil updateScanAssortByBlood(String patientId,String assortIds,String newAssortId){ + public ResultUtil updateScanAssortByBlood(String patientId, String assortIds, String newAssortId) { if (StringUtils.isNoneBlank(patientId) && StringUtils.isNoneBlank(assortIds) && StringUtils.isNoneBlank(newAssortId)) { try { //根据patientId,admissIds(scanPage分类图片集合)批量更新分段id assrotdId @@ -1166,21 +1194,23 @@ public class CommomSearchController { for (String str : split) { assortIds += "'" + str + "',"; } - assortIds = assortIds.substring(0,assortIds.length()-1); - scanAssortService.SimpleUpdateByPatientIdAndScanPages(patientId,newAssortId,assortIds); + assortIds = assortIds.substring(0, assortIds.length() - 1); + scanAssortService.SimpleUpdateByPatientIdAndScanPages(patientId, newAssortId, assortIds); return ResultUtil.ok(); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return null; } } return null; } - //脐血库 + + /*****************************************编码操作**************************************************/ + /** * @MethodName: delScanAssortByBlood * @Description: 删除图片 - * @Param String patientId,String assortIds:病案图片集合 + * @Param String patientId,String assortIds:病案图片集合 * @Return * @Author: 曾文和 * @CreateDate: 2020-03-09 @@ -1190,10 +1220,10 @@ public class CommomSearchController { * @Version: 1.0 */ @RequiresPermissions("/commom/delScanAssort") - @OptionalLog(module = "删除",methods = "病案预览页面删除病案图片") - @RequestMapping(value="delScanAssortByBlood",method = RequestMethod.POST) + @OptionalLog(module = "删除", methods = "病案预览页面删除病案图片") + @RequestMapping(value = "delScanAssortByBlood", method = RequestMethod.POST) @ResponseBody - public ResultUtil delScanAssortByBlood(String patientId,String assortIds){ + public ResultUtil delScanAssortByBlood(String patientId, String assortIds) { if (StringUtils.isNoneBlank(patientId) && StringUtils.isNoneBlank(assortIds)) { try { //根据patientId,admissIds(scanPage分类图片集合)批量更新分段id assrotdId @@ -1214,10 +1244,10 @@ public class CommomSearchController { } }*/ } - assortIds = assortIds.substring(0,assortIds.length()-1); - scanAssortService.SimpleDelByPatientIdAndScanPages(patientId,assortIds); + assortIds = assortIds.substring(0, assortIds.length() - 1); + scanAssortService.SimpleDelByPatientIdAndScanPages(patientId, assortIds); return ResultUtil.ok(); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return null; } @@ -1225,7 +1255,6 @@ public class CommomSearchController { return null; } - /*****************************************编码操作**************************************************/ /** * @MethodName: codeTable * @Description: 跳转到编码录入页面 @@ -1239,28 +1268,28 @@ public class CommomSearchController { * @Version: 1.0 */ @RequestMapping("codeTable") - public String codeTable(String patientId,Model model){ - model.addAttribute("patientId",patientId); + public String codeTable(String patientId, Model model) { + model.addAttribute("patientId", patientId); try { //加载诊断编码和名称 List diags = diagService.selectAllByPatientId(patientId, null); - model.addAttribute("diags",diags); + model.addAttribute("diags", diags); //加载手术编码和手术名称 List operates = operateService.selectAllByPatientId(patientId, null); - model.addAttribute("operates",operates); + model.addAttribute("operates", operates); //麻醉方式 List anaesthesias = dictionaryMapper.selectDictionaryByTypeCode("anaesthesia"); - model.addAttribute("anaesthesias",anaesthesias); + model.addAttribute("anaesthesias", anaesthesias); //切口愈合等级 List cutHealGrades = dictionaryMapper.selectDictionaryByTypeCode("cut_heal_grade"); - model.addAttribute("cutHealGrades",cutHealGrades); + model.addAttribute("cutHealGrades", cutHealGrades); //是否择期手术 List whether = dictionaryMapper.selectDictionaryByTypeCode("whether"); - model.addAttribute("whether",whether); + model.addAttribute("whether", whether); //手术类型 List operateClasses = dictionaryMapper.selectDictionaryByTypeCode("operate_class"); - model.addAttribute("operateClasses",operateClasses); - }catch (Exception e){ + model.addAttribute("operateClasses", operateClasses); + } catch (Exception e) { e.printStackTrace(); } return "recordManage/commomSearch/codeTable"; @@ -1278,33 +1307,35 @@ public class CommomSearchController { * @UpdateRemark: 更新说明 * @Version: 1.0 */ - @RequestMapping(value = "getDiagCodeContents",produces = {"text/json;charset=UTF-8"}) + @RequestMapping(value = "getDiagCodeContents", produces = {"text/json;charset=UTF-8"}) @ResponseBody - public String getDiagCodeContents(String code,String name){ - try{ + public String getDiagCodeContents(String code, String name) { + try { List icdCodes = new ArrayList<>(); - if(StringUtils.isNotBlank(code)){ + if (StringUtils.isNotBlank(code)) { icdCodes = icdCodeMapper.selectAll(code, null); - }else{ + } else { icdCodes = icdCodeMapper.selectAll(null, name); } - Map map = new HashMap<>(); - if(null != icdCodes && !icdCodes.isEmpty()){ + Map map = new HashMap<>(); + if (null != icdCodes && !icdCodes.isEmpty()) { for (int i = 0; i < icdCodes.size(); i++) { - if(StringUtils.isNoneBlank(icdCodes.get(i).getCode())){ - map.put(icdCodes.get(i).getCode(),icdCodes.get(i).getName()); + if (StringUtils.isNoneBlank(icdCodes.get(i).getCode())) { + map.put(icdCodes.get(i).getCode(), icdCodes.get(i).getName()); } } } ObjectMapper mapper = new ObjectMapper(); String json = mapper.writeValueAsString(map); return json; - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return null; } } + /* */ + /** * @MethodName: getOperateCodeContents * @Description: 根据手术编码查询手术对象集合 @@ -1317,34 +1348,34 @@ public class CommomSearchController { * @UpdateRemark: 更新说明 * @Version: 1.0 */ - @RequestMapping(value = "getOperateCodeContents",produces = {"text/json;charset=UTF-8"}) + @RequestMapping(value = "getOperateCodeContents", produces = {"text/json;charset=UTF-8"}) @ResponseBody - public String getOperateCodeContents(String code,String name){ - try{ + public String getOperateCodeContents(String code, String name) { + try { List zdCm3s = new ArrayList<>(); - if(StringUtils.isNotBlank(code)){ + if (StringUtils.isNotBlank(code)) { zdCm3s = cm3Mapper.selectAll(code, null); - }else{ + } else { zdCm3s = cm3Mapper.selectAll(null, name); } - Map map = new HashMap<>(); - if(null != zdCm3s && !zdCm3s.isEmpty()){ + Map map = new HashMap<>(); + if (null != zdCm3s && !zdCm3s.isEmpty()) { for (int i = 0; i < zdCm3s.size(); i++) { - if(StringUtils.isNoneBlank(zdCm3s.get(i).getCode())){ - map.put(zdCm3s.get(i).getCode(),zdCm3s.get(i).getName()); + if (StringUtils.isNoneBlank(zdCm3s.get(i).getCode())) { + map.put(zdCm3s.get(i).getCode(), zdCm3s.get(i).getName()); } } } ObjectMapper mapper = new ObjectMapper(); String json = mapper.writeValueAsString(map); return json; - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return null; } } - /* *//** + /** * @MethodName: loadSelect * @Description: 加载编码字典 * @Param @@ -1358,16 +1389,17 @@ public class CommomSearchController { */ @RequestMapping("loadCM3") @ResponseBody - public String loadCM3(){ + public String loadCM3() { try { //加载手术cmd3 - List cm3s = cm3Mapper.selectAll(null,null); + List cm3s = cm3Mapper.selectAll(null, null); return JSON.toJSONString(cm3s); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return null; } } + /** * @MethodName: getCodeTypeTree * @Description: 根据patientId加载类别树 @@ -1380,21 +1412,21 @@ public class CommomSearchController { * @UpdateRemark: 更新说明 * @Version: 1.0 */ - @RequestMapping(value="getCodeTypeTree",produces = {"text/json;charset=UTF-8"}) + @RequestMapping(value = "getCodeTypeTree", produces = {"text/json;charset=UTF-8"}) @ResponseBody - public String getCodeTypeTree(String patientId){ - if (StringUtils.isNoneBlank(patientId)){ - try{ + public String getCodeTypeTree(String patientId) { + if (StringUtils.isNoneBlank(patientId)) { + try { List types = codeTypeService.selectAllByPatientId(patientId); List treeList = new ArrayList<>(); - if(null != types && !types.isEmpty()){ + if (null != types && !types.isEmpty()) { Integer id = 0; Integer parentId = 0; //第一级,类别层级 for (int i = 0; i < types.size(); i++) { id++; CodeTree tree = new CodeTree(); - BeanUtils.copyProperties(types.get(i),tree); + BeanUtils.copyProperties(types.get(i), tree); tree.setId(id); tree.setParentId(0); tree.setSelfId(types.get(i).getId()); @@ -1405,40 +1437,40 @@ public class CommomSearchController { //第二级,手术类或西医编码类或中医编码类 String typeFlag = types.get(i).getTypeFlag(); //1.手术 - if(StringUtils.isNoneBlank(typeFlag) && "operate".equals(typeFlag)){ - List operates = operateService.selectAllByPatientId(patientId,null); - if(null != operates && !operates.isEmpty()){ + if (StringUtils.isNoneBlank(typeFlag) && "operate".equals(typeFlag)) { + List operates = operateService.selectAllByPatientId(patientId, null); + if (null != operates && !operates.isEmpty()) { for (int j = 0; j < operates.size(); j++) { id++; CodeTree tree1 = new CodeTree(); - BeanUtils.copyProperties(operates.get(j),tree1); + BeanUtils.copyProperties(operates.get(j), tree1); tree1.setId(id); tree1.setParentId(parentId); - tree1.setName(operates.get(j).getOperateNo()+"."+operates.get(j).getOperateName()); + tree1.setName(operates.get(j).getOperateNo() + "." + operates.get(j).getOperateName()); //转换时间格式 SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd"); - if(null != tree1.getOperateDate()){ + if (null != tree1.getOperateDate()) { tree1.setOperateDateStr(fmt.format(tree1.getOperateDate())); } - if(null != tree1.getOperDate()){ + if (null != tree1.getOperDate()) { tree1.setOperDateStr(fmt.format(tree1.getOperDate())); } treeList.add(tree1); } } //西医诊断 - }else if(StringUtils.isNoneBlank(typeFlag) && "diag".equals(typeFlag)){ + } else if (StringUtils.isNoneBlank(typeFlag) && "diag".equals(typeFlag)) { List diags = diagService.selectAllByPatientId(patientId, null); - if(null != diags && !diags.isEmpty()){ + if (null != diags && !diags.isEmpty()) { for (int j = 0; j < diags.size(); j++) { id++; CodeTree tree2 = new CodeTree(); - BeanUtils.copyProperties(diags.get(j),tree2); + BeanUtils.copyProperties(diags.get(j), tree2); tree2.setId(id); tree2.setParentId(parentId); - tree2.setName(diags.get(j).getDiagNo()+"."+diags.get(j).getDiagName()); + tree2.setName(diags.get(j).getDiagNo() + "." + diags.get(j).getDiagName()); //转换时间格式 - if(null != tree2.getOperDate()){ + if (null != tree2.getOperDate()) { SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); tree2.setOperDateStr(fmt.format(tree2.getOperDate())); treeList.add(tree2); @@ -1446,16 +1478,16 @@ public class CommomSearchController { } } //中医诊断 - }else if(StringUtils.isNoneBlank(typeFlag) && "herbDiag".equals(typeFlag)){ + } else if (StringUtils.isNoneBlank(typeFlag) && "herbDiag".equals(typeFlag)) { List herbDiags = herbDiagService.selectAllByPatientId(patientId, null); - if(null != herbDiags && !herbDiags.isEmpty()){ + if (null != herbDiags && !herbDiags.isEmpty()) { for (int j = 0; j < herbDiags.size(); j++) { id++; CodeTree tree3 = new CodeTree(); - BeanUtils.copyProperties(herbDiags.get(j),tree3); + BeanUtils.copyProperties(herbDiags.get(j), tree3); tree3.setId(id); tree3.setParentId(parentId); - tree3.setName(herbDiags.get(j).getHerbNo()+"."+herbDiags.get(j).getHerbName()); + tree3.setName(herbDiags.get(j).getHerbNo() + "." + herbDiags.get(j).getHerbName()); //转换时间格式 SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd"); tree3.setOperDateStr(fmt.format(tree3.getOperDate())); @@ -1468,19 +1500,19 @@ public class CommomSearchController { ObjectMapper mapper = new ObjectMapper(); String json = mapper.writeValueAsString(treeList); return json; - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return null; } - }else{ - return null; + } else { + return null; } } /** * @MethodName: addCodeType * @Description: 保存编码类别信息 - * @Param Emr_Code_Type codeType编码类别对象,Integer index:pdf当前页码,String patientId,String assortIds:分段id + * @Param Emr_Code_Type codeType编码类别对象,Integer index:pdf当前页码,String patientId,String assortIds:分段id * @Return * @Author: 曾文和 * @CreateDate: 2019-06-10 @@ -1489,59 +1521,59 @@ public class CommomSearchController { * @UpdateRemark: 更新说明 * @Version: 1.0 */ - @RequiresPermissions(value={"/commom/addCodeType","/commom/updateCodeType"}) - @OptionalLog(module = "新增",methods = "编码类别",fieldName = "typeName") + @RequiresPermissions(value = {"/commom/addCodeType", "/commom/updateCodeType"}) + @OptionalLog(module = "新增", methods = "编码类别", fieldName = "typeName") @RequestMapping("addCodeType") @ResponseBody public ResultUtil addCodeType(Emr_Code_Type codeType, Integer index, String patientId, String assortIds, - HttpServletRequest request){ - if(StringUtils.isBlank(assortIds)){ + HttpServletRequest request) { + if (StringUtils.isBlank(assortIds)) { return ResultUtil.error("没有分段数据,请先在用户分配调阅里添加并分配分段数据!"); } - if (StringUtils.isNoneBlank(patientId) && null != index){ - try{ + if (StringUtils.isNoneBlank(patientId) && null != index) { + try { //验证标志和名称都不能重复 Emr_Code_Type isExistFlag = codeTypeMapper.checkFlagAndNameIsExist(codeType.getTypeFlag(), null); Emr_Code_Type isExistName = codeTypeMapper.checkFlagAndNameIsExist(null, codeType.getTypeName()); - if(codeType.getId() == null) { - if(isExistFlag == null){ - if(isExistName == null){ + if (codeType.getId() == null) { + if (isExistFlag == null) { + if (isExistName == null) { //新增 codeType.setPatientId(patientId); //根据index:当前pdf页数,patientId,admissIds获取pdf信息 - List scanPathVo = getPdfPathVo(index,patientId,assortIds); - if(null != scanPathVo && !scanPathVo.isEmpty()){ + List scanPathVo = getPdfPathVo(index, patientId, assortIds); + if (null != scanPathVo && !scanPathVo.isEmpty()) { codeType.setAssortId(scanPathVo.get(0).getAssortId()); codeType.setScanPage(scanPathVo.get(0).getScanPage()); - }else{ + } else { return ResultUtil.error("图片不存在!"); } - codeTypeService.addCodeType(codeType,request); + codeTypeService.addCodeType(codeType, request); return ResultUtil.ok(); - }else{ + } else { return ResultUtil.error("类别名称不能重复!"); } - }else{ + } else { return ResultUtil.error("类别标志不能重复!"); } - }else{ - if(null != isExistName && isExistName.getId() != codeType.getId()){ + } else { + if (null != isExistName && isExistName.getId() != codeType.getId()) { return ResultUtil.error("类别名称不能重复!"); - }else{ - if(null != isExistFlag && isExistFlag.getId() != codeType.getId()){ + } else { + if (null != isExistFlag && isExistFlag.getId() != codeType.getId()) { return ResultUtil.error("类别标志不能重复!"); - }else{ + } else { //修改 - codeTypeService.updateCodeType(codeType,request); + codeTypeService.updateCodeType(codeType, request); return ResultUtil.ok(); } } } - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return ResultUtil.error(); } - }else{ + } else { return null; } } @@ -1559,19 +1591,19 @@ public class CommomSearchController { * @Version: 1.0 */ @RequiresPermissions("/commom/delCodeTypeById") - @OptionalLog(module = "删除",methods = "编码类别",fieldName = "typeName",tableName = "emr_code_type") + @OptionalLog(module = "删除", methods = "编码类别", fieldName = "typeName", tableName = "emr_code_type") @RequestMapping(value = "delCodeTypeById/{id}") @ResponseBody - public ResultUtil delCodeTypeById(@PathVariable("id")Integer id){ - try{ + public ResultUtil delCodeTypeById(@PathVariable("id") Integer id) { + try { codeTypeService.deleteByPrimaryKey(id); return ResultUtil.ok(); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return ResultUtil.error(); } } - + /********************************************手术编码*******************************************************/ /** * @MethodName: addDiagCode @@ -1588,16 +1620,16 @@ public class CommomSearchController { @RequiresPermissions("/commom/addOperCode") @RequestMapping(value = "addDiagCode") @ResponseBody - public ResultUtil addDiagCode(String patientId,String diagNos,String diagNames,String diagCodes,String inhospstats){ - try{ + public ResultUtil addDiagCode(String patientId, String diagNos, String diagNames, String diagCodes, String inhospstats) { + try { diagService.addDiagCode(patientId, diagNos, diagNames, diagCodes, inhospstats); return ResultUtil.ok(); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return ResultUtil.error(); } } - /********************************************手术编码*******************************************************/ + /** * @MethodName: checkOperateNo * @Description: 验证手术序号是否存在 @@ -1612,18 +1644,18 @@ public class CommomSearchController { */ @RequestMapping(value = "checkOperateNo") @ResponseBody - public ResultUtil checkOperateNo(String patientId,Short operateNo){ - if(StringUtils.isNoneBlank(patientId) && operateNo != null){ + public ResultUtil checkOperateNo(String patientId, Short operateNo) { + if (StringUtils.isNoneBlank(patientId) && operateNo != null) { try { //根据patientId和手术编码查询手术编码集合 - List operates = operateService.selectAllByPatientId(patientId,operateNo); - if(operates != null && !operates.isEmpty()){ + List operates = operateService.selectAllByPatientId(patientId, operateNo); + if (operates != null && !operates.isEmpty()) { //存在 return ResultUtil.error(); - }else{ + } else { return ResultUtil.ok(); } - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); } } @@ -1642,16 +1674,16 @@ public class CommomSearchController { * @UpdateRemark: 更新说明 * @Version: 1.0 */ - @RequestMapping(value = "getOperByCodeOrName",produces = {"text/json;charset=UTF-8"}) + @RequestMapping(value = "getOperByCodeOrName", produces = {"text/json;charset=UTF-8"}) @ResponseBody - public String getOperByCodeOrName(String code,String name){ + public String getOperByCodeOrName(String code, String name) { //根据手术编码和名称查询手术编码对象 - try{ + try { List cm3s = cm3Mapper.selectAll(code, name); ObjectMapper mapper = new ObjectMapper(); String json = mapper.writeValueAsString(cm3s); return json; - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return null; } @@ -1669,44 +1701,44 @@ public class CommomSearchController { * @UpdateRemark: 更新说明 * @Version: 1.0 */ - @RequiresPermissions(value={"/commom/addOperCode","/commom/updateOperCode"}) - @OptionalLog(module = "新增",methods = "手术编码",fieldName = "operateName") + @RequiresPermissions(value = {"/commom/addOperCode", "/commom/updateOperCode"}) + @OptionalLog(module = "新增", methods = "手术编码", fieldName = "operateName") @RequestMapping(value = "saveOperCode") @ResponseBody - public ResultUtil saveOperCode(T_Operate operate,Integer isUpdateOperNo,HttpServletRequest request){ - try{ - if(operate.getCurrentOperateNo() == null){ + public ResultUtil saveOperCode(T_Operate operate, Integer isUpdateOperNo, HttpServletRequest request) { + try { + if (operate.getCurrentOperateNo() == null) { //新增 boolean flag = FormTokenFlagUtil.isFlag(request); - if(!flag){ + if (!flag) { return ResultUtil.error("请不要重复提交!"); } operateService.insert(operate); - }else{ + } else { //修改 - if(isUpdateOperNo == 1){ + if (isUpdateOperNo == 1) { //有修改手术序号 //查询手术序号是否存在 - List operates = operateService.selectAllByPatientId(operate.getPatientId(),operate.getOperateNo()); - if(null != operates && !operates.isEmpty()){ + List operates = operateService.selectAllByPatientId(operate.getPatientId(), operate.getOperateNo()); + if (null != operates && !operates.isEmpty()) { //存在 return ResultUtil.error("该手术序号已存在!"); - }else{ + } else { operateService.updateByPrimaryKeySelective(operate); } - }else{ + } else { //手术序号一样 operateService.updateByPrimaryKeySelective(operate); } } return ResultUtil.ok(); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return ResultUtil.error(); } } - /** + /** * @MethodName: deleteOperCodeByPatientIdAndOperNo * @Description: 根据petientId和手术序号删除手术编码对象 * @Param @@ -1719,24 +1751,24 @@ public class CommomSearchController { * @Version: 1.0 */ @RequiresPermissions("/commom/deleteOperCode") - @OptionalLog(module = "删除",methods = "手术编码",fieldName = "operateName",tableName = "t_operate") + @OptionalLog(module = "删除", methods = "手术编码", fieldName = "operateName", tableName = "t_operate") @RequestMapping(value = "deleteOperCodeByPatientIdAndOperNo") @ResponseBody - public ResultUtil deleteOperCodeByPatientIdAndOperNo(String patientId,Short operateNo){ - if(StringUtils.isNoneBlank(patientId) && null != operateNo){ - try{ + public ResultUtil deleteOperCodeByPatientIdAndOperNo(String patientId, Short operateNo) { + if (StringUtils.isNoneBlank(patientId) && null != operateNo) { + try { operateService.deleteOperCodeByPatientIdAndOperNo(patientId, operateNo); return ResultUtil.ok(); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return ResultUtil.error(); } - }else{ + } else { return ResultUtil.error(); } - } + }/**************************************************西医诊断操作*************************************************/ - /** +/** * @MethodName: addOperCode * @Description: 保存手术编码 * @Param @@ -1751,15 +1783,16 @@ public class CommomSearchController { @RequiresPermissions("/commom/addOperCode") @RequestMapping(value = "addOperCode") @ResponseBody - public ResultUtil addOperCode(String patientId,String operNos,String operDates,String operCodes,String operNames,String operateClasses,String operators,String assistant1s,String assistant2s,String cuts,String chossurgs,String anaesthesiaTypes,String anaesthesiaNames){ - try{ + public ResultUtil addOperCode(String patientId, String operNos, String operDates, String operCodes, String operNames, String operateClasses, String operators, String assistant1s, String assistant2s, String cuts, String chossurgs, String anaesthesiaTypes, String anaesthesiaNames) { + try { operateService.addOperCode(patientId, operNos, operDates, operCodes, operNames, operateClasses, operators, assistant1s, assistant2s, cuts, chossurgs, anaesthesiaTypes, anaesthesiaNames); return ResultUtil.ok(); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return ResultUtil.error(); } - }/**************************************************西医诊断操作*************************************************/ + } + /** * @MethodName: getDictionaryByTypeCode * @Description: 根据字典标识查询字典集合 @@ -1772,19 +1805,20 @@ public class CommomSearchController { * @UpdateRemark: 更新说明 * @Version: 1.0 */ - @RequestMapping(value = "getDictionaryByTypeCode",produces = {"text/json;charset=UTF-8"}) + @RequestMapping(value = "getDictionaryByTypeCode", produces = {"text/json;charset=UTF-8"}) @ResponseBody - public String getDictionaryByTypeCode(String typeCode){ - try{ + public String getDictionaryByTypeCode(String typeCode) { + try { List dictionaries = dictionaryMapper.selectDictionaryByTypeCode(typeCode); ObjectMapper mapper = new ObjectMapper(); String json = mapper.writeValueAsString(dictionaries); return json; - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return null; } } + /** * @MethodName: getIcdCodeList * @Description: 加载icd编码字典表 @@ -1797,15 +1831,15 @@ public class CommomSearchController { * @UpdateRemark: 更新说明 * @Version: 1.0 */ - @RequestMapping(value = "getIcdCodeList",produces = {"text/json;charset=UTF-8"}) + @RequestMapping(value = "getIcdCodeList", produces = {"text/json;charset=UTF-8"}) @ResponseBody - public String getIcdCodeList(){ - try{ + public String getIcdCodeList() { + try { List icdCodes = icdCodeMapper.selectAll(null, null); ObjectMapper mapper = new ObjectMapper(); String json = mapper.writeValueAsString(icdCodes); return json; - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return null; } @@ -1823,15 +1857,15 @@ public class CommomSearchController { * @UpdateRemark: 更新说明 * @Version: 1.0 */ - @RequestMapping(value = "getIcdCodeByCodeOrName",produces = {"text/json;charset=UTF-8"}) + @RequestMapping(value = "getIcdCodeByCodeOrName", produces = {"text/json;charset=UTF-8"}) @ResponseBody - public String getIcdCodeByCodeOrName(String code,String name){ - try{ + public String getIcdCodeByCodeOrName(String code, String name) { + try { List icdCodes = icdCodeMapper.selectAll(code, name); ObjectMapper mapper = new ObjectMapper(); String json = mapper.writeValueAsString(icdCodes); return json; - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return null; } @@ -1851,17 +1885,17 @@ public class CommomSearchController { */ @RequestMapping(value = "checkDiagNo") @ResponseBody - public ResultUtil checkDiagNo(String patientId,Short diagNo){ - if(StringUtils.isNoneBlank(patientId) && diagNo != null){ + public ResultUtil checkDiagNo(String patientId, Short diagNo) { + if (StringUtils.isNoneBlank(patientId) && diagNo != null) { try { List diags = diagService.selectAllByPatientId(patientId, diagNo); - if(diags != null && !diags.isEmpty()){ + if (diags != null && !diags.isEmpty()) { //存在 return ResultUtil.error(); - }else{ + } else { return ResultUtil.ok(); } - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); } } @@ -1880,42 +1914,43 @@ public class CommomSearchController { * @UpdateRemark: 更新说明 * @Version: 1.0 */ - @RequiresPermissions(value={"/commom/addOperCode","/commom/updateOperCode"}) - @OptionalLog(module = "保存",methods = "西医诊断编码",fieldName = "diagName") + @RequiresPermissions(value = {"/commom/addOperCode", "/commom/updateOperCode"}) + @OptionalLog(module = "保存", methods = "西医诊断编码", fieldName = "diagName") @RequestMapping(value = "saveDiag") @ResponseBody - public ResultUtil saveDiag(T_Diag diag,Integer isUpdateOperNo,HttpServletRequest request){ - try{ - if(diag.getCurrentDiagNo() == null){ + public ResultUtil saveDiag(T_Diag diag, Integer isUpdateOperNo, HttpServletRequest request) { + try { + if (diag.getCurrentDiagNo() == null) { //新增 boolean flag = FormTokenFlagUtil.isFlag(request); - if(!flag){ + if (!flag) { return ResultUtil.error("请不要重复提交!"); } diagService.insert(diag); - }else{ + } else { //修改 - if(isUpdateOperNo == 1){ + if (isUpdateOperNo == 1) { //有修改序号 //查询序号是否存在 List diags = diagService.selectAllByPatientId(diag.getPatientId(), diag.getDiagNo()); - if(null != diags && !diags.isEmpty()){ + if (null != diags && !diags.isEmpty()) { //存在 return ResultUtil.error("该诊断序号已存在!"); - }else{ + } else { diagService.updateByPrimaryKeySelective(diag); } - }else{ + } else { //诊断序号一样 diagService.updateByPrimaryKeySelective(diag); } } return ResultUtil.ok(); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return ResultUtil.error(); } } + /*****************************************中医诊断********************************************************/ /** * @MethodName: deleteCodeByPatientIdAndDiagNo @@ -1930,23 +1965,23 @@ public class CommomSearchController { * @Version: 1.0 */ @RequiresPermissions("/commom/deleteOperCode") - @OptionalLog(module = "删除",methods = "西医诊断编码",fieldName = "diagName",tableName = "t_diag") + @OptionalLog(module = "删除", methods = "西医诊断编码", fieldName = "diagName", tableName = "t_diag") @RequestMapping(value = "deleteCodeByPatientIdAndDiagNo") @ResponseBody - public ResultUtil deleteCodeByPatientIdAndDiagNo(String patientId,Short diagNo){ - if(StringUtils.isNoneBlank(patientId) && null != diagNo){ - try{ + public ResultUtil deleteCodeByPatientIdAndDiagNo(String patientId, Short diagNo) { + if (StringUtils.isNoneBlank(patientId) && null != diagNo) { + try { diagService.deleteDiagByPatientIdAndDiagNo(patientId, diagNo); return ResultUtil.ok(); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return ResultUtil.error(); } - }else{ + } else { return ResultUtil.error(); } } - /*****************************************中医诊断********************************************************/ + /** * @MethodName: checkHerbNo * @Description: 验证中医诊断序号是否存在 @@ -1961,17 +1996,17 @@ public class CommomSearchController { */ @RequestMapping(value = "checkHerbNo") @ResponseBody - public ResultUtil checkHerbNo(String patientId,Short herbNo){ - if(StringUtils.isNoneBlank(patientId) && herbNo != null){ + public ResultUtil checkHerbNo(String patientId, Short herbNo) { + if (StringUtils.isNoneBlank(patientId) && herbNo != null) { try { List herbDiags = herbDiagService.selectAllByPatientId(patientId, herbNo); - if(herbDiags != null && !herbDiags.isEmpty()){ + if (herbDiags != null && !herbDiags.isEmpty()) { //存在 return ResultUtil.error(); - }else{ + } else { return ResultUtil.ok(); } - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); } } @@ -1990,38 +2025,38 @@ public class CommomSearchController { * @UpdateRemark: 更新说明 * @Version: 1.0 */ - @RequiresPermissions(value={"/commom/addOperCode","/commom/updateOperCode"}) - @OptionalLog(module = "保存",methods = "中医诊断编码",fieldName = "herbName") + @RequiresPermissions(value = {"/commom/addOperCode", "/commom/updateOperCode"}) + @OptionalLog(module = "保存", methods = "中医诊断编码", fieldName = "herbName") @RequestMapping(value = "saveHerbDiag") @ResponseBody - public ResultUtil saveHerbDiag(T_Herb_Diag herbDiag,Integer isUpdateOperNo,HttpServletRequest request){ - try{ - if(herbDiag.getCurrentHerbDiagNo() == null){ + public ResultUtil saveHerbDiag(T_Herb_Diag herbDiag, Integer isUpdateOperNo, HttpServletRequest request) { + try { + if (herbDiag.getCurrentHerbDiagNo() == null) { //新增 boolean flag = FormTokenFlagUtil.isFlag(request); - if(!flag){ + if (!flag) { return ResultUtil.error("请不要重复提交!"); } herbDiagService.insert(herbDiag); - }else{ + } else { //修改 - if(isUpdateOperNo == 1){ + if (isUpdateOperNo == 1) { //有修改序号 //查询序号是否存在 List herbDiags = herbDiagService.selectAllByPatientId(herbDiag.getPatientId(), herbDiag.getHerbNo()); - if(null != herbDiags && !herbDiags.isEmpty()){ + if (null != herbDiags && !herbDiags.isEmpty()) { //存在 return ResultUtil.error("该诊断序号已存在!"); - }else{ + } else { herbDiagService.updateByPrimaryKeySelective(herbDiag); } - }else{ + } else { //诊断序号一样 herbDiagService.updateByPrimaryKeySelective(herbDiag); } } return ResultUtil.ok(); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return ResultUtil.error(); } @@ -2040,36 +2075,36 @@ public class CommomSearchController { * @Version: 1.0 */ @RequiresPermissions("/commom/deleteOperCode") - @OptionalLog(module = "删除",methods = "中医诊断编码",fieldName = "herbName",tableName = "t_herb_diag") + @OptionalLog(module = "删除", methods = "中医诊断编码", fieldName = "herbName", tableName = "t_herb_diag") @RequestMapping(value = "deleteCodeByPatientIdAndHerbNo") @ResponseBody - public ResultUtil deleteCodeByPatientIdAndHerbNo(String patientId,Short herbNo){ - if(StringUtils.isNoneBlank(patientId) && null != herbNo){ - try{ + public ResultUtil deleteCodeByPatientIdAndHerbNo(String patientId, Short herbNo) { + if (StringUtils.isNoneBlank(patientId) && null != herbNo) { + try { herbDiagService.deleteHerbDiagByPatientIdAndHerbNo(patientId, herbNo); return ResultUtil.ok(); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return ResultUtil.error(); } - }else{ + } else { return ResultUtil.error(); } } //封装根据index:当前pdf页数,patientId,admissIds获取pdf信息 - private List getPdfPathVo(Integer index,String patientId,String assortIds)throws Exception{ + private List getPdfPathVo(Integer index, String patientId, String assortIds) throws Exception { List list = new ArrayList<>(); - patientId = "'"+patientId+"'"; - List scanPathVos = scanPathMapper.selectScanFileByPatientIds(patientId,assortIds); + patientId = "'" + patientId + "'"; + List scanPathVos = scanPathMapper.selectScanFileByPatientIds(patientId, assortIds); //重新组织存在的文件,即转换成功的文件 - if(null != scanPathVos && !scanPathVos.isEmpty()) { + if (null != scanPathVos && !scanPathVos.isEmpty()) { // 实例化图片 Image image = null; //不成张合成的高度 float tempHeight = 0; Integer pageCount = 0; - for (ScanPathVo scanPathVo:scanPathVos) { + for (ScanPathVo scanPathVo : scanPathVos) { String fileRealPath = scanPathVo.getFileRealPath(); if (StringUtils.isNoneBlank(fileRealPath)) { //判断文件是否存在 @@ -2126,7 +2161,7 @@ public class CommomSearchController { if (width > 1024 || heigth > 786) { image.scalePercent(percent + 5); pageCount++; - if(pageCount == index){ + if (pageCount == index) { //当前页返回 list.clear(); list.add(scanPathVo); @@ -2141,17 +2176,17 @@ public class CommomSearchController { tempHeight += heigth; if (tempHeight > 786) { pageCount++; - if(pageCount == index){ + if (pageCount == index) { //当前页返回 list.clear(); list.add(scanPathVo); return list; - }else if(pageCount == (index + 1)){ + } else if (pageCount == (index + 1)) { //已另起一页,返回前一页 return list; } tempHeight = heigth; - }else{ + } else { //连续的几张图片高度总和小于786添加进集合 list.add(scanPathVo); } @@ -2163,22 +2198,6 @@ public class CommomSearchController { return list; } - //阿拉伯数字转中文 - private static String toChinese(String str) { - String[] s1 = { "零", "一", "二", "三", "四", "五", "六", "七", "八", "九" }; - String[] s2 = { "十", "百", "千", "万", "十", "百", "千", "亿", "十", "百", "千" }; - String result = ""; - int n = str.length(); - for (int i = 0; i < n; i++) { - int num = str.charAt(i) - '0'; - if (i != n - 1 && num != 0) { - result += s1[num] + s2[n - 2 - i]; - } else { - result += s1[num]; - } - } - return result; - } /*@RequestMapping("toPdf") public String toPdf(String patientId,String assortIds,String name,Model model){ model.addAttribute("patientId",patientId); @@ -2187,25 +2206,25 @@ public class CommomSearchController { return "recordManage/commomSearch/pdf"; }*/ @RequiresPermissions("/commom/updatePic") - @RequestMapping(value="updatePic",method= RequestMethod.POST) + @RequestMapping(value = "updatePic", method = RequestMethod.POST) @ResponseBody - public ResultUtil updatePic(@RequestParam(required = false,value = "files") - MultipartFile[] files,String patientId,String assortId,String flag){ - try{ + public ResultUtil updatePic(@RequestParam(required = false, value = "files") + MultipartFile[] files, String patientId, String assortId, String flag) { + try { CommomVo commomVo = commomMapper.selectByPrimaryKey(patientId); flag = FieldPropertyConvert.fieldToProperty(flag); Field field = commomVo.getClass().getDeclaredField(flag); field.setAccessible(true); - String path = (String)field.get(commomVo) + "/"; + String path = (String) field.get(commomVo) + "/"; SimpleDateFormat fmt = new SimpleDateFormat("yyyyMMddHHmmssSSS"); //定义批量添加进图片明细表集合 List insertList = new ArrayList<>(); for (int i = 0; i < files.length; i++) { String fullName = files[i].getOriginalFilename(); - String src = path + fullName; + String src = path + fullName; File file = new File(src); //判断是否存在,存在文件加日期 - if(file.exists()){ + if (file.exists()) { //原始名 String baseName = FilenameUtils.getBaseName(files[i].getOriginalFilename()); //扩展名 @@ -2223,7 +2242,7 @@ public class CommomSearchController { } scanAssortService.SimpleInsert(insertList); return ResultUtil.ok(); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); return ResultUtil.error("上传出错了,请联系系统管理员!"); } diff --git a/src/main/java/com/emr/entity/emrPrintAndDownLoad/EmrPrintDownloadInfo.java b/src/main/java/com/emr/entity/emrPrintAndDownLoad/EmrPrintDownloadInfo.java index 30a1b13..162a42c 100644 --- a/src/main/java/com/emr/entity/emrPrintAndDownLoad/EmrPrintDownloadInfo.java +++ b/src/main/java/com/emr/entity/emrPrintAndDownLoad/EmrPrintDownloadInfo.java @@ -19,6 +19,8 @@ public class EmrPrintDownloadInfo implements Serializable { private String creater; + private String ip; + private static final long serialVersionUID = 1L; public Integer getId() { @@ -85,21 +87,26 @@ public class EmrPrintDownloadInfo implements Serializable { this.creater = creater == null ? null : creater.trim(); } + public String getIp() { + return ip; + } + + public void setIp(String ip) { + this.ip = ip; + } + @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(", patientId=").append(patientId); - sb.append(", assortId=").append(assortId); - sb.append(", scanPage=").append(scanPage); - sb.append(", typeId=").append(typeId); - sb.append(", operType=").append(operType); - sb.append(", createTime=").append(createTime); - sb.append(", creater=").append(creater); - sb.append("]"); - return sb.toString(); + return "EmrPrintDownloadInfo{" + + "id=" + id + + ", patientId='" + patientId + '\'' + + ", assortId='" + assortId + '\'' + + ", scanPage='" + scanPage + '\'' + + ", typeId=" + typeId + + ", operType=" + operType + + ", createTime='" + createTime + '\'' + + ", creater='" + creater + '\'' + + ", ip='" + ip + '\'' + + '}'; } } \ No newline at end of file diff --git a/src/main/resources/mapper/CommomMapper.xml b/src/main/resources/mapper/CommomMapper.xml index 8c6bfa2..ab99727 100644 --- a/src/main/resources/mapper/CommomMapper.xml +++ b/src/main/resources/mapper/CommomMapper.xml @@ -1,381 +1,406 @@ - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - + + - - + SELECT + dbo.commomtable.patient_id, + dbo.t_scan_assort.assort_id, + dbo.zd_assort.assort_name, + COUNT(dbo.zd_assort.assort_name) assortCount + FROM + dbo.commomtable + LEFT JOIN + dbo.t_scan_assort + ON + dbo.commomtable.patient_id = dbo.t_scan_assort.patient_id + INNER JOIN + dbo.zd_assort + ON + dbo.t_scan_assort.assort_id = dbo.zd_assort.assort_id + + INNER JOIN ( + SELECT DISTINCT + assort_id + FROM + zd_assort + LEFT JOIN ( + SELECT + record_id + FROM + emr_role_reader + WHERE + role_id = ${roleId} + AND record_id NOT IN ( + SELECT + record_id + FROM + emr_user_reader + WHERE + user_id = ${userId} + AND flag = 0 + ) + UNION ALL + SELECT + record_id + FROM + emr_user_reader + WHERE + user_id = ${userId} + AND flag = 1 + ) emr_user_reader ON assort_id = emr_user_reader.record_id + WHERE + emr_user_reader.record_id IS NOT NULL ) a - ON dbo.zd_assort.assort_id = a.assort_id - - WHERE - dbo.commomtable.patient_id = #{patientId} - AND - dbo.zd_assort.print_flag = 0 - GROUP BY - dbo.t_scan_assort.assort_id,dbo.zd_assort.assort_name,dbo.commomtable.patient_id,dbo.zd_assort.assort_sort - ORDER BY - dbo.zd_assort.assort_sort - + ON dbo.zd_assort.assort_id = a.assort_id + + WHERE + dbo.commomtable.patient_id = #{patientId} + AND + dbo.zd_assort.print_flag = 0 + GROUP BY + dbo.t_scan_assort.assort_id,dbo.zd_assort.assort_name,dbo.commomtable.patient_id,dbo.zd_assort.assort_sort + ORDER BY + dbo.zd_assort.assort_sort + - - + SELECT + dbo.commomtable.patient_id, + dbo.t_scan_assort.assort_id, + dbo.zd_assort.assort_name, + t_scan_assort.scan_page + FROM + dbo.commomtable + LEFT JOIN + dbo.t_scan_assort + ON + dbo.commomtable.patient_id = dbo.t_scan_assort.patient_id + INNER JOIN + dbo.zd_assort + ON + dbo.t_scan_assort.assort_id = dbo.zd_assort.assort_id + + INNER JOIN ( + SELECT DISTINCT + assort_id + FROM + zd_assort + LEFT JOIN ( + SELECT + record_id + FROM + emr_role_reader + WHERE + role_id = ${roleId} + AND record_id NOT IN ( + SELECT + record_id + FROM + emr_user_reader + WHERE + user_id = ${userId} + AND flag = 0 + ) + UNION ALL + SELECT + record_id + FROM + emr_user_reader + WHERE + user_id = ${userId} + AND flag = 1 + ) emr_user_reader ON assort_id = emr_user_reader.record_id + WHERE + emr_user_reader.record_id IS NOT NULL ) a - ON dbo.zd_assort.assort_id = a.assort_id - - WHERE - dbo.commomtable.patient_id = #{patientId} - ORDER BY - dbo.zd_assort.assort_sort - - - + + - - - - - - - - + + + + + + + + + - - patient_id, admiss_times, inpatient_no, NAME, admiss_id, sex, age, age_month, age_day, - home_addr, name_cym, admiss_date, dis_date, admiss_days, dis_dept, is_oper, attending, - main_diag_name, main_dis_thing - - select - * + * from commomtable where patient_id = #{patientId,jdbcType=VARCHAR} - select - patient_id,file_path + patient_id, + file_path from commomtable where patient_id = #{patientId,jdbcType=VARCHAR} - + insert into commomtable - - + + patient_id, - + admiss_times, - + inpatient_no, - + NAME, - + admiss_id, - + sex, - + age, - + age_month, - + age_day, - + home_addr, - + name_cym, - + admiss_date, - + dis_date, - + admiss_days, - + dis_dept, - + is_oper, - + attending, - + main_diag_name, - + main_dis_thing, - - + + #{patientId,jdbcType=VARCHAR}, - + #{admissTimes,jdbcType=SMALLINT}, - + #{inpatientNo,jdbcType=VARCHAR}, - + #{name,jdbcType=VARCHAR}, - + #{admissId,jdbcType=VARCHAR}, - + #{sex,jdbcType=NVARCHAR}, - + #{age,jdbcType=SMALLINT}, - + #{ageMonth,jdbcType=SMALLINT}, - + #{ageDay,jdbcType=SMALLINT}, - + #{homeAddr,jdbcType=NVARCHAR}, - + #{nameCym,jdbcType=CHAR}, - + #{admissDate,jdbcType=TIMESTAMP}, - + #{disDate,jdbcType=TIMESTAMP}, - + #{admissDays,jdbcType=INTEGER}, - + #{disDept,jdbcType=NVARCHAR}, - + #{isOper,jdbcType=VARCHAR}, - + #{attending,jdbcType=VARCHAR}, - + #{mainDiagName,jdbcType=VARCHAR}, - + #{mainDisThing,jdbcType=NVARCHAR}, - + update commomtable - - + + admiss_times = #{admissTimes,jdbcType=SMALLINT}, - + inpatient_no = #{inpatientNo,jdbcType=VARCHAR}, - + NAME = #{name,jdbcType=VARCHAR}, - + admiss_id = #{admissId,jdbcType=VARCHAR}, - + sex = #{sex,jdbcType=NVARCHAR}, - + age = #{age,jdbcType=SMALLINT}, - + age_month = #{ageMonth,jdbcType=SMALLINT}, - + age_day = #{ageDay,jdbcType=SMALLINT}, - + home_addr = #{homeAddr,jdbcType=NVARCHAR}, - + name_cym = #{nameCym,jdbcType=CHAR}, - + admiss_date = #{admissDate,jdbcType=TIMESTAMP}, - + dis_date = #{disDate,jdbcType=TIMESTAMP}, - + admiss_days = #{admissDays,jdbcType=INTEGER}, - + dis_dept = #{disDept,jdbcType=NVARCHAR}, - + is_oper = #{isOper,jdbcType=VARCHAR}, - + attending = #{attending,jdbcType=VARCHAR}, - + main_diag_name = #{mainDiagName,jdbcType=VARCHAR}, - + main_dis_thing = #{mainDisThing,jdbcType=NVARCHAR}, @@ -607,462 +650,507 @@ - - patient_id, country, birth_addr, id_card, job, marriage, home_tel, home_zip,work_name, work_addr, - work_tel, work_zip, linkman, relation, rel_addr, rel_tel, pay_type, birthday, avoirdupois, - admiss_type, admiss_dept, admiss_ward, change_dept, dis_ward, clinic_diag, clinic_name, - pathology_code,pathology_no,pathology_name,medicine, is_medicine, emit_pathology, dept_director, director, admiss_doctor,refresher, praxis, coding, quality, control, nurses, quality_date, input_name,input_createTime,blood_type, RH - - select - + from commomtable1 where patient_id = #{patientId,jdbcType=VARCHAR} - + insert into commomtable1 (patient_id, country, birth_addr, - id_card, job, marriage, - home_tel, home_zip, work_addr, - work_tel, work_zip, linkman, - relation, rel_addr, rel_tel, - pay_type, birthday, admiss_type, - admiss_dept, admiss_ward, change_dept, - dis_ward, clinic_diag, clinic_name, - medicine, is_medicine, emit_pathology, - dept_director, director, admiss_doctor, - refresher, praxis, coding, - quality, control, nurses, - quality_date, blood_type, RH, - native_place, addr, telphone, - zip, change_date1, change_date2, - change_date3, change_dept1, change_dept2, - change_dept3, is_hospitalization, hospitalization_objective, - is_medical_record_path, responsible_nurse, - tumor_staging_type, radiotherapy_type, radiotherapy_program, - radiotherapy_device, primary_tumor_day, primary_tumor_times, - primary_tumor_dose, primary_tumor_starttime, - primary_tumor_endtime, chemotherapy_type, - chemotherapy_method, case_type, total_charge, - charge_02, charge_03, charge_04, - charge_05, charge_09, charge_10, - charge_14, charge_19, charge_20, - charge_22, charge_25, other, - charge_29, charge_30, charge_31, - charge_32, charge_33, charge_34, - charge_35, charge_36, charge_37, - charge_38, charge_39, charge_40, - charge_41, charge_42, charge_43, - charge_44, charge_45, nation, - home_addr, clinic_doctor, dis_type, - birthbaby_weight, healthy_card, save_times, - save_success_times, avoirdupois, admiss_thing, - work_name, pathology_code, pathology_no, - pathology_name, input_name, input_createTime, - ryqhm_days, ryqhm_hours, ryqhm_mins, - ryhm_days, ryhm_hours, ryhm_mins, - transfer_hospital_name, transfer_healcenter_name - ) - values (#{patientId,jdbcType=VARCHAR}, #{country,jdbcType=NVARCHAR}, #{birthAddr,jdbcType=NVARCHAR}, - #{idCard,jdbcType=NVARCHAR}, #{job,jdbcType=NVARCHAR}, #{marriage,jdbcType=NVARCHAR}, - #{homeTel,jdbcType=NVARCHAR}, #{homeZip,jdbcType=NVARCHAR}, #{workAddr,jdbcType=NVARCHAR}, - #{workTel,jdbcType=NVARCHAR}, #{workZip,jdbcType=NVARCHAR}, #{linkman,jdbcType=NVARCHAR}, - #{relation,jdbcType=NVARCHAR}, #{relAddr,jdbcType=VARCHAR}, #{relTel,jdbcType=NVARCHAR}, - #{payType,jdbcType=NVARCHAR}, #{birthday,jdbcType=TIMESTAMP}, #{admissType,jdbcType=NVARCHAR}, - #{admissDept,jdbcType=NVARCHAR}, #{admissWard,jdbcType=NVARCHAR}, #{changeDept,jdbcType=NVARCHAR}, - #{disWard,jdbcType=NVARCHAR}, #{clinicDiag,jdbcType=VARCHAR}, #{clinicName,jdbcType=VARCHAR}, - #{medicine,jdbcType=VARCHAR}, #{isMedicine,jdbcType=VARCHAR}, #{emitPathology,jdbcType=NVARCHAR}, - #{deptDirector,jdbcType=VARCHAR}, #{director,jdbcType=VARCHAR}, #{admissDoctor,jdbcType=VARCHAR}, - #{refresher,jdbcType=VARCHAR}, #{praxis,jdbcType=VARCHAR}, #{coding,jdbcType=VARCHAR}, - #{quality,jdbcType=NVARCHAR}, #{control,jdbcType=VARCHAR}, #{nurses,jdbcType=VARCHAR}, - #{qualityDate,jdbcType=TIMESTAMP}, #{bloodType,jdbcType=NVARCHAR}, #{rh,jdbcType=VARCHAR}, - #{nativePlace,jdbcType=NVARCHAR}, #{addr,jdbcType=NVARCHAR}, #{telphone,jdbcType=NVARCHAR}, - #{zip,jdbcType=NVARCHAR}, #{changeDate1,jdbcType=NVARCHAR}, #{changeDate2,jdbcType=NVARCHAR}, - #{changeDate3,jdbcType=NVARCHAR}, #{changeDept1,jdbcType=NVARCHAR}, #{changeDept2,jdbcType=NVARCHAR}, - #{changeDept3,jdbcType=NVARCHAR}, #{isHospitalization,jdbcType=NVARCHAR}, #{hospitalizationObjective,jdbcType=NVARCHAR}, - #{isMedicalRecordPath,jdbcType=NVARCHAR}, #{responsibleNurse,jdbcType=NVARCHAR}, - #{tumorStagingType,jdbcType=NVARCHAR}, #{radiotherapyType,jdbcType=NVARCHAR}, #{radiotherapyProgram,jdbcType=NVARCHAR}, - #{radiotherapyDevice,jdbcType=NVARCHAR}, #{primaryTumorDay,jdbcType=INTEGER}, #{primaryTumorTimes,jdbcType=INTEGER}, - #{primaryTumorDose,jdbcType=NVARCHAR}, #{primaryTumorStarttime,jdbcType=NVARCHAR}, - #{primaryTumorEndtime,jdbcType=NVARCHAR}, #{chemotherapyType,jdbcType=NVARCHAR}, - #{chemotherapyMethod,jdbcType=NVARCHAR}, #{caseType,jdbcType=VARCHAR}, #{totalCharge,jdbcType=DECIMAL}, - #{charge02,jdbcType=DECIMAL}, #{charge03,jdbcType=DECIMAL}, #{charge04,jdbcType=DECIMAL}, - #{charge05,jdbcType=DECIMAL}, #{charge09,jdbcType=DECIMAL}, #{charge10,jdbcType=DECIMAL}, - #{charge14,jdbcType=DECIMAL}, #{charge19,jdbcType=DECIMAL}, #{charge20,jdbcType=DECIMAL}, - #{charge22,jdbcType=DECIMAL}, #{charge25,jdbcType=DECIMAL}, #{other,jdbcType=DECIMAL}, - #{charge29,jdbcType=DECIMAL}, #{charge30,jdbcType=DECIMAL}, #{charge31,jdbcType=DECIMAL}, - #{charge32,jdbcType=DECIMAL}, #{charge33,jdbcType=DECIMAL}, #{charge34,jdbcType=DECIMAL}, - #{charge35,jdbcType=DECIMAL}, #{charge36,jdbcType=DECIMAL}, #{charge37,jdbcType=DECIMAL}, - #{charge38,jdbcType=DECIMAL}, #{charge39,jdbcType=DECIMAL}, #{charge40,jdbcType=DECIMAL}, - #{charge41,jdbcType=DECIMAL}, #{charge42,jdbcType=DECIMAL}, #{charge43,jdbcType=DECIMAL}, - #{charge44,jdbcType=DECIMAL}, #{charge45,jdbcType=DECIMAL}, #{nation,jdbcType=NVARCHAR}, - #{homeAddr,jdbcType=NVARCHAR}, #{clinicDoctor,jdbcType=NVARCHAR}, #{disType,jdbcType=NVARCHAR}, - #{birthbabyWeight,jdbcType=DECIMAL}, #{healthyCard,jdbcType=NVARCHAR}, #{saveTimes,jdbcType=NVARCHAR}, - #{saveSuccessTimes,jdbcType=NVARCHAR}, #{avoirdupois,jdbcType=DECIMAL}, #{admissThing,jdbcType=NVARCHAR}, - #{workName,jdbcType=NVARCHAR}, #{pathologyCode,jdbcType=VARCHAR}, #{pathologyNo,jdbcType=VARCHAR}, - #{pathologyName,jdbcType=VARCHAR}, #{inputName,jdbcType=NVARCHAR}, #{inputCreatetime,jdbcType=NVARCHAR}, - #{ryqhmDays,jdbcType=INTEGER}, #{ryqhmHours,jdbcType=INTEGER}, #{ryqhmMins,jdbcType=INTEGER}, - #{ryhmDays,jdbcType=INTEGER}, #{ryhmHours,jdbcType=INTEGER}, #{ryhmMins,jdbcType=INTEGER}, - #{transferHospitalName,jdbcType=NVARCHAR}, #{transferHealcenterName,jdbcType=NVARCHAR} - ) + id_card, job, marriage, + home_tel, home_zip, work_addr, + work_tel, work_zip, linkman, + relation, rel_addr, rel_tel, + pay_type, birthday, admiss_type, + admiss_dept, admiss_ward, change_dept, + dis_ward, clinic_diag, clinic_name, + medicine, is_medicine, emit_pathology, + dept_director, director, admiss_doctor, + refresher, praxis, coding, + quality, control, nurses, + quality_date, blood_type, RH, + native_place, addr, telphone, + zip, change_date1, change_date2, + change_date3, change_dept1, change_dept2, + change_dept3, is_hospitalization, hospitalization_objective, + is_medical_record_path, responsible_nurse, + tumor_staging_type, radiotherapy_type, radiotherapy_program, + radiotherapy_device, primary_tumor_day, primary_tumor_times, + primary_tumor_dose, primary_tumor_starttime, + primary_tumor_endtime, chemotherapy_type, + chemotherapy_method, case_type, total_charge, + charge_02, charge_03, charge_04, + charge_05, charge_09, charge_10, + charge_14, charge_19, charge_20, + charge_22, charge_25, other, + charge_29, charge_30, charge_31, + charge_32, charge_33, charge_34, + charge_35, charge_36, charge_37, + charge_38, charge_39, charge_40, + charge_41, charge_42, charge_43, + charge_44, charge_45, nation, + home_addr, clinic_doctor, dis_type, + birthbaby_weight, healthy_card, save_times, + save_success_times, avoirdupois, admiss_thing, + work_name, pathology_code, pathology_no, + pathology_name, input_name, input_createTime, + ryqhm_days, ryqhm_hours, ryqhm_mins, + ryhm_days, ryhm_hours, ryhm_mins, + transfer_hospital_name, transfer_healcenter_name) + values (#{patientId,jdbcType=VARCHAR}, #{country,jdbcType=NVARCHAR}, #{birthAddr,jdbcType=NVARCHAR}, + #{idCard,jdbcType=NVARCHAR}, #{job,jdbcType=NVARCHAR}, #{marriage,jdbcType=NVARCHAR}, + #{homeTel,jdbcType=NVARCHAR}, #{homeZip,jdbcType=NVARCHAR}, #{workAddr,jdbcType=NVARCHAR}, + #{workTel,jdbcType=NVARCHAR}, #{workZip,jdbcType=NVARCHAR}, #{linkman,jdbcType=NVARCHAR}, + #{relation,jdbcType=NVARCHAR}, #{relAddr,jdbcType=VARCHAR}, #{relTel,jdbcType=NVARCHAR}, + #{payType,jdbcType=NVARCHAR}, #{birthday,jdbcType=TIMESTAMP}, #{admissType,jdbcType=NVARCHAR}, + #{admissDept,jdbcType=NVARCHAR}, #{admissWard,jdbcType=NVARCHAR}, #{changeDept,jdbcType=NVARCHAR}, + #{disWard,jdbcType=NVARCHAR}, #{clinicDiag,jdbcType=VARCHAR}, #{clinicName,jdbcType=VARCHAR}, + #{medicine,jdbcType=VARCHAR}, #{isMedicine,jdbcType=VARCHAR}, #{emitPathology,jdbcType=NVARCHAR}, + #{deptDirector,jdbcType=VARCHAR}, #{director,jdbcType=VARCHAR}, #{admissDoctor,jdbcType=VARCHAR}, + #{refresher,jdbcType=VARCHAR}, #{praxis,jdbcType=VARCHAR}, #{coding,jdbcType=VARCHAR}, + #{quality,jdbcType=NVARCHAR}, #{control,jdbcType=VARCHAR}, #{nurses,jdbcType=VARCHAR}, + #{qualityDate,jdbcType=TIMESTAMP}, #{bloodType,jdbcType=NVARCHAR}, #{rh,jdbcType=VARCHAR}, + #{nativePlace,jdbcType=NVARCHAR}, #{addr,jdbcType=NVARCHAR}, #{telphone,jdbcType=NVARCHAR}, + #{zip,jdbcType=NVARCHAR}, #{changeDate1,jdbcType=NVARCHAR}, #{changeDate2,jdbcType=NVARCHAR}, + #{changeDate3,jdbcType=NVARCHAR}, #{changeDept1,jdbcType=NVARCHAR}, #{changeDept2,jdbcType=NVARCHAR}, + #{changeDept3,jdbcType=NVARCHAR}, #{isHospitalization,jdbcType=NVARCHAR}, + #{hospitalizationObjective,jdbcType=NVARCHAR}, + #{isMedicalRecordPath,jdbcType=NVARCHAR}, #{responsibleNurse,jdbcType=NVARCHAR}, + #{tumorStagingType,jdbcType=NVARCHAR}, #{radiotherapyType,jdbcType=NVARCHAR}, + #{radiotherapyProgram,jdbcType=NVARCHAR}, + #{radiotherapyDevice,jdbcType=NVARCHAR}, #{primaryTumorDay,jdbcType=INTEGER}, + #{primaryTumorTimes,jdbcType=INTEGER}, + #{primaryTumorDose,jdbcType=NVARCHAR}, #{primaryTumorStarttime,jdbcType=NVARCHAR}, + #{primaryTumorEndtime,jdbcType=NVARCHAR}, #{chemotherapyType,jdbcType=NVARCHAR}, + #{chemotherapyMethod,jdbcType=NVARCHAR}, #{caseType,jdbcType=VARCHAR}, #{totalCharge,jdbcType=DECIMAL}, + #{charge02,jdbcType=DECIMAL}, #{charge03,jdbcType=DECIMAL}, #{charge04,jdbcType=DECIMAL}, + #{charge05,jdbcType=DECIMAL}, #{charge09,jdbcType=DECIMAL}, #{charge10,jdbcType=DECIMAL}, + #{charge14,jdbcType=DECIMAL}, #{charge19,jdbcType=DECIMAL}, #{charge20,jdbcType=DECIMAL}, + #{charge22,jdbcType=DECIMAL}, #{charge25,jdbcType=DECIMAL}, #{other,jdbcType=DECIMAL}, + #{charge29,jdbcType=DECIMAL}, #{charge30,jdbcType=DECIMAL}, #{charge31,jdbcType=DECIMAL}, + #{charge32,jdbcType=DECIMAL}, #{charge33,jdbcType=DECIMAL}, #{charge34,jdbcType=DECIMAL}, + #{charge35,jdbcType=DECIMAL}, #{charge36,jdbcType=DECIMAL}, #{charge37,jdbcType=DECIMAL}, + #{charge38,jdbcType=DECIMAL}, #{charge39,jdbcType=DECIMAL}, #{charge40,jdbcType=DECIMAL}, + #{charge41,jdbcType=DECIMAL}, #{charge42,jdbcType=DECIMAL}, #{charge43,jdbcType=DECIMAL}, + #{charge44,jdbcType=DECIMAL}, #{charge45,jdbcType=DECIMAL}, #{nation,jdbcType=NVARCHAR}, + #{homeAddr,jdbcType=NVARCHAR}, #{clinicDoctor,jdbcType=NVARCHAR}, #{disType,jdbcType=NVARCHAR}, + #{birthbabyWeight,jdbcType=DECIMAL}, #{healthyCard,jdbcType=NVARCHAR}, #{saveTimes,jdbcType=NVARCHAR}, + #{saveSuccessTimes,jdbcType=NVARCHAR}, #{avoirdupois,jdbcType=DECIMAL}, + #{admissThing,jdbcType=NVARCHAR}, + #{workName,jdbcType=NVARCHAR}, #{pathologyCode,jdbcType=VARCHAR}, #{pathologyNo,jdbcType=VARCHAR}, + #{pathologyName,jdbcType=VARCHAR}, #{inputName,jdbcType=NVARCHAR}, #{inputCreatetime,jdbcType=NVARCHAR}, + #{ryqhmDays,jdbcType=INTEGER}, #{ryqhmHours,jdbcType=INTEGER}, #{ryqhmMins,jdbcType=INTEGER}, + #{ryhmDays,jdbcType=INTEGER}, #{ryhmHours,jdbcType=INTEGER}, #{ryhmMins,jdbcType=INTEGER}, + #{transferHospitalName,jdbcType=NVARCHAR}, #{transferHealcenterName,jdbcType=NVARCHAR}) - + update commomtable1 - - + + country = #{country,jdbcType=NVARCHAR}, - + birth_addr = #{birthAddr,jdbcType=NVARCHAR}, - + id_card = #{idCard,jdbcType=NVARCHAR}, - + job = #{job,jdbcType=NVARCHAR}, - + marriage = #{marriage,jdbcType=NVARCHAR}, - + home_tel = #{homeTel,jdbcType=NVARCHAR}, - + home_zip = #{homeZip,jdbcType=NVARCHAR}, - + work_addr = #{workAddr,jdbcType=NVARCHAR}, - + work_tel = #{workTel,jdbcType=NVARCHAR}, - + work_zip = #{workZip,jdbcType=NVARCHAR}, - + linkman = #{linkman,jdbcType=NVARCHAR}, - + relation = #{relation,jdbcType=NVARCHAR}, - + rel_addr = #{relAddr,jdbcType=VARCHAR}, - + rel_tel = #{relTel,jdbcType=NVARCHAR}, - + pay_type = #{payType,jdbcType=NVARCHAR}, - + birthday = #{birthday,jdbcType=TIMESTAMP}, - + admiss_type = #{admissType,jdbcType=NVARCHAR}, - + admiss_dept = #{admissDept,jdbcType=NVARCHAR}, - + admiss_ward = #{admissWard,jdbcType=NVARCHAR}, - + change_dept = #{changeDept,jdbcType=NVARCHAR}, - + dis_ward = #{disWard,jdbcType=NVARCHAR}, - + clinic_diag = #{clinicDiag,jdbcType=VARCHAR}, - + clinic_name = #{clinicName,jdbcType=VARCHAR}, - + medicine = #{medicine,jdbcType=VARCHAR}, - + is_medicine = #{isMedicine,jdbcType=VARCHAR}, - + emit_pathology = #{emitPathology,jdbcType=NVARCHAR}, - + dept_director = #{deptDirector,jdbcType=VARCHAR}, - + director = #{director,jdbcType=VARCHAR}, - + admiss_doctor = #{admissDoctor,jdbcType=VARCHAR}, - + refresher = #{refresher,jdbcType=VARCHAR}, - + praxis = #{praxis,jdbcType=VARCHAR}, - + coding = #{coding,jdbcType=VARCHAR}, - + quality = #{quality,jdbcType=NVARCHAR}, - + control = #{control,jdbcType=VARCHAR}, - + nurses = #{nurses,jdbcType=VARCHAR}, - + quality_date = #{qualityDate,jdbcType=TIMESTAMP}, - + blood_type = #{bloodType,jdbcType=NVARCHAR}, - + RH = #{rh,jdbcType=VARCHAR}, - + native_place = #{nativePlace,jdbcType=NVARCHAR}, - + addr = #{addr,jdbcType=NVARCHAR}, - + telphone = #{telphone,jdbcType=NVARCHAR}, - + zip = #{zip,jdbcType=NVARCHAR}, - + change_date1 = #{changeDate1,jdbcType=NVARCHAR}, - + change_date2 = #{changeDate2,jdbcType=NVARCHAR}, - + change_date3 = #{changeDate3,jdbcType=NVARCHAR}, - + change_dept1 = #{changeDept1,jdbcType=NVARCHAR}, - + change_dept2 = #{changeDept2,jdbcType=NVARCHAR}, - + change_dept3 = #{changeDept3,jdbcType=NVARCHAR}, - + is_hospitalization = #{isHospitalization,jdbcType=NVARCHAR}, - + hospitalization_objective = #{hospitalizationObjective,jdbcType=NVARCHAR}, - + is_medical_record_path = #{isMedicalRecordPath,jdbcType=NVARCHAR}, - + responsible_nurse = #{responsibleNurse,jdbcType=NVARCHAR}, - + tumor_staging_type = #{tumorStagingType,jdbcType=NVARCHAR}, - + radiotherapy_type = #{radiotherapyType,jdbcType=NVARCHAR}, - + radiotherapy_program = #{radiotherapyProgram,jdbcType=NVARCHAR}, - + radiotherapy_device = #{radiotherapyDevice,jdbcType=NVARCHAR}, - + primary_tumor_day = #{primaryTumorDay,jdbcType=INTEGER}, - + primary_tumor_times = #{primaryTumorTimes,jdbcType=INTEGER}, - + primary_tumor_dose = #{primaryTumorDose,jdbcType=NVARCHAR}, - + primary_tumor_starttime = #{primaryTumorStarttime,jdbcType=NVARCHAR}, - + primary_tumor_endtime = #{primaryTumorEndtime,jdbcType=NVARCHAR}, - + chemotherapy_type = #{chemotherapyType,jdbcType=NVARCHAR}, - + chemotherapy_method = #{chemotherapyMethod,jdbcType=NVARCHAR}, - + case_type = #{caseType,jdbcType=VARCHAR}, - + total_charge = #{totalCharge,jdbcType=DECIMAL}, - + charge_02 = #{charge02,jdbcType=DECIMAL}, - + charge_03 = #{charge03,jdbcType=DECIMAL}, - + charge_04 = #{charge04,jdbcType=DECIMAL}, - + charge_05 = #{charge05,jdbcType=DECIMAL}, - + charge_09 = #{charge09,jdbcType=DECIMAL}, - + charge_10 = #{charge10,jdbcType=DECIMAL}, - + charge_14 = #{charge14,jdbcType=DECIMAL}, - + charge_19 = #{charge19,jdbcType=DECIMAL}, - + charge_20 = #{charge20,jdbcType=DECIMAL}, - + charge_22 = #{charge22,jdbcType=DECIMAL}, - + charge_25 = #{charge25,jdbcType=DECIMAL}, - + other = #{other,jdbcType=DECIMAL}, - + charge_29 = #{charge29,jdbcType=DECIMAL}, - + charge_30 = #{charge30,jdbcType=DECIMAL}, - + charge_31 = #{charge31,jdbcType=DECIMAL}, - + charge_32 = #{charge32,jdbcType=DECIMAL}, - + charge_33 = #{charge33,jdbcType=DECIMAL}, - + charge_34 = #{charge34,jdbcType=DECIMAL}, - + charge_35 = #{charge35,jdbcType=DECIMAL}, - + charge_36 = #{charge36,jdbcType=DECIMAL}, - + charge_37 = #{charge37,jdbcType=DECIMAL}, - + charge_38 = #{charge38,jdbcType=DECIMAL}, - + charge_39 = #{charge39,jdbcType=DECIMAL}, - + charge_40 = #{charge40,jdbcType=DECIMAL}, - + charge_41 = #{charge41,jdbcType=DECIMAL}, - + charge_42 = #{charge42,jdbcType=DECIMAL}, - + charge_43 = #{charge43,jdbcType=DECIMAL}, - + charge_44 = #{charge44,jdbcType=DECIMAL}, - + charge_45 = #{charge45,jdbcType=DECIMAL}, - + nation = #{nation,jdbcType=NVARCHAR}, - + home_addr = #{homeAddr,jdbcType=NVARCHAR}, - + clinic_doctor = #{clinicDoctor,jdbcType=NVARCHAR}, - + dis_type = #{disType,jdbcType=NVARCHAR}, - + birthbaby_weight = #{birthbabyWeight,jdbcType=DECIMAL}, - + healthy_card = #{healthyCard,jdbcType=NVARCHAR}, - + save_times = #{saveTimes,jdbcType=NVARCHAR}, - + save_success_times = #{saveSuccessTimes,jdbcType=NVARCHAR}, - + avoirdupois = #{avoirdupois,jdbcType=DECIMAL}, - + admiss_thing = #{admissThing,jdbcType=NVARCHAR}, - + work_name = #{workName,jdbcType=NVARCHAR}, - + pathology_code = #{pathologyCode,jdbcType=VARCHAR}, - + pathology_no = #{pathologyNo,jdbcType=VARCHAR}, - + pathology_name = #{pathologyName,jdbcType=VARCHAR}, - + input_name = #{inputName,jdbcType=NVARCHAR}, - + input_createTime = #{inputCreatetime,jdbcType=NVARCHAR}, - + ryqhm_days = #{ryqhmDays,jdbcType=INTEGER}, - + ryqhm_hours = #{ryqhmHours,jdbcType=INTEGER}, - + ryqhm_mins = #{ryqhmMins,jdbcType=INTEGER}, - + ryhm_days = #{ryhmDays,jdbcType=INTEGER}, - + ryhm_hours = #{ryhmHours,jdbcType=INTEGER}, - + ryhm_mins = #{ryhmMins,jdbcType=INTEGER}, - + transfer_hospital_name = #{transferHospitalName,jdbcType=NVARCHAR}, - + transfer_healcenter_name = #{transferHealcenterName,jdbcType=NVARCHAR}, @@ -1070,9 +1158,9 @@ SELECT - count(1) + count(1) FROM - commomtable + commomtable LEFT JOIN - commomtable1 + commomtable1 ON - commomtable.patient_id = commomtable1.patient_id + commomtable.patient_id = commomtable1.patient_id AND commomtable.patient_id = #{patientId} @@ -1118,21 +1206,31 @@ \ No newline at end of file diff --git a/src/main/resources/mapper/emrPrintAndDownLoad/EmrPrintDownloadInfoMapper.xml b/src/main/resources/mapper/emrPrintAndDownLoad/EmrPrintDownloadInfoMapper.xml index 66420f7..39e313e 100644 --- a/src/main/resources/mapper/emrPrintAndDownLoad/EmrPrintDownloadInfoMapper.xml +++ b/src/main/resources/mapper/emrPrintAndDownLoad/EmrPrintDownloadInfoMapper.xml @@ -1,198 +1,228 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - insert into emr_print_download_info (id, patient_id, assort_id, - scan_page, type_id, oper_type, - create_time, creater) - values (#{id,jdbcType=INTEGER}, #{patientId,jdbcType=NVARCHAR}, #{assortId,jdbcType=VARCHAR}, - #{scanPage,jdbcType=NVARCHAR}, #{typeId,jdbcType=INTEGER}, #{operType,jdbcType=SMALLINT}, - #{createTime,jdbcType=NVARCHAR}, #{creater,jdbcType=NVARCHAR}) - - - insert into emr_print_download_info - - - id, - - - patient_id, - - - assort_id, - - - scan_page, - - - type_id, - - - oper_type, - - - create_time, - - - creater, - - - - - #{id,jdbcType=INTEGER}, - - - #{patientId,jdbcType=NVARCHAR}, - - - #{assortId,jdbcType=VARCHAR}, - - - #{scanPage,jdbcType=NVARCHAR}, - - - #{typeId,jdbcType=INTEGER}, - - - #{operType,jdbcType=SMALLINT}, - - - #{createTime,jdbcType=NVARCHAR}, - - - #{creater,jdbcType=NVARCHAR}, - - - - - - insert into emr_print_download_info (patient_id, scan_page,assort_id, - type_id, oper_type, create_time, - creater) - - select #{items.patientId,jdbcType=NVARCHAR}, #{items.scanPage,jdbcType=NVARCHAR},#{items.assortId,jdbcType=VARCHAR}, - #{items.typeId,jdbcType=INTEGER}, #{items.operType,jdbcType=SMALLINT}, #{items.createTime,jdbcType=NVARCHAR}, - #{items.creater,jdbcType=NVARCHAR} - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into emr_print_download_info (id, patient_id, assort_id, + scan_page, type_id, oper_type, + create_time, creater) + values (#{id,jdbcType=INTEGER}, #{patientId,jdbcType=NVARCHAR}, #{assortId,jdbcType=VARCHAR}, + #{scanPage,jdbcType=NVARCHAR}, #{typeId,jdbcType=INTEGER}, #{operType,jdbcType=SMALLINT}, + #{createTime,jdbcType=NVARCHAR}, #{creater,jdbcType=NVARCHAR}) + + + insert into emr_print_download_info + + + id, + + + patient_id, + + + assort_id, + + + scan_page, + + + type_id, + + + oper_type, + + + create_time, + + + creater, + + + + + #{id,jdbcType=INTEGER}, + + + #{patientId,jdbcType=NVARCHAR}, + + + #{assortId,jdbcType=VARCHAR}, + + + #{scanPage,jdbcType=NVARCHAR}, + + + #{typeId,jdbcType=INTEGER}, + + + #{operType,jdbcType=SMALLINT}, + + + #{createTime,jdbcType=NVARCHAR}, + + + #{creater,jdbcType=NVARCHAR}, + + + + + + insert into emr_print_download_info (patient_id, scan_page,assort_id, + type_id, oper_type, create_time, + creater) + + select #{items.patientId,jdbcType=NVARCHAR}, + #{items.scanPage,jdbcType=NVARCHAR},#{items.assortId,jdbcType=VARCHAR}, + #{items.typeId,jdbcType=INTEGER}, #{items.operType,jdbcType=SMALLINT}, + #{items.createTime,jdbcType=NVARCHAR}, + #{items.creater,jdbcType=NVARCHAR} + + - - - - - - - + SELECT + emr_print_download_info.id, emr_print_download_info.create_time, - emr_type.type_name - ORDER BY - emr_print_download_info.create_time DESC - + emr_print_download_info.patient_id, + emr_print_download_info.scan_page, + ( + commomtable.${flag} + '/' + emr_print_download_info.scan_page + ) scanAddr, + emr_print_download_info.creater, + commomtable.name, + commomtable.admiss_times, + commomtable.inpatient_no, + emr_type.type_name, + zd_assort.assort_name + FROM + emr_print_download_info + INNER JOIN commomtable ON emr_print_download_info.patient_id = commomtable.patient_id + + AND commomtable.name LIKE '%${record.name}%' + + + AND commomtable.inpatient_no LIKE '%${record.inpatientNo}%' + + LEFT JOIN emr_type ON emr_print_download_info.type_id = emr_type.id + INNER JOIN zd_assort ON emr_print_download_info.assort_id = zd_assort.assort_id + WHERE + emr_print_download_info.oper_type = #{record.operType} + + AND emr_print_download_info.assort_id = #{record.assortId} + + + AND emr_print_download_info.creater LIKE '%${record.creater}%' + + + AND emr_print_download_info.create_time >= '${record.startTime} 00:00:00' + + AND emr_print_download_info.create_time <= '${record.endTime} 23:59:59' + + + order by emr_print_download_info.create_time desc + + + + + + \ No newline at end of file diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp index 4c474dc..0c93b55 100644 --- a/src/main/webapp/index.jsp +++ b/src/main/webapp/index.jsp @@ -210,7 +210,7 @@
- +