王新海的版本加借阅工号转姓名

master
zengwh 5 years ago
parent a995e23397
commit 458dfc5839

@ -1,11 +1,20 @@
package com.emr.controller; package com.emr.controller;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.emr.annotation.OptionalLog;
import com.emr.dao.CommomMapper; import com.emr.dao.CommomMapper;
import com.emr.dao.Emr_DictionaryMapper;
import com.emr.dao.approve.Emr_Apply_ApproveMapper;
import com.emr.entity.Emr_Dictionary;
import com.emr.entity.Power_User; import com.emr.entity.Power_User;
import com.emr.entity.ResultUtil; import com.emr.entity.ResultUtil;
import com.emr.entity.approve.Emr_Apply_Approve;
import com.emr.entity.emrLog.Emr_Log;
import com.emr.service.CommomService; import com.emr.service.CommomService;
import com.emr.service.approve.ApplyApproveService;
import com.emr.service.emrLog.LogService;
import com.emr.service.emrPrintOrDownLoadInfo.PrintOrDownLoadInfoService; import com.emr.service.emrPrintOrDownLoadInfo.PrintOrDownLoadInfoService;
import com.emr.util.DateUtils;
import com.emr.util.ExceptionPrintUtil; import com.emr.util.ExceptionPrintUtil;
import com.emr.vo.EmrPrintOrDownLoadInfo.EmrPrintOrDownLoadInfoVo; import com.emr.vo.EmrPrintOrDownLoadInfo.EmrPrintOrDownLoadInfoVo;
import com.emr.vo.commomSearch.CommomTree; import com.emr.vo.commomSearch.CommomTree;
@ -16,6 +25,7 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.UsernamePasswordToken; import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.subject.Subject; import org.apache.shiro.subject.Subject;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -25,6 +35,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.File; import java.io.File;
import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
@Controller @Controller
@ -40,6 +51,14 @@ public class FontShowRecordController {
private PrintOrDownLoadInfoService printOrDownLoadInfoService; private PrintOrDownLoadInfoService printOrDownLoadInfoService;
@Autowired @Autowired
private CommomService commomService; private CommomService commomService;
@Autowired
private LogService logService;
@Autowired
private ApplyApproveService applyApproveService;
@Autowired
private Emr_DictionaryMapper dictionaryMapper;
/** /**
* @MethodName recordList * @MethodName recordList
* @Description: * @Description:
@ -72,7 +91,6 @@ public class FontShowRecordController {
user.setUserId(-999); user.setUserId(-999);
user.setRoleId(-999); user.setRoleId(-999);
Set<String> menu = new TreeSet<>(); Set<String> menu = new TreeSet<>();
//menu.add("/commom/printPdf");
user.setMenus(menu); user.setMenus(menu);
UsernamePasswordToken userToken = new UsernamePasswordToken(user.getUserName(), "123456"); UsernamePasswordToken userToken = new UsernamePasswordToken(user.getUserName(), "123456");
Subject subject = SecurityUtils.getSubject(); Subject subject = SecurityUtils.getSubject();
@ -86,6 +104,172 @@ public class FontShowRecordController {
return "font/recordList"; return "font/recordList";
} }
/**
*
* @param inpatientNo
* @param userName
* @param model
* @param request
* @return
*/
@RequestMapping(value = "recordListSouth")
public String showRecordSouth(String inpatientNo, String userName, String deptName, Model model, HttpServletRequest request) {
try{
//根据病案号查看病案是否存在
if(StringUtils.isNotBlank(inpatientNo)){
int commom = commomMapper.isExistInpatientOrAdmissId(inpatientNo, null, null);
if(commom == 0){
model.addAttribute("msg","病案不存在!");
return "font/msg";
}
}else{
model.addAttribute("msg","参数病案号不能为空!");
return "font/msg";
}
//虚假登陆
//验证shiro(有shiro才此操作)
Power_User user = new Power_User();
user.setUserName(userName);
user.setUserId(-999);
user.setRoleId(-999);
Set<String> menu = new TreeSet<>();
//menu.add("/commom/printPdf");
user.setMenus(menu);
UsernamePasswordToken userToken = new UsernamePasswordToken(user.getUserName(), "123456");
Subject subject = SecurityUtils.getSubject();
subject.login(userToken);
request.getSession().setAttribute("CURRENT_USER", user);
request.getSession().setAttribute("userName", userName);
request.getSession().setAttribute("deptName", deptName);
model.addAttribute("inpatientNo",inpatientNo);
Emr_Log emrLog = new Emr_Log();
emrLog.setLogTitle("接口查看");
emrLog.setLogContent("接口查询页面");
logService.insertInterface(emrLog, userName);
}catch (Exception e){
ExceptionPrintUtil.printException(e);
e.printStackTrace();
}
return "font/recordListSouth";
}
/**
*
* @param page
* @param limit
* @param inpatientNo
* @param request
* @return
*/
@RequestMapping("getRecordListByInpatientNoSouth")
@ResponseBody
public String getRecordListByInpatientNoSouth(Integer page, Integer limit,String inpatientNo, HttpServletRequest request){
if(null != page && null != limit){
PageHelper.startPage(page, limit);
}
try{
List<CommomVo> list = commomMapper.selectCommomByInpatientNo(inpatientNo);
PageInfo pageInfo = new PageInfo<>(list);
return JSON.toJSONString(pageInfo);
}catch (Exception e){
ExceptionPrintUtil.printException(e);
e.printStackTrace();
return null;
}
}
/**
* 访
* @param userName
* @param deptName
* @param request
* @return
*/
@RequestMapping(value = "commomListSouth")
public String commomListSouth(String userName, String deptName, Model model, HttpServletRequest request){
//验证shiro(有shiro才此操作)
UsernamePasswordToken userToken = new UsernamePasswordToken(userName, "123456");
Subject subject = SecurityUtils.getSubject();
subject.login(userToken);
Power_User user = new Power_User();
user.setUserName(userName);
request.getSession().setAttribute("cuserName", userName);
request.getSession().setAttribute("CURRENT_USER", user);
request.getSession().setAttribute("cdeptName", deptName);
model.addAttribute("cuserName", userName);
return "font/commomListSouth";
}
/**
*
* @param applyApprove
* @param patientIds
* @param request
* @return
* @throws Exception
*/
@RequestMapping("addApplyApprove")
@ResponseBody
@OptionalLog(module = "接口保存",methods = "接口查询页面保存借阅申请")
public ResultUtil addApplyApprove(Emr_Apply_Approve applyApprove, String patientIds,HttpServletRequest request) throws Exception {
boolean flag = FormTokenFlagUtil.isFlag(request);
if (!flag) {
return ResultUtil.error("请不要重复提交!");
}
List<CommomVo> commomtables = commomMapper.selectAllByPatients(patientIds.substring(0, patientIds.length()-1));
if(null != commomtables && !commomtables.isEmpty()) {
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String userName = (String)request.getSession().getAttribute("cuserName");
applyApprove.setApplyer(userName);
applyApprove.setApplyTime(fmt.format(new Date()));
List<Emr_Apply_Approve> list = new ArrayList<>();
///查询表列数
int colCount = commomMapper.selectColByTableName("emr_apply_approve");
int simpleInsertCount = 2100/colCount;
for (int i = 0; i < commomtables.size(); i++) {
//处理批量添加sql太长问题设定个数为180
if(i > 0 && list.size()%simpleInsertCount == 0){
list.clear();
}
Emr_Apply_Approve applyApproveInsert = new Emr_Apply_Approve();
BeanUtils.copyProperties(applyApprove, applyApproveInsert);
BeanUtils.copyProperties(commomtables.get(i), applyApproveInsert);
if(StringUtils.isNotBlank(commomtables.get(i).getDisDate())){
applyApproveInsert.setDisDate(DateUtils.strToDateLong(commomtables.get(i).getDisDate()));
}
list.add(applyApproveInsert);
if(list.size() == 1 && list.get(0).getId() != null){
applyApproveService.updateEmrApplyApprove(list.get(0));
}else{
//是180的倍数或最后一个
if((list.size()%simpleInsertCount == 0 || i == commomtables.size() - 1)){
applyApproveService.SimpleInsert(list);
}
}
}
sendPowerApproveInterface(applyApprove.getApplyType(), commomtables.size());
return ResultUtil.ok();
}
return ResultUtil.error("请至少选中一个!");
}
//推送给权限系统下发审批人通知
private void sendPowerApproveInterface(String applyType,Integer count) throws Exception{
//查询申请类型
List<Emr_Dictionary> dictionaryList = dictionaryMapper.selectDictionaryByTypeCode("apply_type");
String applyTypeName = "";
if(null != dictionaryList && !dictionaryList.isEmpty()){
for(Emr_Dictionary dictionary : dictionaryList){
if(dictionary.getCode().equals(applyType)){
applyTypeName = dictionary.getName();
break;
}
}
}
//发送通知
applyApproveService.sendNotice(applyTypeName,count);
}
@RequestMapping("getRecordListByInpatientNo") @RequestMapping("getRecordListByInpatientNo")
@ResponseBody @ResponseBody
public String getRecordListByInpatientNo(Integer page, Integer limit,String inpatientNo){ public String getRecordListByInpatientNo(Integer page, Integer limit,String inpatientNo){
@ -137,7 +321,32 @@ public class FontShowRecordController {
} }
/** /**
* *
* @param patientId
* @param model
* @param request
* @return
*/
@RequestMapping("showRecordFontSouth")
public String showRecordFontSouth(String patientId, Model model, HttpServletRequest request) {
model.addAttribute("patientId", patientId);
try {
List<EmrPrintOrDownLoadInfoVo> printCount = printOrDownLoadInfoService.getPrintCount(patientId);
if (null != printCount && !printCount.isEmpty()) {
model.addAttribute("printCount", 1);
}
String userName = (String)request.getSession().getAttribute("userName");
Emr_Log emrLog = new Emr_Log();
emrLog.setLogTitle("接口查看");
emrLog.setLogContent("接口预览页面");
} catch (Exception e) {
ExceptionPrintUtil.printException(e);
e.printStackTrace();
}
return "font/showRecordFontSouth";
}
/**
* pdfiframe * pdfiframe
* @param patientId * @param patientId
* @param model * @param model
@ -148,21 +357,24 @@ public class FontShowRecordController {
model.addAttribute("patientId", patientId); model.addAttribute("patientId", patientId);
//查询是否有打印权限 //查询是否有打印权限
int printFlag = 0; int printFlag = 0;
/*Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
Set<String> menus = user.getMenus();
for (String menu : menus) {
if (StringUtils.isNotBlank(menu)) {
if ("/commom/printPdf".equals(menu)) {
printFlag = 1;
break;
}
}
}*/
model.addAttribute("printFlag", printFlag); model.addAttribute("printFlag", printFlag);
model.addAttribute("flag", flag); model.addAttribute("flag", flag);
return "font/showRecordIframeFont"; return "font/showRecordIframeFont";
} }
@RequestMapping("showRecordIframeFontSouth")
public String showRecordIframeFontSouth(String patientId, String flag,Model model, HttpServletRequest request) {
model.addAttribute("patientId", patientId);
//查询是否有打印权限
int printFlag = 0;
model.addAttribute("printFlag", printFlag);
model.addAttribute("flag", flag);
model.addAttribute("userName", (String)request.getSession().getAttribute("userName"));
model.addAttribute("deptName", (String)request.getSession().getAttribute("deptName"));
return "font/showRecordIframeFontSouth";
}
/** /**
* *
* @param patientId * @param patientId
@ -275,4 +487,41 @@ public class FontShowRecordController {
model.addAttribute("httpFilePath",httpFilePath); model.addAttribute("httpFilePath",httpFilePath);
return "font/showPdfFrameFont"; return "font/showPdfFrameFont";
} }
/**
* PDF
* @param patientId
* @param scanPages
* @param sources
* @param flag
* @param model
* @param request
* @return
*/
@RequestMapping(value = "showRecordContentSouthFont")
public String showRecordContentSouthFont(String patientId, String scanPages, String sources, String flag,Model model, HttpServletRequest request){
String pdfTempRoot = "pdfTemp";
//临时保存pdf的文件目录
String fileOutRoot = WATERPICPATH + pdfTempRoot;
//目录不存在则创建
if(!new File(fileOutRoot).isDirectory()){
new File(fileOutRoot).mkdirs();
}
//文件相对路径
String filePath = pdfTempRoot + "\\" + UUID.randomUUID() + ".pdf";
//组织暂存pdf文件路径
String fileOutPath = WATERPICPATH + filePath;
//组织前台访问临时pdf路径
String httpFilePath = EMRRECORDJSP + "\\reload\\" + filePath;
String userName = (String)request.getSession().getAttribute("userName");
String deptName = (String)request.getSession().getAttribute("deptName");
try {
commomService.showRecordContentSouthFont(patientId,userName,deptName,scanPages,sources,flag,fileOutPath);
} catch (Exception e) {
ExceptionPrintUtil.printException(e);
e.printStackTrace();
}
model.addAttribute("httpFilePath",httpFilePath);
return "font/showPdfFrameFont";
}
} }

@ -6,10 +6,12 @@ import com.emr.dao.*;
import com.emr.dao.approve.Emr_Apply_ApproveMapper; import com.emr.dao.approve.Emr_Apply_ApproveMapper;
import com.emr.dao.tScanAssort.T_Scan_AssortMapper; import com.emr.dao.tScanAssort.T_Scan_AssortMapper;
import com.emr.entity.*; import com.emr.entity.*;
import com.emr.entity.emrLog.Emr_Log;
import com.emr.entity.recordType.Emr_Type; import com.emr.entity.recordType.Emr_Type;
import com.emr.entity.recordType.Emr_Type_Related; import com.emr.entity.recordType.Emr_Type_Related;
import com.emr.service.CommomService; import com.emr.service.CommomService;
import com.emr.service.Zd_AssortServiceImpl; import com.emr.service.Zd_AssortServiceImpl;
import com.emr.service.emrLog.LogService;
import com.emr.service.emrPrintOrDownLoadInfo.PrintOrDownLoadInfoService; import com.emr.service.emrPrintOrDownLoadInfo.PrintOrDownLoadInfoService;
import com.emr.service.recordType.EmrTypeRelatedService; import com.emr.service.recordType.EmrTypeRelatedService;
import com.emr.service.recordType.EmrTypeService; import com.emr.service.recordType.EmrTypeService;
@ -73,9 +75,12 @@ public class CommomSearchController {
private Zd_AssortMapper assortMapper; private Zd_AssortMapper assortMapper;
@Autowired @Autowired
private CommomService commomService; private CommomService commomService;
@Autowired
private LogService logService;
//祈福医院 //祈福医院
@RequiresPermissions("/commom/commomListqf") @RequiresPermissions("/commom/commomListqf")
@OptionalLog(module="查看", methods="常用查询页面") @OptionalLog(module = "查看", methods = "常用查询页面")
@RequestMapping("commomListqf") @RequestMapping("commomListqf")
public String commomListqf() { public String commomListqf() {
return "recordManage/commomSearch/commomListqf"; return "recordManage/commomSearch/commomListqf";
@ -84,12 +89,12 @@ public class CommomSearchController {
//加载性别 //加载性别
@RequestMapping("getSex") @RequestMapping("getSex")
@ResponseBody @ResponseBody
public String getSex(){ public String getSex() {
try { try {
//加载性别集合 //加载性别集合
List<Emr_Dictionary> sexList = dictionaryMapper.selectDictionaryByTypeCode("sex_code"); List<Emr_Dictionary> sexList = dictionaryMapper.selectDictionaryByTypeCode("sex_code");
return JSON.toJSONString(sexList); return JSON.toJSONString(sexList);
}catch (Exception e){ } catch (Exception e) {
ExceptionPrintUtil.printException(e); ExceptionPrintUtil.printException(e);
e.printStackTrace(); e.printStackTrace();
return null; return null;
@ -104,7 +109,7 @@ public class CommomSearchController {
//加载科室集合 //加载科室集合
List<Emr_Dictionary> deptList = dictionaryMapper.selectDictionaryByTypeCode("dept_code"); List<Emr_Dictionary> deptList = dictionaryMapper.selectDictionaryByTypeCode("dept_code");
return JSON.toJSONString(deptList); return JSON.toJSONString(deptList);
}catch (Exception e){ } catch (Exception e) {
ExceptionPrintUtil.printException(e); ExceptionPrintUtil.printException(e);
e.printStackTrace(); e.printStackTrace();
return null; return null;
@ -113,12 +118,13 @@ public class CommomSearchController {
/** /**
* id * id
*
* @param patientId * @param patientId
* @return * @return
*/ */
@RequestMapping("getCommomInfoById") @RequestMapping("getCommomInfoById")
@ResponseBody @ResponseBody
public String getCommomInfoById(String patientId){ public String getCommomInfoById(String patientId) {
try { try {
CommomVo commomVo = commomMapper.selectByPrimaryKey(patientId); CommomVo commomVo = commomMapper.selectByPrimaryKey(patientId);
return JSON.toJSONString(commomVo); return JSON.toJSONString(commomVo);
@ -131,6 +137,7 @@ public class CommomSearchController {
/** /**
* *
*
* @return * @return
*/ */
@RequestMapping("getCommonInfo") @RequestMapping("getCommonInfo")
@ -180,7 +187,9 @@ public class CommomSearchController {
} }
} }
/******************************病案预览操作****************************/ /******************************病案预览操作****************************/
/**174 /**
* 174
*
* @MethodName: showRecord174 * @MethodName: showRecord174
* @Description: * @Description:
* @Param String patientId:patientId * @Param String patientId:patientId
@ -215,14 +224,43 @@ public class CommomSearchController {
return "recordManage/commomSearch/showRecord174"; return "recordManage/commomSearch/showRecord174";
} }
@RequestMapping("showRecordSouth")
public String showRecordSouth(String patientId, String userName, String deptName ,Model model, HttpServletRequest request) {
model.addAttribute("patientId", patientId);
model.addAttribute("userName", userName);
model.addAttribute("deptName", deptName);
//加载登陆者
Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
if (null != user) {
model.addAttribute("user", user);
model.addAttribute("roleId", user.getRoleId());
}
List<EmrPrintOrDownLoadInfoVo> printCount = null;
try {
printCount = printOrDownLoadInfoService.getPrintCount(patientId);
} catch (Exception e) {
ExceptionPrintUtil.printException(e);
e.printStackTrace();
}
if (null != printCount && !printCount.isEmpty()) {
model.addAttribute("printCount", 1);
}
Emr_Log emrLog = new Emr_Log();
emrLog.setLogTitle("接口查看");
emrLog.setLogContent("接口预览页面");
logService.insertInterface(emrLog, userName);
return "recordManage/commomSearch/showRecordSouth";
}
//加载病案信息 //加载病案信息
@RequestMapping("getRecord") @RequestMapping("getRecord")
@ResponseBody @ResponseBody
public String getRecord(String patientId,String flag) { public String getRecord(String patientId, String flag) {
if (StringUtils.isNoneBlank(patientId)) { if (StringUtils.isNoneBlank(patientId)) {
try { try {
//根据patientId查询包含其他诊断的基本信息 //根据patientId查询包含其他诊断的基本信息
List<CommomVo> commomVos = commomMapper.selectOtherDiagByPatientId(patientId,flag); List<CommomVo> commomVos = commomMapper.selectOtherDiagByPatientId(patientId, flag);
return JSON.toJSONString(commomVos.get(0)); return JSON.toJSONString(commomVos.get(0));
} catch (Exception e) { } catch (Exception e) {
ExceptionPrintUtil.printException(e); ExceptionPrintUtil.printException(e);
@ -263,7 +301,7 @@ public class CommomSearchController {
*/ */
@RequestMapping("getAssortList") @RequestMapping("getAssortList")
@ResponseBody @ResponseBody
public ResultUtil getAssortList(HttpServletRequest request) throws Exception{ public ResultUtil getAssortList(HttpServletRequest request) throws Exception {
Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER"); Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
List<Zd_Assort> zdAssorts = new ArrayList<>(); List<Zd_Assort> zdAssorts = new ArrayList<>();
if (user.getRoleId() == 0 || user.getRoleId() == -100) { if (user.getRoleId() == 0 || user.getRoleId() == -100) {
@ -277,13 +315,14 @@ public class CommomSearchController {
/** /**
* *
* pdfiframe * pdfiframe
*
* @param patientId * @param patientId
* @param model * @param model
* @param request * @param request
* @return * @return
*/ */
@RequestMapping("showRecordIframeBlood") @RequestMapping("showRecordIframeBlood")
public String showRecordIframeBlood(String patientId,String flag,Model model, HttpServletRequest request) { public String showRecordIframeBlood(String patientId, String flag, Model model, HttpServletRequest request) {
model.addAttribute("patientId", patientId); model.addAttribute("patientId", patientId);
Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER"); Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
//打印分类集合 //打印分类集合
@ -304,21 +343,77 @@ public class CommomSearchController {
model.addAttribute("isDownload", isDownload); model.addAttribute("isDownload", isDownload);
//查询是否有打印权限 //查询是否有打印权限
int printFlag = 0; int printFlag = 0;
int moveFlag = 0;
Set<String> menus = user.getMenus(); Set<String> menus = user.getMenus();
for (String menu : menus) { for (String menu : menus) {
if (StringUtils.isNotBlank(menu)) { if (StringUtils.isNotBlank(menu)) {
if ("/commom/printPdf".equals(menu)) { if ("/commom/printPdf".equals(menu)) {
printFlag = 1; printFlag = 1;
break; }
if ("/commom/movePdf".equals(menu)) {
moveFlag = 1;
} }
} }
} }
model.addAttribute("moveFlag", moveFlag);
model.addAttribute("printFlag", printFlag); model.addAttribute("printFlag", printFlag);
model.addAttribute("flag", flag); model.addAttribute("flag", flag);
return "recordManage/commomSearch/showRecordIframeBlood"; return "recordManage/commomSearch/showRecordIframeBlood";
} }
/** /**
* 访
* @param userName
* @param flag
* @param model
* @param request
* @return
*/
@RequestMapping("showRecordIframeSouth")
public String showRecordIframeSouth(String patientId, String userName, String deptName, String flag, Model model, HttpServletRequest request) {
model.addAttribute("patientId", patientId);
model.addAttribute("userName", request.getSession().getAttribute("userName"));
model.addAttribute("deptName", request.getSession().getAttribute("deptName"));
Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
//打印分类集合
List<Emr_Type> emrTypes = null;
List<Zd_Assort> zdAssorts = null;
int isDownload = 0;
try {
emrTypes = emrTypeService.selectAllByCreater(1, request);
//病案分段集合
zdAssorts = assortService.selectAllByPower(user);
isDownload = apply_approveMapper.selectIsPowerByUser(user.getUserName(), patientId, 3);
} catch (Exception e) {
ExceptionPrintUtil.printException(e);
e.printStackTrace();
}
model.addAttribute("emrTypes", emrTypes);
model.addAttribute("zdAssorts", zdAssorts);
model.addAttribute("isDownload", isDownload);
//查询是否有打印权限
int printFlag = 0;
int moveFlag = 0;
Set<String> menus = user.getMenus();
for (String menu : menus) {
if (StringUtils.isNotBlank(menu)) {
if ("/commom/printPdf".equals(menu)) {
printFlag = 1;
}
if ("/commom/movePdf".equals(menu)) {
moveFlag = 1;
}
}
}
model.addAttribute("moveFlag", moveFlag);
model.addAttribute("printFlag", printFlag);
model.addAttribute("flag", flag);
return "recordManage/commomSearch/showRecordIframeSouth";
}
/**
*
*
* @MethodName: getOtherDiagNameByAdmissTimesAndInpatientNo * @MethodName: getOtherDiagNameByAdmissTimesAndInpatientNo
* @Description: admissTimesinpatientNo * @Description: admissTimesinpatientNo
* @Param Integer admissTimes:,String inpatientNo * @Param Integer admissTimes:,String inpatientNo
@ -332,7 +427,7 @@ public class CommomSearchController {
*/ */
@RequestMapping(value = "getOtherDiagNameByAdmissTimesAndInpatientNo", produces = {"text/json;charset=UTF-8"}) @RequestMapping(value = "getOtherDiagNameByAdmissTimesAndInpatientNo", produces = {"text/json;charset=UTF-8"})
@ResponseBody @ResponseBody
public String getOtherDiagNameByAdmissTimesAndInpatientNo(String name, Short admissTimes, String inpatientNo,String flag) { public String getOtherDiagNameByAdmissTimesAndInpatientNo(String name, Short admissTimes, String inpatientNo, String flag) {
if (StringUtils.isNoneBlank(name) && admissTimes != null && StringUtils.isNoneBlank(inpatientNo)) { if (StringUtils.isNoneBlank(name) && admissTimes != null && StringUtils.isNoneBlank(inpatientNo)) {
try { try {
//根据病案号住院次数姓名查询对应的patientId //根据病案号住院次数姓名查询对应的patientId
@ -348,7 +443,7 @@ public class CommomSearchController {
return "查询无该档案"; return "查询无该档案";
} }
if (StringUtils.isNoneBlank(patientId)) { if (StringUtils.isNoneBlank(patientId)) {
List<CommomVo> commomVos = commomMapper.selectOtherDiagByPatientId(patientId,flag); List<CommomVo> commomVos = commomMapper.selectOtherDiagByPatientId(patientId, flag);
if (null != commomVos && !commomVos.isEmpty()) { if (null != commomVos && !commomVos.isEmpty()) {
return JSON.toJSONString(commomVos.get(0)); return JSON.toJSONString(commomVos.get(0));
} else { } else {
@ -367,6 +462,7 @@ public class CommomSearchController {
/** /**
* *
*
* @param patientId * @param patientId
* @param typeId * @param typeId
* @param request * @param request
@ -488,6 +584,7 @@ public class CommomSearchController {
/** /**
* *
*
* @param patientId * @param patientId
* @param rootPaths * @param rootPaths
* @param names * @param names
@ -495,20 +592,41 @@ public class CommomSearchController {
* @return * @return
* @throws Exception * @throws Exception
*/ */
@RequestMapping(value="selectPrintPic",method = RequestMethod.POST) @RequestMapping(value = "selectPrintPic", method = RequestMethod.POST)
@ResponseBody @ResponseBody
public ResultUtil selectPrintPic(String patientId,String rootPaths,String names,String sources,HttpServletRequest request) throws Exception{ public ResultUtil selectPrintPic(HttpServletResponse response, String patientId, String rootPaths, String names, String sources, HttpServletRequest request) throws Exception {
//生成加载进度mapKey //生成加载进度mapKey
Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER"); Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
String mapKey = user.getUserName() + "_" + patientId; String mapKey = user.getUserName() + "_" + patientId;
List<String> outs = commomService.selectPrintPic(patientId,rootPaths,names,sources,mapKey); List<String> outs = commomService.selectPrintPic(response, patientId, rootPaths, names, sources, mapKey);
return ResultUtil.ok(outs); return ResultUtil.ok(outs);
} }
/**
*
*
* @param patientId
* @param rootPaths
* @param names
* @param sources
* @return
* @throws Exception
*/
@RequestMapping(value = "selectPrintPicTh", method = RequestMethod.POST)
@ResponseBody
public ResultUtil selectPrintPicTh(String patientId, String rootPaths, String names, String sources, HttpServletRequest request) throws Exception {
//生成加载进度mapKey
Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
String mapKey = user.getUserName() + "_" + patientId;
List<String> outs = commomService.selectPrintPicTh(patientId, rootPaths, names, sources, mapKey);
return ResultUtil.ok(outs);
}
@RequestMapping("getPrintPicLoading") @RequestMapping("getPrintPicLoading")
@ResponseBody @ResponseBody
public ResultUtil getPrintPicLoading(String patientId,HttpServletRequest request) throws Exception{ public ResultUtil getPrintPicLoading(String patientId, HttpServletRequest request) throws Exception {
Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER"); Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
String mapKey = user.getUserName() + "_" + patientId; String mapKey = user.getUserName() + "_" + patientId;
Integer loadingInteger = commomService.getPrintPicLoading(mapKey); Integer loadingInteger = commomService.getPrintPicLoading(mapKey);
return ResultUtil.ok(loadingInteger); return ResultUtil.ok(loadingInteger);
@ -516,6 +634,7 @@ public class CommomSearchController {
/** /**
* pdf * pdf
*
* @param patientId * @param patientId
* @param scanPages * @param scanPages
* @param sources * @param sources
@ -524,16 +643,40 @@ public class CommomSearchController {
*/ */
@RequestMapping(value = "showRecordContentBlood") @RequestMapping(value = "showRecordContentBlood")
@ResponseBody @ResponseBody
public void showRecordContentBlood(String patientId,String scanPages, String sources,String flag,HttpServletResponse response) { public void showRecordContentBlood(String patientId, String scanPages, String sources, String flag, HttpServletResponse response) {
try { try {
commomService.showRecordContentBlood(patientId,scanPages,sources,flag,response); commomService.showRecordContentBlood(patientId, scanPages, sources, flag, response);
} catch (Exception e) { } catch (Exception e) {
ExceptionPrintUtil.printException(e); ExceptionPrintUtil.printException(e);
e.printStackTrace(); e.printStackTrace();
} }
} }
/** /**
* 访
* @param patientId
* @param userName
* @param scanPages
* @param sources
* @param flag
* @param response
*/
@RequestMapping(value = "showRecordContentSouth")
@ResponseBody
public void showRecordContentSouth(String patientId, String userName, String deptName, String scanPages, String sources, String flag, HttpServletResponse response, HttpServletRequest request) {
try {
userName = (String)request.getSession().getAttribute("userName");
deptName = (String)request.getSession().getAttribute("deptName");
commomService.showRecordContentSouth(patientId, userName, deptName, scanPages, sources, flag, response);
} catch (Exception e) {
ExceptionPrintUtil.printException(e);
e.printStackTrace();
}
}
/**
*
*
* @MethodName: updateScanAssortByBlood * @MethodName: updateScanAssortByBlood
* @Description: * @Description:
* @Param String patientId,String assortIds:,newAssortIdid * @Param String patientId,String assortIds:,newAssortIdid
@ -546,21 +689,21 @@ public class CommomSearchController {
* @Version: 1.0 * @Version: 1.0
*/ */
@RequiresPermissions("/commom/updateScanAssort") @RequiresPermissions("/commom/updateScanAssort")
@OptionalLog(module = "修改", methods = "档案预览页面病案图片重新分类",fieldName = "name",tableName = "commomtable") @OptionalLog(module = "修改", methods = "档案预览页面病案图片重新分类", fieldName = "name", tableName = "commomtable")
@RequestMapping(value = "updateScanAssortByBlood", method = RequestMethod.POST) @RequestMapping(value = "updateScanAssortByBlood", method = RequestMethod.POST)
@ResponseBody @ResponseBody
public ResultUtil updateScanAssortByBlood(CommomVo commomVo,String assortIds, String newAssortId) throws Exception{ public ResultUtil updateScanAssortByBlood(CommomVo commomVo, String assortIds, String newAssortId) throws Exception {
if (StringUtils.isNoneBlank(commomVo.getPatientId()) && StringUtils.isNoneBlank(assortIds) && StringUtils.isNoneBlank(newAssortId)) { if (StringUtils.isNoneBlank(commomVo.getPatientId()) && StringUtils.isNoneBlank(assortIds) && StringUtils.isNoneBlank(newAssortId)) {
//根据patientIdadmissIds(scanPage分类图片集合)批量更新分段id assrotdId //根据patientIdadmissIds(scanPage分类图片集合)批量更新分段id assrotdId
//组织picNames //组织picNames
StringBuilder picNameStr = new StringBuilder(); StringBuilder picNameStr = new StringBuilder();
String[] picNames = assortIds.split(","); String[] picNames = assortIds.split(",");
for(String picName : picNames){ for (String picName : picNames) {
if(StringUtils.isNotBlank(picName)){ if (StringUtils.isNotBlank(picName)) {
picNameStr.append("'").append(picName).append("',"); picNameStr.append("'").append(picName).append("',");
} }
} }
picNameStr = new StringBuilder(picNameStr.substring(0,picNameStr.length()-1)); picNameStr = new StringBuilder(picNameStr.substring(0, picNameStr.length() - 1));
//批量更新 //批量更新
scanAssortService.SimpleUpdateByPatientIdAndScanPages(commomVo.getPatientId(), newAssortId, picNameStr.toString()); scanAssortService.SimpleUpdateByPatientIdAndScanPages(commomVo.getPatientId(), newAssortId, picNameStr.toString());
return ResultUtil.ok(); return ResultUtil.ok();
@ -573,9 +716,9 @@ public class CommomSearchController {
@RequiresPermissions("/commom/updatePic") @RequiresPermissions("/commom/updatePic")
@RequestMapping(value = "updatePic", method = RequestMethod.POST) @RequestMapping(value = "updatePic", method = RequestMethod.POST)
@ResponseBody @ResponseBody
public ResultUtil updatePic(CommomVo commomVo,@RequestParam(required = false, value = "files") MultipartFile[] files,String assortId) throws Exception{ public ResultUtil updatePic(CommomVo commomVo, @RequestParam(required = false, value = "files") MultipartFile[] files, String assortId) throws Exception {
ResultUtil resultUtil = commomService.updatePic(files, commomVo.getPatientId(), assortId); ResultUtil resultUtil = commomService.updatePic(files, commomVo.getPatientId(), assortId);
if(!resultUtil.getCode().equals(0)){ if (!resultUtil.getCode().equals(0)) {
return resultUtil; return resultUtil;
} }
return ResultUtil.ok(); return ResultUtil.ok();
@ -594,10 +737,10 @@ public class CommomSearchController {
* @Version: 1.0 * @Version: 1.0
*/ */
@RequiresPermissions("/commom/delScanAssort") @RequiresPermissions("/commom/delScanAssort")
@OptionalLog(module = "删除", methods = "档案预览页面删除病案图片",fieldName = "name",tableName = "commomtable") @OptionalLog(module = "删除", methods = "档案预览页面删除病案图片", fieldName = "name", tableName = "commomtable")
@RequestMapping(value = "delScanAssortByBlood", method = RequestMethod.POST) @RequestMapping(value = "delScanAssortByBlood", method = RequestMethod.POST)
@ResponseBody @ResponseBody
public ResultUtil delScanAssortByBlood(String patientId) throws Exception{ public ResultUtil delScanAssortByBlood(String patientId) throws Exception {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String assortIds = request.getParameter("assortIds"); String assortIds = request.getParameter("assortIds");
if (StringUtils.isNoneBlank(patientId) && StringUtils.isNoneBlank(assortIds)) { if (StringUtils.isNoneBlank(patientId) && StringUtils.isNoneBlank(assortIds)) {
@ -622,11 +765,11 @@ public class CommomSearchController {
*/ */
@RequestMapping("selectDeledPicRecordTree") @RequestMapping("selectDeledPicRecordTree")
@ResponseBody @ResponseBody
public List<ScanDeledAssortTree> selectDeledPicRecordTree(String patientId,String flag) { public List<ScanDeledAssortTree> selectDeledPicRecordTree(String patientId, String flag) {
List<ScanDeledAssortTree> treeList = new ArrayList<>(); List<ScanDeledAssortTree> treeList = new ArrayList<>();
//根据patientId查询已删除图片集合 //根据patientId查询已删除图片集合
try { try {
List<ScanAssortVo> scanAssortVos = scanAssortMapper.selectDeledPicList(patientId,flag); List<ScanAssortVo> scanAssortVos = scanAssortMapper.selectDeledPicList(patientId, flag);
//第一级:全部影像资料 //第一级:全部影像资料
ScanDeledAssortTree tree1 = new ScanDeledAssortTree(); ScanDeledAssortTree tree1 = new ScanDeledAssortTree();
Integer id = 1; Integer id = 1;
@ -688,6 +831,7 @@ public class CommomSearchController {
} }
return treeList; return treeList;
} }
/** /**
* @MethodName: getDeledPicRecordTree * @MethodName: getDeledPicRecordTree
* @Description: * @Description:
@ -702,30 +846,31 @@ public class CommomSearchController {
*/ */
@OptionalLog(module = "修改", methods = "恢复已删除图片", fieldName = "name", tableName = "commomtable") @OptionalLog(module = "修改", methods = "恢复已删除图片", fieldName = "name", tableName = "commomtable")
@RequiresPermissions("/commom/recoverPic") @RequiresPermissions("/commom/recoverPic")
@RequestMapping(value="recoverPic",method = RequestMethod.POST) @RequestMapping(value = "recoverPic", method = RequestMethod.POST)
@ResponseBody @ResponseBody
public ResultUtil recoverPic(CommomVo commomVo,String scanPages) throws Exception{ public ResultUtil recoverPic(CommomVo commomVo, String scanPages) throws Exception {
scanAssortService.recoverPic(commomVo.getPatientId(),scanPages); scanAssortService.recoverPic(commomVo.getPatientId(), scanPages);
return ResultUtil.ok(); return ResultUtil.ok();
} }
/**************************恢复已删除图片结束***********************/ /**************************恢复已删除图片结束***********************/
/**************************病案维护开始*****************************/ /**************************病案维护开始*****************************/
/** /**
* *
*
* @param commomVo * @param commomVo
* @return * @return
* @throws Exception * @throws Exception
*/ */
@RequiresPermissions("/commom/updateCommomInfo") @RequiresPermissions("/commom/updateCommomInfo")
@OptionalLog(module = "保存",methods = "病案信息修改") @OptionalLog(module = "保存", methods = "病案信息修改")
@RequestMapping("updateCommomInfo") @RequestMapping("updateCommomInfo")
@ResponseBody @ResponseBody
public ResultUtil updateCommomInfo(CommomVo commomVo) throws Exception{ public ResultUtil updateCommomInfo(CommomVo commomVo) throws Exception {
if (null != commomVo.getInpatientNo()){ if (null != commomVo.getInpatientNo()) {
int vo = commomMapper.selectCountByPatients(commomVo.getPatientId()); int vo = commomMapper.selectCountByPatients(commomVo.getPatientId());
if (vo > 0){ if (vo > 0) {
int i = commomMapper.updateByPrimaryKeySelective(commomVo); int i = commomMapper.updateByPrimaryKeySelective(commomVo);
if (i > 0){ if (i > 0) {
return ResultUtil.ok(); return ResultUtil.ok();
} else { } else {
return ResultUtil.error("修改失败!"); return ResultUtil.error("修改失败!");
@ -778,7 +923,9 @@ public class CommomSearchController {
} }
} }
/**getOperateCodeContents /**
* getOperateCodeContents
*
* @MethodName: * @MethodName:
* @Description: * @Description:
* @Param * @Param
@ -830,7 +977,7 @@ public class CommomSearchController {
*/ */
@RequestMapping(value = "getDictionaryByTypeCode", produces = {"text/json;charset=UTF-8"}) @RequestMapping(value = "getDictionaryByTypeCode", produces = {"text/json;charset=UTF-8"})
@ResponseBody @ResponseBody
public String getDictionaryByTypeCode(String typeCode) throws Exception{ public String getDictionaryByTypeCode(String typeCode) throws Exception {
List<Emr_Dictionary> dictionaries = dictionaryMapper.selectDictionaryByTypeCode(typeCode); List<Emr_Dictionary> dictionaries = dictionaryMapper.selectDictionaryByTypeCode(typeCode);
return JSON.toJSONString(dictionaries); return JSON.toJSONString(dictionaries);
} }
@ -849,7 +996,7 @@ public class CommomSearchController {
*/ */
@RequestMapping(value = "getIcdCodeList", produces = {"text/json;charset=UTF-8"}) @RequestMapping(value = "getIcdCodeList", produces = {"text/json;charset=UTF-8"})
@ResponseBody @ResponseBody
public String getIcdCodeList() throws Exception{ public String getIcdCodeList() throws Exception {
List<Zd_Icd_Code> icdCodes = icdCodeMapper.selectAll(null, null); List<Zd_Icd_Code> icdCodes = icdCodeMapper.selectAll(null, null);
return JSON.toJSONString(icdCodes); return JSON.toJSONString(icdCodes);
} }

@ -11,6 +11,7 @@ import com.emr.entity.Power_User;
import com.emr.entity.ResultUtil; import com.emr.entity.ResultUtil;
import com.emr.entity.approve.Emr_Apply_Approve; import com.emr.entity.approve.Emr_Apply_Approve;
import com.emr.entity.emrReasonAnnoModel.Emr_Reason_Anno_Model; import com.emr.entity.emrReasonAnnoModel.Emr_Reason_Anno_Model;
import com.emr.service.CommomService;
import com.emr.service.ImportExcel.ImportExcelEntity; import com.emr.service.ImportExcel.ImportExcelEntity;
import com.emr.service.ImportExcel.ImportExcelUtil; import com.emr.service.ImportExcel.ImportExcelUtil;
import com.emr.service.approve.ApplyApproveService; import com.emr.service.approve.ApplyApproveService;
@ -19,11 +20,13 @@ import com.emr.util.ConvertToSelectJson;
import com.emr.util.DateUtils; import com.emr.util.DateUtils;
import com.emr.util.ExceptionPrintUtil; import com.emr.util.ExceptionPrintUtil;
import com.emr.util.ExportExcelUtil; import com.emr.util.ExportExcelUtil;
import com.emr.vo.User;
import com.emr.vo.commomSearch.CommomVo; import com.emr.vo.commomSearch.CommomVo;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.util.CollectionUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@ -74,6 +77,8 @@ public class ApproveController {
private Emr_Apply_ApproveMapper applyApproveMapper; private Emr_Apply_ApproveMapper applyApproveMapper;
@Value("${POWER_URLHEAD}") @Value("${POWER_URLHEAD}")
private String POWER_URLHEAD; private String POWER_URLHEAD;
@Autowired
private CommomService commomService;
/** /**
* @MethodName: approveListByAppleStatus * @MethodName: approveListByAppleStatus
* @Description: * @Description:
@ -448,6 +453,18 @@ public class ApproveController {
obj.setAddOper(addOper); obj.setAddOper(addOper);
obj.setUpdateOper(updateOper); obj.setUpdateOper(updateOper);
obj.setDeleteOper(deleteOper); obj.setDeleteOper(deleteOper);
//转换用户名
List<User> userList = commomService.getUserList(user.getUserName(), request);
//获取申请者工号
String applyer = obj.getApplyer();
if(!CollectionUtils.isEmpty(userList)){
for(User user1 : userList){
String name = user1.getName();
if(StringUtils.isNotBlank(applyer) && user1.getUserName().equals(applyer)){
obj.setApplyer(name);
}
}
}
} }
} }
} }
@ -643,6 +660,23 @@ public class ApproveController {
} }
for (Emr_Apply_Approve obj : approves){ for (Emr_Apply_Approve obj : approves){
obj.setUpdateOper(updateOper); obj.setUpdateOper(updateOper);
//转换用户名
List<User> userList = commomService.getUserList(user.getUserName(), request);
//获取申请者工号
String applyer = obj.getApplyer();
//获取审批者工号
String approver = obj.getApprover();
if(!CollectionUtils.isEmpty(userList)){
for(User user1 : userList){
String name = user1.getName();
if(StringUtils.isNotBlank(applyer) && user1.getUserName().equals(applyer)){
obj.setApplyer(name);
}
if(StringUtils.isNotBlank(approver) && user1.getUserName().equals(approver)){
obj.setApprover(name);
}
}
}
} }
} }
} }

@ -64,6 +64,17 @@ public class BackDatabaseController {
return "otherManage/backupDatabase"; return "otherManage/backupDatabase";
} }
/**
*
* @return
*/
@RequiresPermissions("/otherManage/interfaceDatabase")
@RequestMapping("interfaceDatabase")
public String interfaceDatabase(){
return "otherManage/interfaceDatabase";
}
/** /**
* @MethodName getLogList * @MethodName getLogList
* @Description: * @Description:
@ -111,6 +122,51 @@ public class BackDatabaseController {
} }
} }
/**
*
* @param page
* @param limit
* @param log
* @param startTime
* @param endTime
* @param request
* @return
*/
@RequestMapping("getLogListIf")
@ResponseBody
public String getLogListIf(Integer page, Integer limit, Emr_Log log, String startTime, String endTime, HttpServletRequest request){
if(null != page && null != limit){
PageHelper.startPage(page, limit);
}
try{
List<Emr_Log> logs = logMapper.selectAllByFont(log, startTime, endTime);
//匹配权限
Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
Set<String> menus = user.getMenus();
if(null != logs && !logs.isEmpty()){
if(null != menus && !menus.isEmpty()){
int deleteOper = 0;
for(String menu : menus){
if(StringUtils.isNotBlank(menu)){
if("/otherManage/deleteLogById".equals(menu)){
deleteOper = 1;
}
}
}
for (Emr_Log obj : logs){
obj.setDeleteOper(deleteOper);
}
}
}
PageInfo pageInfo = new PageInfo<>(logs);
return JSON.toJSONString(pageInfo);
}catch (Exception e){
ExceptionPrintUtil.printException(e);
e.printStackTrace();
return null;
}
}
/** /**
* @MethodName deleteLogById * @MethodName deleteLogById
* @Description: id * @Description: id

@ -3,6 +3,7 @@ package com.emr.controller.otherManage;
import com.emr.annotation.OptionalLog; import com.emr.annotation.OptionalLog;
import com.emr.dao.CommomMapper; import com.emr.dao.CommomMapper;
import com.emr.dao.approve.Emr_Apply_ApproveMapper; import com.emr.dao.approve.Emr_Apply_ApproveMapper;
import com.emr.dao.commomSearch.ScanPathMapper;
import com.emr.dao.emrPrintAndDownLoad.EmrPrintDownloadInfoMapper; import com.emr.dao.emrPrintAndDownLoad.EmrPrintDownloadInfoMapper;
import com.emr.dao.recordLock.Emr_LockMapper; import com.emr.dao.recordLock.Emr_LockMapper;
import com.emr.entity.approve.Emr_Apply_Approve; import com.emr.entity.approve.Emr_Apply_Approve;
@ -36,6 +37,8 @@ public class monitoringCenterController {
private CommomMapper commomMapper; private CommomMapper commomMapper;
@Autowired @Autowired
private Emr_LockMapper emrLockMapper; private Emr_LockMapper emrLockMapper;
@Autowired
private ScanPathMapper scanPathMapper;
/** /**
* *
* @return * @return
@ -44,14 +47,23 @@ public class monitoringCenterController {
@RequiresPermissions("/monitoringCenter/select") @RequiresPermissions("/monitoringCenter/select")
@RequestMapping("monitoringCenterList") @RequestMapping("monitoringCenterList")
public String monitoringCenter(Model model){ public String monitoringCenter(Model model){
//正在调阅的数量
int applyApproveNum = 0; int applyApproveNum = 0;
//待批病案数
int applyApproveNullNum = 0; int applyApproveNullNum = 0;
EmrPrintOrDownLoadInfoVo vo = new EmrPrintOrDownLoadInfoVo(); EmrPrintOrDownLoadInfoVo vo = new EmrPrintOrDownLoadInfoVo();
vo.setOperType(Short.valueOf("2")); vo.setOperType(Short.valueOf("2"));
List<EmrPrintOrDownLoadInfoVo> emrPrintOrDownLoadInfoVos = null; List<EmrPrintOrDownLoadInfoVo> emrPrintOrDownLoadInfoVos = null;
//数字病案库存数量
int commomNum = 0; int commomNum = 0;
//病案锁定数
int lockNum = 0; int lockNum = 0;
//病案总盘数
int phCount = 0;
//病案图像总数
int pdfCount = 0;
try { try {
//下载量
emrPrintOrDownLoadInfoVos = emrPrintDownloadInfoMapper.selectAll(vo); emrPrintOrDownLoadInfoVos = emrPrintDownloadInfoMapper.selectAll(vo);
commomNum = commomMapper.selectCommomCount(); commomNum = commomMapper.selectCommomCount();
lockNum = emrLockMapper.selectCountLocking(); lockNum = emrLockMapper.selectCountLocking();
@ -72,6 +84,15 @@ public class monitoringCenterController {
applyApproveNullNum += 1; applyApproveNullNum += 1;
} }
} }
//查询总盘数
List<Integer> phNums = scanPathMapper.selectCountPh();
for (Integer phNum : phNums) {
if (0 != phNum) {
phCount += 1;
}
}
//查询图像总数
pdfCount = scanPathMapper.selectCountPdf();
} catch (ParseException e) { } catch (ParseException e) {
ExceptionPrintUtil.printException(e); ExceptionPrintUtil.printException(e);
e.printStackTrace(); e.printStackTrace();
@ -81,6 +102,8 @@ public class monitoringCenterController {
model.addAttribute("emrDownloadInfoNum", emrPrintOrDownLoadInfoVos.size()); model.addAttribute("emrDownloadInfoNum", emrPrintOrDownLoadInfoVos.size());
model.addAttribute("commomNum", commomNum); model.addAttribute("commomNum", commomNum);
model.addAttribute("lockNum", lockNum); model.addAttribute("lockNum", lockNum);
model.addAttribute("phCount", phCount);
model.addAttribute("pdfCount", pdfCount);
return "otherManage/monitoringCenter"; return "otherManage/monitoringCenter";
} }
} }

@ -72,4 +72,12 @@ public interface Emr_Apply_ApproveMapper {
* @return * @return
*/ */
List<Emr_Apply_Approve> selectCountByApproveStateIsNull(); List<Emr_Apply_Approve> selectCountByApproveStateIsNull();
/**
*
* @param userName
* @param patientId
* @return
*/
Emr_Apply_Approve selectByApplyerAndPatientId(@Param("userName")String userName,@Param("patientId")String patientId);
} }

@ -8,9 +8,27 @@ import java.util.List;
public interface ScanPathMapper { public interface ScanPathMapper {
/** /**
* patientIdid * patientIdid
* */ */
List<ScanPathVo> selectScanFileByPatientIds(@Param("patientIds")String patientIds,@Param("assortIds")String assortIds); List<ScanPathVo> selectScanFileByPatientIds(@Param("patientIds") String patientIds, @Param("assortIds") String assortIds);
List<ScanPathVo> selectScanFileByBloodPatientIds(@Param("patientIds")String patientIds, List<ScanPathVo> selectScanFileByBloodPatientIds(@Param("patientIds") String patientIds,
@Param("assortIds")String assortIds,@Param("flag")String flag); @Param("assortIds") String assortIds, @Param("flag") String flag);
/**
*
* @param sql
*/
void updateScanFileByPatientIdAndScanPage(@Param("sql") String sql);
/**
*
* @return
*/
List<Integer> selectCountPh();
/**
*
* @return
*/
Integer selectCountPdf();
} }

@ -29,4 +29,6 @@ public interface Emr_LogMapper {
List<Emr_Log> selectAllByIds(@Param("checks")String checks); List<Emr_Log> selectAllByIds(@Param("checks")String checks);
void deleteLogByIds(@Param("str")String str); void deleteLogByIds(@Param("str")String str);
List<Emr_Log> selectAllByFont(@Param("record")Emr_Log record,@Param("startTime") String startTime,@Param("endTime") String endTime);
} }

@ -24,11 +24,14 @@ import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.File; import java.io.*;
import java.net.InetAddress;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.List;
/** /**
* @ProjectName: * @ProjectName:
@ -45,13 +48,15 @@ import java.util.*;
@Component @Component
public class CommomService { public class CommomService {
//定义打印预览加载进度map //定义打印预览加载进度map
private static Map<String,Integer> printLoadingMap = new HashMap<>(); private static Map<String, Integer> printLoadingMap = new HashMap<>();
@Value("${POWER_URLHEAD}") @Value("${POWER_URLHEAD}")
private String POWER_URLHEAD; private String POWER_URLHEAD;
@Value("${waterPicPath}") @Value("${waterPicPath}")
private String WATERPICPATH; private String WATERPICPATH;
@Value("${EMR_RECORD_JSP}") @Value("${EMR_RECORD_JSP}")
private String EMRRECORDJSP; private String EMRRECORDJSP;
@Value("${waterTifToJpgPath}")
private String WATERTIFTOJPGPATH;
@Autowired @Autowired
private CommomMapper commomMapper; private CommomMapper commomMapper;
@Autowired @Autowired
@ -60,69 +65,72 @@ public class CommomService {
private T_Scan_AssortService scanAssortService; private T_Scan_AssortService scanAssortService;
@Autowired @Autowired
private EmrPdfWaterSetMapper pdfWaterSetMapper; private EmrPdfWaterSetMapper pdfWaterSetMapper;
//获取所属医院用户名集合 //获取所属医院用户名集合
public static StringBuilder creaters(HttpServletRequest request){ public static StringBuilder creaters(HttpServletRequest request) {
List<User> userList = (List<User>)request.getSession().getAttribute("USER_LIST"); List<User> userList = (List<User>) request.getSession().getAttribute("USER_LIST");
StringBuilder creaters = new StringBuilder(); StringBuilder creaters = new StringBuilder();
for (int i = 0; i < userList.size(); i++) { for (int i = 0; i < userList.size(); i++) {
if(userList.get(i).getRoleId() != 0){ if (userList.get(i).getRoleId() != 0) {
creaters.append("'"+userList.get(i).getUserName()+ "',"); creaters.append("'" + userList.get(i).getUserName() + "',");
} }
} }
if(StringUtils.isNotBlank(creaters)){ if (StringUtils.isNotBlank(creaters)) {
creaters = new StringBuilder(creaters.substring(0,creaters.length()-1)); creaters = new StringBuilder(creaters.substring(0, creaters.length() - 1));
} }
return creaters; return creaters;
} }
//获取所属医院用户id //获取所属医院用户id
public static String userIds(HttpServletRequest request){ public static String userIds(HttpServletRequest request) {
List<User> userList = (List<User>)request.getSession().getAttribute("USER_LIST"); List<User> userList = (List<User>) request.getSession().getAttribute("USER_LIST");
StringBuilder userIds = new StringBuilder(); StringBuilder userIds = new StringBuilder();
for (User user : userList) { for (User user : userList) {
if (user.getRoleId() != 0) { if (user.getRoleId() != 0) {
userIds.append("'").append(user.getUserId()).append("',"); userIds.append("'").append(user.getUserId()).append("',");
} }
} }
if(StringUtils.isNotBlank(userIds)){ if (StringUtils.isNotBlank(userIds)) {
userIds = new StringBuilder(userIds.substring(0,userIds.length()-1)); userIds = new StringBuilder(userIds.substring(0, userIds.length() - 1));
} }
return userIds.toString(); return userIds.toString();
} }
/** /**
* admin * admin
*
* @param userName * @param userName
* @param request * @param request
* @return * @return
*/ */
public List<User> getUserList(String userName,HttpServletRequest request) throws Exception{ public List<User> getUserList(String userName, HttpServletRequest request) throws Exception {
List<User> userList = new ArrayList<>(); List<User> userList = new ArrayList<>();
//查询缓存时候存在 //查询缓存时候存在
//调用接口查询 //调用接口查询
String resultString = ""; String resultString = "";
// 创建uri // 创建uri
String url = POWER_URLHEAD+"/font/getUserList?userName="+userName; String url = POWER_URLHEAD + "/font/getUserList?userName=" + userName;
// 执行请求 // 执行请求
CloseableHttpResponse response = HttpClients.createDefault().execute(new HttpGet(url)); CloseableHttpResponse response = HttpClients.createDefault().execute(new HttpGet(url));
// 判断返回状态是否为200 // 判断返回状态是否为200
if (response.getStatusLine().getStatusCode() == 200) { if (response.getStatusLine().getStatusCode() == 200) {
resultString = EntityUtils.toString(response.getEntity(), "UTF-8"); resultString = EntityUtils.toString(response.getEntity(), "UTF-8");
} }
if(StringUtils.isNoneBlank(resultString)) { if (StringUtils.isNoneBlank(resultString)) {
JSONObject jsonObject = JSON.parseObject(resultString); JSONObject jsonObject = JSON.parseObject(resultString);
String extend = jsonObject.getString("extend"); String extend = jsonObject.getString("extend");
JSONObject extendObject = JSONObject.parseObject(extend); JSONObject extendObject = JSONObject.parseObject(extend);
String userList1 = extendObject.getString("userList"); String userList1 = extendObject.getString("userList");
userList = (List<User>) JSON.parseArray(userList1, User.class); userList = (List<User>) JSON.parseArray(userList1, User.class);
} }
//设置进session //设置进session
request.getSession().setAttribute("USER_LIST",userList); request.getSession().setAttribute("USER_LIST", userList);
return userList; return userList;
} }
/** /**
* *
*
* @param files * @param files
* @param patientId * @param patientId
* @param assortId * @param assortId
@ -135,7 +143,7 @@ public class CommomService {
CommomVo commomVo = commomMapper.selectByPrimaryKey(patientId); CommomVo commomVo = commomMapper.selectByPrimaryKey(patientId);
ResultUtil resultUtil = selectRootPath(patientId, commomVo.getInpatientNo()); ResultUtil resultUtil = selectRootPath(patientId, commomVo.getInpatientNo());
if (resultUtil.getCode().equals(0)) { if (resultUtil.getCode().equals(0)) {
String path = resultUtil.getMsg(); String path = resultUtil.getMsg().replaceAll(" ", "");
//保存至commomtable表 //保存至commomtable表
commomVo.setNewPath(path); commomVo.setNewPath(path);
commomMapper.updateByPrimaryKeySelective(commomVo); commomMapper.updateByPrimaryKeySelective(commomVo);
@ -154,18 +162,65 @@ public class CommomService {
//脐血库显示pdf //脐血库显示pdf
public void showRecordContentBlood(String patientId, String scanPages, String sources, String flag, HttpServletResponse response) throws Exception{ public void showRecordContentBlood(String patientId, String scanPages, String sources, String flag, HttpServletResponse response) throws Exception {
String pdfName = "档案管理PDF";
if (StringUtils.isNotBlank(patientId)) {
patientId = patientId.replace("\'", "");
//查询
if (StringUtils.isNotBlank(flag)) {
CommomVo commomVo = commomMapper.selectByPrimaryKey(patientId);
//flag = home_addr取home_addr字段path_file取home_addr字段
String root1 = "";
if ("home_addr".equals(flag)) {
root1 = commomVo.getHomeAddr();
} else if ("file_path".equals(flag)) {
root1 = commomVo.getFilePath();
}
String root2 = commomVo.getNewPath();
//组织src
List<String> src = new LinkedList<>();
String[] scanPageArr = scanPages.split(",");
String[] sourceArr = sources.split(",");
for (int i = 0; i < scanPageArr.length; i++) {
String srcStr = "";
if (StringUtils.isNotBlank(scanPageArr[i])) {
if ("1".equals(sourceArr[i])) {
srcStr = root1 + "\\" + scanPageArr[i];
} else {
srcStr = root2 + "\\" + scanPageArr[i];
}
}
src.add(srcStr);
}
List<String> filePaths = new LinkedList<>();
for (String srcs : src) {
File file = new File(srcs);
if (file.isFile()) {
filePaths.add(srcs);
}
}
if (!filePaths.isEmpty()) {
//根据图片路径转换pdf
EmrPdfWaterSet emrPdfWaterSet = pdfWaterSetMapper.selectByPrimaryKey(1);
img2PdfUtil.imageToPdf(response, filePaths, pdfName, emrPdfWaterSet);
}
}
}
}
//南方医院显示图像
public void showRecordContentSouth(String patientId, String userName, String deptName, String scanPages, String sources, String flag, HttpServletResponse response) throws Exception {
String pdfName = "档案管理PDF"; String pdfName = "档案管理PDF";
if (StringUtils.isNotBlank(patientId)) { if (StringUtils.isNotBlank(patientId)) {
patientId = patientId.replace("\'", ""); patientId = patientId.replace("\'", "");
//查询 //查询
if(StringUtils.isNotBlank(flag)){ if (StringUtils.isNotBlank(flag)) {
CommomVo commomVo = commomMapper.selectByPrimaryKey(patientId); CommomVo commomVo = commomMapper.selectByPrimaryKey(patientId);
//flag = home_addr取home_addr字段path_file取home_addr字段 //flag = home_addr取home_addr字段path_file取home_addr字段
String root1 = ""; String root1 = "";
if("home_addr".equals(flag)){ if ("home_addr".equals(flag)) {
root1 = commomVo.getHomeAddr(); root1 = commomVo.getHomeAddr();
}else if("file_path".equals(flag)){ } else if ("file_path".equals(flag)) {
root1 = commomVo.getFilePath(); root1 = commomVo.getFilePath();
} }
String root2 = commomVo.getNewPath(); String root2 = commomVo.getNewPath();
@ -173,13 +228,13 @@ public class CommomService {
List<String> src = new LinkedList<>(); List<String> src = new LinkedList<>();
String[] scanPageArr = scanPages.split(","); String[] scanPageArr = scanPages.split(",");
String[] sourceArr = sources.split(","); String[] sourceArr = sources.split(",");
for(int i = 0;i < scanPageArr.length;i++){ for (int i = 0; i < scanPageArr.length; i++) {
String srcStr = ""; String srcStr = "";
if(StringUtils.isNotBlank(scanPageArr[i])){ if (StringUtils.isNotBlank(scanPageArr[i])) {
if("1".equals(sourceArr[i])){ if ("1".equals(sourceArr[i])) {
srcStr = root1 + "\\" + scanPageArr[i]; srcStr = root1 + "\\" + scanPageArr[i];
}else{ } else {
srcStr = root2 + "\\" + scanPageArr[i]; srcStr = root2 + "\\" + scanPageArr[i];
} }
} }
src.add(srcStr); src.add(srcStr);
@ -194,6 +249,12 @@ public class CommomService {
if (!filePaths.isEmpty()) { if (!filePaths.isEmpty()) {
//根据图片路径转换pdf //根据图片路径转换pdf
EmrPdfWaterSet emrPdfWaterSet = pdfWaterSetMapper.selectByPrimaryKey(1); EmrPdfWaterSet emrPdfWaterSet = pdfWaterSetMapper.selectByPrimaryKey(1);
InetAddress netAddress = InetAddress.getLocalHost();
String ip = null;
if (null != netAddress) {
ip = netAddress.getHostAddress();
}
emrPdfWaterSet.setText(userName + " " + ip);
img2PdfUtil.imageToPdf(response, filePaths, pdfName, emrPdfWaterSet); img2PdfUtil.imageToPdf(response, filePaths, pdfName, emrPdfWaterSet);
} }
} }
@ -201,17 +262,63 @@ public class CommomService {
} }
//接口显示pdf //接口显示pdf
public void showRecordContentBloodFont(String patientId, String scanPages, String sources, String flag,String fileOutPath) throws Exception{ public void showRecordContentBloodFont(String patientId, String scanPages, String sources, String flag, String fileOutPath) throws Exception {
if (StringUtils.isNotBlank(patientId)) {
patientId = patientId.replace("\'", "");
//查询
if (StringUtils.isNotBlank(flag)) {
CommomVo commomVo = commomMapper.selectByPrimaryKey(patientId);
//flag = home_addr取home_addr字段path_file取home_addr字段
String root1 = "";
if ("home_addr".equals(flag)) {
root1 = commomVo.getHomeAddr();
} else if ("file_path".equals(flag)) {
root1 = commomVo.getFilePath();
}
String root2 = commomVo.getNewPath();
//组织src
List<String> src = new LinkedList<>();
String[] scanPageArr = scanPages.split(",");
String[] sourceArr = sources.split(",");
for (int i = 0; i < scanPageArr.length; i++) {
String srcStr = "";
if (StringUtils.isNotBlank(scanPageArr[i])) {
if ("1".equals(sourceArr[i])) {
srcStr = root1 + "\\" + scanPageArr[i];
} else {
srcStr = root2 + "\\" + scanPageArr[i];
}
}
src.add(srcStr);
}
List<String> filePaths = new LinkedList<>();
for (String srcs : src) {
File file = new File(srcs);
if (file.isFile()) {
filePaths.add(srcs);
}
}
if (!CollectionUtils.isEmpty(filePaths)) {
//根据图片路径转换pdf
EmrPdfWaterSet emrPdfWaterSet = pdfWaterSetMapper.selectByPrimaryKey(1);
img2PdfUtil.imageToPdfFont(filePaths, emrPdfWaterSet, fileOutPath);
}
}
}
}
//接口显示pdf
public void showRecordContentSouthFont(String patientId, String userName, String deptName, String scanPages, String sources, String flag, String fileOutPath) throws Exception {
if (StringUtils.isNotBlank(patientId)) { if (StringUtils.isNotBlank(patientId)) {
patientId = patientId.replace("\'", ""); patientId = patientId.replace("\'", "");
//查询 //查询
if(StringUtils.isNotBlank(flag)){ if (StringUtils.isNotBlank(flag)) {
CommomVo commomVo = commomMapper.selectByPrimaryKey(patientId); CommomVo commomVo = commomMapper.selectByPrimaryKey(patientId);
//flag = home_addr取home_addr字段path_file取home_addr字段 //flag = home_addr取home_addr字段path_file取home_addr字段
String root1 = ""; String root1 = "";
if("home_addr".equals(flag)){ if ("home_addr".equals(flag)) {
root1 = commomVo.getHomeAddr(); root1 = commomVo.getHomeAddr();
}else if("file_path".equals(flag)){ } else if ("file_path".equals(flag)) {
root1 = commomVo.getFilePath(); root1 = commomVo.getFilePath();
} }
String root2 = commomVo.getNewPath(); String root2 = commomVo.getNewPath();
@ -219,13 +326,13 @@ public class CommomService {
List<String> src = new LinkedList<>(); List<String> src = new LinkedList<>();
String[] scanPageArr = scanPages.split(","); String[] scanPageArr = scanPages.split(",");
String[] sourceArr = sources.split(","); String[] sourceArr = sources.split(",");
for(int i = 0;i < scanPageArr.length;i++){ for (int i = 0; i < scanPageArr.length; i++) {
String srcStr = ""; String srcStr = "";
if(StringUtils.isNotBlank(scanPageArr[i])){ if (StringUtils.isNotBlank(scanPageArr[i])) {
if("1".equals(sourceArr[i])){ if ("1".equals(sourceArr[i])) {
srcStr = root1 + "\\" + scanPageArr[i]; srcStr = root1 + "\\" + scanPageArr[i];
}else{ } else {
srcStr = root2 + "\\" + scanPageArr[i]; srcStr = root2 + "\\" + scanPageArr[i];
} }
} }
src.add(srcStr); src.add(srcStr);
@ -240,17 +347,23 @@ public class CommomService {
if (!CollectionUtils.isEmpty(filePaths)) { if (!CollectionUtils.isEmpty(filePaths)) {
//根据图片路径转换pdf //根据图片路径转换pdf
EmrPdfWaterSet emrPdfWaterSet = pdfWaterSetMapper.selectByPrimaryKey(1); EmrPdfWaterSet emrPdfWaterSet = pdfWaterSetMapper.selectByPrimaryKey(1);
img2PdfUtil.imageToPdfFont(filePaths,emrPdfWaterSet,fileOutPath); InetAddress netAddress = InetAddress.getLocalHost();
String ip = null;
if (null != netAddress) {
ip = netAddress.getHostAddress();
}
emrPdfWaterSet.setText(userName + " " + ip);
img2PdfUtil.imageToPdfFont(filePaths, emrPdfWaterSet, fileOutPath);
} }
} }
} }
} }
//封装批量上传图片,返回上传图片记录 //封装批量上传图片,返回上传图片记录
private List<T_Scan_Assort> getScanAssortListByUpdatePic(List<MultipartFile> multipartFiles,String patientId,String assortId,String root) throws Exception{ private List<T_Scan_Assort> getScanAssortListByUpdatePic(List<MultipartFile> multipartFiles, String patientId, String assortId, String root) throws Exception {
List<T_Scan_Assort> scanAssorts = new ArrayList<>(); List<T_Scan_Assort> scanAssorts = new ArrayList<>();
//遍历分类图片集合 //遍历分类图片集合
for(MultipartFile pic : multipartFiles){ for (MultipartFile pic : multipartFiles) {
//定义对象 //定义对象
T_Scan_Assort scanAssort = new T_Scan_Assort(); T_Scan_Assort scanAssort = new T_Scan_Assort();
String picName = pic.getOriginalFilename(); String picName = pic.getOriginalFilename();
@ -272,11 +385,11 @@ public class CommomService {
} }
//封装组织新增图片根目录 //封装组织新增图片根目录
private ResultUtil selectRootPath(String patientId,String inpatientId){ private ResultUtil selectRootPath(String patientId, String inpatientId) {
//查询设置的根目录 //查询设置的根目录
EmrComomSet emrComomSet = commomSetService.selectByPrimaryKey(1); EmrComomSet emrComomSet = commomSetService.selectByPrimaryKey(1);
String newPicRoot = emrComomSet.getNewPicRoot(); String newPicRoot = emrComomSet.getNewPicRoot();
if(StringUtils.isBlank(newPicRoot)){ if (StringUtils.isBlank(newPicRoot)) {
return ResultUtil.error("目录未设置,请先前往参数设置页面设置图片存在根目录!"); return ResultUtil.error("目录未设置,请先前往参数设置页面设置图片存在根目录!");
} }
//组织存放目录 //组织存放目录
@ -284,6 +397,7 @@ public class CommomService {
//格式化年月 //格式化年月
SimpleDateFormat fmt1 = new SimpleDateFormat("yyyyMM"); SimpleDateFormat fmt1 = new SimpleDateFormat("yyyyMM");
String path = newPicRoot + "\\" + fmt1.format(new Date()) + "\\" + inpatientId + "-" + patientId; String path = newPicRoot + "\\" + fmt1.format(new Date()) + "\\" + inpatientId + "-" + patientId;
path = path.replaceAll(" ", "");
//该目录不存在,创建目录 //该目录不存在,创建目录
if (!new File(path).isDirectory()) { if (!new File(path).isDirectory()) {
new File(path).mkdirs(); new File(path).mkdirs();
@ -292,7 +406,7 @@ public class CommomService {
} }
//验证图片是否存在,存在重命名 //验证图片是否存在,存在重命名
private String getPicName(String root,String fullName,MultipartFile pic){ private String getPicName(String root, String fullName, MultipartFile pic) {
SimpleDateFormat fmt = new SimpleDateFormat("yyyyMMddHHmmssSSS"); SimpleDateFormat fmt = new SimpleDateFormat("yyyyMMddHHmmssSSS");
String src = root + "\\" + fullName; String src = root + "\\" + fullName;
File file = new File(src); File file = new File(src);
@ -309,15 +423,16 @@ public class CommomService {
/** /**
* *
*
* @param patientId * @param patientId
* @param rootPaths * @param rootPaths
* @param names * @param names
* @param sources * @param sources
* @return * @return
*/ */
public List<String> selectPrintPic(String patientId, String rootPaths, String names, String sources,String mapKey) { public List<String> selectPrintPic(HttpServletResponse response, String patientId, String rootPaths, String names, String sources, String mapKey) {
List<String> outs = new LinkedList<>(); List<String> outs = new LinkedList<>();
if(StringUtils.isNotBlank(names)){ if (StringUtils.isNotBlank(names)) {
String[] rootPathList = rootPaths.split(","); String[] rootPathList = rootPaths.split(",");
String[] nameList = names.split(","); String[] nameList = names.split(",");
String[] sourceList = sources.split(","); String[] sourceList = sources.split(",");
@ -327,14 +442,14 @@ public class CommomService {
Short printEffective = emrPdfWaterSet.getPrintEffective(); Short printEffective = emrPdfWaterSet.getPrintEffective();
//获取是否打印图片水印 //获取是否打印图片水印
Short printIsImg = emrPdfWaterSet.getPrintIsImg(); Short printIsImg = emrPdfWaterSet.getPrintIsImg();
for (int i = 0;i < nameList.length;i++) { for (int i = 0; i < nameList.length; i++) {
//定义图片根目录地址 //定义图片根目录地址
String rootPath = ""; String rootPath = "";
//组织原图片地址 //组织原图片地址
if("1".equals(sourceList[i])){ if ("1".equals(sourceList[i])) {
//扫描图片地址位于rootPathList第一个 //扫描图片地址位于rootPathList第一个
rootPath = rootPathList[0]; rootPath = rootPathList[0];
}else{ } else {
rootPath = rootPathList[1]; rootPath = rootPathList[1];
} }
//原图片地址 //原图片地址
@ -342,35 +457,175 @@ public class CommomService {
//定义输出地址 //定义输出地址
String outSrc = ""; String outSrc = "";
//获取项目上下文地址 //获取项目上下文地址
if((printEffective != null && printEffective == 1) || if ((printEffective != null && printEffective == 1) ||
(printIsImg != null && printIsImg == 1)){ (printIsImg != null && printIsImg == 1)) {
//需要水印 //需要水印
//组织加水印后图片存放目录 //组织加水印后图片存放目录
String waterPicRoot = WATERPICPATH + patientId +"\\" + sourceList[i] + "\\"; String waterPicRoot = WATERPICPATH + patientId + "\\" + sourceList[i] + "\\";
//目录不存在则创建 //目录不存在则创建
if(!new File(waterPicRoot).isDirectory()){ if (!new File(waterPicRoot).isDirectory()) {
new File(waterPicRoot).mkdirs(); new File(waterPicRoot).mkdirs();
} }
//组织加水印后图片存放地址 if (srcPath.substring(srcPath.length() - 3).equals("tif")) {
String waterPicPath = waterPicRoot + nameList[i]; //需要水印
if(!new File(waterPicPath).exists()) { //组织加水印后图片存放目录
img2PdfUtil.addWatermarkPic1(new File(srcPath), emrPdfWaterSet, waterPicPath); String waterJpgRoot = WATERTIFTOJPGPATH + patientId + "\\" + sourceList[i] + "\\";
//目录不存在则创建
if (!new File(waterJpgRoot).isDirectory()) {
new File(waterJpgRoot).mkdirs();
}
//获取到转换后jpg图像存放的位置
String filePathPrefix = waterJpgRoot + nameList[i];
String tifToJpgRoot = filePathPrefix.substring(0, filePathPrefix.lastIndexOf("."))+ ".jpg" ;
if (!new File(tifToJpgRoot).exists()) {
//tifToJpg(srcPath, tifToJpgRoot);
//加水印存放的地址
String waterPicPath = waterPicRoot + nameList[i].substring(0, nameList[i].lastIndexOf("."))+ ".jpg";
img2PdfUtil.addWatermarkPic1(new File(tifToJpgRoot), emrPdfWaterSet, waterPicPath);
}
outSrc = EMRRECORDJSP + "\\reload\\" + patientId + "\\" + sourceList[i] + "\\" + nameList[i].substring(0, nameList[i].lastIndexOf("."))+ ".jpg";
} else {
//组织加水印后图片存放地址
String waterPicPath = waterPicRoot + nameList[i];
if (!new File(waterPicPath).exists()) {
img2PdfUtil.addWatermarkPic1(new File(srcPath), emrPdfWaterSet, waterPicPath);
//组织输出地址
}
outSrc = EMRRECORDJSP + "\\reload\\" + patientId + "\\" + sourceList[i] + "\\" + nameList[i];
}
} else {
//不需要水印
//将原图片地址转换成映射地址
//获取盘符并转换映射地址的头部地址
String root = selectRootByNotWater(srcPath);
//获取盘符后面的地址
String str1 = srcPath.substring(0, srcPath.indexOf("\\"));
String picPath = srcPath.substring(str1.length() + 1, srcPath.length());
outSrc = EMRRECORDJSP + "\\" + root + picPath;
}
outs.add(outSrc);
Integer value = Math.round((i + 1) * 100 / nameList.length);
printLoadingMap.put(mapKey, value);
}
}
return outs;
}
/*private static String tifToJpg(String tifUrl, String tifToJpgRoot) {
File fileTiff = new File(tifToJpgRoot);
if (fileTiff.exists()) {
return tifToJpgRoot;
}
RenderedOp rd = JAI.create("fileload", tifUrl);//读取iff文件
OutputStream ops = null;
try {
ops = new FileOutputStream(tifToJpgRoot);
//文件存储输出流
JPEGEncodeParam param = new JPEGEncodeParam();
ImageEncoder image = ImageCodec.createImageEncoder("JPEG", ops, param); //指定输出格式
image.encode(rd );
//解析输出流进行输出
ops.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return tifToJpgRoot;
}*/
/**
*
*
* @param patientId
* @param rootPaths
* @param names
* @param sources
* @return
*/
public List<String> selectPrintPicTh(String patientId, String rootPaths, String names, String sources, String mapKey) {
List<String> outs = new LinkedList<>();
if (StringUtils.isNotBlank(names)) {
String[] rootPathList = rootPaths.split(",");
String[] nameList = names.split(",");
String[] sourceList = sources.split(",");
//获取水印设置
EmrPdfWaterSet emrPdfWaterSet = pdfWaterSetMapper.selectByPrimaryKey(1);
//获取是否打印文本水印
Short printEffective = emrPdfWaterSet.getPrintEffective();
//获取是否打印图片水印
Short printIsImg = emrPdfWaterSet.getPrintIsImg();
CommomVo commomVo = commomMapper.selectByPrimaryKey(patientId);
//判断是否有两套图像
int num = 0;
if (null != commomVo.getFilePath2() && !"".equals(commomVo.getFilePath2())) {
num = 1;
}
for (int i = 0; i < nameList.length; i++) {
//定义图片根目录地址
String rootPath = "";
//组织原图片地址
if (num == 1) {
rootPath = commomVo.getFilePath2();
} else {
if ("1".equals(sourceList[i])) {
//扫描图片地址位于rootPathList第一个
rootPath = rootPathList[0];
} else {
rootPath = rootPathList[1];
}
}
//原图片地址
String srcPath = rootPath + "\\" + nameList[i];
//定义输出地址
String outSrc = "";
//获取项目上下文地址
if ((printEffective != null && printEffective == 1) ||
(printIsImg != null && printIsImg == 1)) {
if (num == 1) {
//第二套打印图像输出
//组织加水印后图片存放目录
String waterPicRoot = WATERPICPATH + patientId + "\\" + 3 + "\\";
//目录不存在则创建
if (!new File(waterPicRoot).isDirectory()) {
new File(waterPicRoot).mkdirs();
}
//组织加水印后图片存放地址
String waterPicPath = waterPicRoot + nameList[i];
if (!new File(waterPicPath).exists()) {
img2PdfUtil.addWatermarkPic1(new File(srcPath), emrPdfWaterSet, waterPicPath);
}
//组织输出地址
outSrc = EMRRECORDJSP + "\\reload\\" + patientId + "\\" + 3 + "\\" + nameList[i];
} else {
//组织加水印后图片存放目录
String waterPicRoot = WATERPICPATH + patientId + "\\" + sourceList[i] + "\\";
//目录不存在则创建
if (!new File(waterPicRoot).isDirectory()) {
new File(waterPicRoot).mkdirs();
}
//组织加水印后图片存放地址
String waterPicPath = waterPicRoot + nameList[i];
if (!new File(waterPicPath).exists()) {
img2PdfUtil.addWatermarkPic1(new File(srcPath), emrPdfWaterSet, waterPicPath);
}
//组织输出地址
outSrc = EMRRECORDJSP + "\\reload\\" + patientId + "\\" + sourceList[i] + "\\" + nameList[i];
} }
//组织输出地址 } else {
outSrc = EMRRECORDJSP + "\\reload\\" + patientId +"\\" + sourceList[i] + "\\" + nameList[i];
}else{
//不需要水印 //不需要水印
//将原图片地址转换成映射地址 //将原图片地址转换成映射地址
//获取盘符并转换映射地址的头部地址 //获取盘符并转换映射地址的头部地址
String root = selectRootByNotWater(srcPath); String root = selectRootByNotWater(srcPath);
//获取盘符后面的地址 //获取盘符后面的地址
String str1 = srcPath.substring(0, srcPath.indexOf("\\")); String str1 = srcPath.substring(0, srcPath.indexOf("\\"));
String picPath = srcPath.substring(str1.length()+1, srcPath.length()); String picPath = srcPath.substring(str1.length() + 1, srcPath.length());
outSrc = EMRRECORDJSP + "\\" + root + picPath; outSrc = EMRRECORDJSP + "\\" + root + picPath;
} }
outs.add(outSrc); outs.add(outSrc);
Integer value = Math.round((i+1)*100/nameList.length); Integer value = Math.round((i + 1) * 100 / nameList.length);
printLoadingMap.put(mapKey,value); printLoadingMap.put(mapKey, value);
} }
} }
return outs; return outs;
@ -378,13 +633,14 @@ public class CommomService {
/** /**
* *
*
* @param srcPath * @param srcPath
* @return * @return
*/ */
private String selectRootByNotWater(String srcPath) { private String selectRootByNotWater(String srcPath) {
//获取盘符 //获取盘符
String str = srcPath.substring(0, 1).toUpperCase(); String str = srcPath.substring(0, 1).toUpperCase();
switch (str){ switch (str) {
case "C": case "C":
return "reloadC\\"; return "reloadC\\";
case "D": case "D":
@ -403,17 +659,18 @@ public class CommomService {
return "reloadJ\\"; return "reloadJ\\";
case "K": case "K":
return "reloadK\\"; return "reloadK\\";
default:; default:
;
} }
return null; return null;
} }
public Integer getPrintPicLoading(String mapKey) { public Integer getPrintPicLoading(String mapKey) {
Integer loadingPerson = printLoadingMap.get(mapKey); Integer loadingPerson = printLoadingMap.get(mapKey);
if(loadingPerson == null){ if (loadingPerson == null) {
//为空返回0 //为空返回0
return 0; return 0;
}else if(loadingPerson == 100){ } else if (loadingPerson == 100) {
//完成后移除内存 //完成后移除内存
printLoadingMap.remove(mapKey); printLoadingMap.remove(mapKey);
} }

@ -8,6 +8,8 @@ import java.util.Map;
public interface LogService { public interface LogService {
void insert(Emr_Log log); void insert(Emr_Log log);
void insertInterface(Emr_Log log, String userName);
void autoInsert(Emr_Log log); void autoInsert(Emr_Log log);
void deleteLogById(Integer logId); void deleteLogById(Integer logId);

@ -84,6 +84,54 @@ public class LogServiceImpl implements LogService {
logMapper.insert(log); logMapper.insert(log);
} }
@Override
public void insertInterface(Emr_Log log, String userName) {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
.getRequest();
// 从session获取用户名
log.setCreater(userName);
// 获取系统当前时间
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm");
log.setCreateDate(fmt.format(new Date()));
// 获取访问真实IP
String ipAddress = request.getHeader("x-forwarded-for");
if(ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
ipAddress = request.getHeader("Proxy-Client-IP");
}
if(ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
ipAddress = request.getHeader("WL-Proxy-Client-IP");
}
if(ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
ipAddress = request.getRemoteAddr();
if("127.0.0.1".equals(ipAddress) || "0:0:0:0:0:0:0:1".equals(ipAddress)){
//根据网卡取本机配置的IP
InetAddress inet=null;
try {
inet = InetAddress.getLocalHost();
} catch (UnknownHostException e) {
e.printStackTrace();
}
assert inet != null;
ipAddress= inet.getHostAddress();
}
}
//对于通过多个代理的情况第一个IP为客户端真实IP,多个IP按照','分割
if(ipAddress!=null && ipAddress.length()>15){ //"***.***.***.***".length() = 15
if(ipAddress.indexOf(",")>0){
ipAddress = ipAddress.substring(0,ipAddress.indexOf(","));
}
}
log.setSysFlag("emr_record");
//字符串太长,截取
String remark = log.getRemark();
if(StringUtils.isNoneBlank(remark) && remark.length() > 100){
remark = remark.substring(0,100);
log.setRemark(remark);
}
log.setIp(ipAddress);
logMapper.insert(log);
}
@Override @Override
public void autoInsert(Emr_Log log) { public void autoInsert(Emr_Log log) {
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm"); SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm");

@ -5,6 +5,7 @@ import com.emr.entity.templateSearch.Emr_Modle;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
/** /**
* @ProjectName: * @ProjectName:
@ -36,4 +37,6 @@ public interface TemplateSearchService {
* *
* */ * */
void addModleRelated(Integer modleId,String checks,HttpServletRequest request); void addModleRelated(Integer modleId,String checks,HttpServletRequest request);
void movePdf(String oldFile, String newFile) throws IOException;
} }

@ -21,6 +21,10 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
@ -164,4 +168,26 @@ public class TemplateSearchServiceImpl implements TemplateSearchService {
} }
} }
} }
@Override
public void movePdf(String oldFile, String newFile) throws IOException {
//一遍读取一遍写入。
//无论你是是使用的输出流还是输入流,操作的一定是文件。
//1.读取数据 //输入字节流
//1.找到需要复制的图片
File file = new File(oldFile); // NotFoundException
FileInputStream inputStream = new FileInputStream(file);
File file1 = new File(newFile);
FileOutputStream outputStream = new FileOutputStream(file1);
byte[] b = new byte[1024];
//int count = 0;
while (inputStream.read(b) != -1) {
//2.写入数据 //输出字节流
outputStream.write(b);
}
//关闭流 关闭流的原则: 先开后关 后开的先关。
outputStream.close();
inputStream.close();
}
} }

@ -0,0 +1,84 @@
package com.emr.util;
import com.emr.entity.emrPdfWaterSet.EmrPdfWaterSet;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
/**
* @program: emr_record
* @description
* @author: wangsiyi
* @create: 2020-11-21 14:05
**/
public class Img2BinaryUtil {
final private static float A4_weight = 595; //标准A4的宽
final private static float A4_height = 842; //标准A4的高
public static void Img2Binary(File srcImgFile, String binaryPicPath){
if(!new File(binaryPicPath).exists()){
String src = null;
BufferedImage bi = null;
try {
bi = ImageIO.read(srcImgFile);
// 获取当前图片的高,宽,ARGB
int h = bi.getHeight();
int w = bi.getWidth();
int rgb = bi.getRGB(0, 0);
int arr[][] = new int[w][h];
// 获取图片每一像素点的灰度值
for (int i = 0; i < w; i++) {
for (int j = 0; j < h; j++) {
// getRGB()返回默认的RGB颜色模型(十进制)
arr[i][j] = getImageRgb(bi.getRGB(i, j));//该点的灰度值
}
}
BufferedImage bufferedImage = new BufferedImage(w, h, BufferedImage.TYPE_BYTE_BINARY);// 构造一个类型为预定义图像类型之一的 BufferedImageTYPE_BYTE_BINARY表示一个不透明的以字节打包的 1、2 或 4 位图像。)
int FZ = 130;
for (int i = 0; i < w; i++) {
for (int j = 0; j < h; j++) {
if (getGray(arr, i, j, w, h) > FZ) {
int black = new Color(255, 255, 255).getRGB();
bufferedImage.setRGB(i, j, black);
} else {
int white = new Color(0, 0, 0).getRGB();
bufferedImage.setRGB(i, j, white);
}
}
}
ImageIO.write(bufferedImage, "jpg", new File(binaryPicPath));
} catch (IOException e) {
e.printStackTrace();
}
}
}
private static int getImageRgb(int i) {
String argb = Integer.toHexString(i);// 将十进制的颜色值转为十六进制
// argb分别代表透明,红,绿,蓝 分别占16进制2位
int r = Integer.parseInt(argb.substring(2, 4), 16);//后面参数为使用进制
int g = Integer.parseInt(argb.substring(4, 6), 16);
int b = Integer.parseInt(argb.substring(6, 8), 16);
int result = (int) ((r + g + b) / 3);
return result;
}
//自己加周围8个灰度值再除以9算出其相对灰度值
public static int getGray(int gray[][], int x, int y, int w, int h) {
int rs = gray[x][y]
+ (x == 0 ? 255 : gray[x - 1][y])
+ (x == 0 || y == 0 ? 255 : gray[x - 1][y - 1])
+ (x == 0 || y == h - 1 ? 255 : gray[x - 1][y + 1])
+ (y == 0 ? 255 : gray[x][y - 1])
+ (y == h - 1 ? 255 : gray[x][y + 1])
+ (x == w - 1 ? 255 : gray[x + 1][y])
+ (x == w - 1 || y == 0 ? 255 : gray[x + 1][y - 1])
+ (x == w - 1 || y == h - 1 ? 255 : gray[x + 1][y + 1]);
return rs / 9;
}
}

@ -11,14 +11,11 @@ import com.lowagie.text.pdf.*;
import com.sun.media.jai.codec.ImageCodec; import com.sun.media.jai.codec.ImageCodec;
import com.sun.media.jai.codec.ImageEncoder; import com.sun.media.jai.codec.ImageEncoder;
import com.sun.media.jai.codec.JPEGEncodeParam; import com.sun.media.jai.codec.JPEGEncodeParam;
import com.twelvemonkeys.imageio.plugins.tiff.TIFFImageReaderSpi;
import com.twelvemonkeys.imageio.plugins.tiff.TIFFImageWriterSpi;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.context.request.ServletRequestAttributes;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import javax.imageio.spi.IIORegistry;
import javax.media.jai.JAI; import javax.media.jai.JAI;
import javax.media.jai.RenderedOp; import javax.media.jai.RenderedOp;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@ -26,6 +23,7 @@ import javax.servlet.http.HttpServletResponse;
import java.awt.*; import java.awt.*;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.*; import java.io.*;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -41,32 +39,33 @@ import java.util.List;
* @Version: 1.0 * @Version: 1.0
*/ */
public class img2PdfUtil { public class img2PdfUtil {
final private static float A4_weight = 595; //标准A4的宽 final private static float A4_weight = 595; //标准A4的宽
final private static float A4_height = 842; //标准A4的高 final private static float A4_height = 842; //标准A4的高
public static void imageToPdf(HttpServletResponse response, List<String> filePaths, String pdfName, EmrPdfWaterSet pdfWaterSet){
Document document = new Document(PageSize.A4,0,0,0,0); //创建文档容器 public static void imageToPdf(HttpServletResponse response, List<String> filePaths, String pdfName, EmrPdfWaterSet pdfWaterSet) {
Document document = new Document(PageSize.A4, 0, 0, 0, 0); //创建文档容器
ByteArrayOutputStream bos = new ByteArrayOutputStream(); ByteArrayOutputStream bos = new ByteArrayOutputStream();
//是否启用水印 //是否启用水印
Short effective = pdfWaterSet.getEffective(); Short effective = pdfWaterSet.getEffective();
Short isImg = pdfWaterSet.getIsImg(); Short isImg = pdfWaterSet.getIsImg();
try { try {
if(effective == 1 || isImg == 1){ if (effective == 1 || isImg == 1) {
PdfWriter.getInstance(document,bos); //创建编写器PDF类型 PdfWriter.getInstance(document, bos); //创建编写器PDF类型
}else{ } else {
PdfWriter.getInstance(document,response.getOutputStream()); //创建编写器PDF类型 PdfWriter.getInstance(document, response.getOutputStream()); //创建编写器PDF类型
} }
pdfName = java.net.URLEncoder.encode(pdfName, "UTF-8"); pdfName = java.net.URLEncoder.encode(pdfName, "UTF-8");
response.reset(); response.reset();
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8");
response.setContentType("x-www-form-urlencoded"); // word格式 response.setContentType("x-www-form-urlencoded"); // word格式
response.setHeader("Content-Disposition", "attachment; filename=" + pdfName +".pdf"); response.setHeader("Content-Disposition", "attachment; filename=" + pdfName + ".pdf");
//图片合成pdf //图片合成pdf
imgToPdf(document,filePaths); imgToPdf(document, filePaths);
if(effective == 1 || isImg == 1) { if (effective == 1 || isImg == 1) {
addWaterMark(bos, response, pdfWaterSet.getUpOrUnder(), pdfWaterSet.getTransparent(), addWaterMark(bos, response, pdfWaterSet.getUpOrUnder(), pdfWaterSet.getTransparent(),
pdfWaterSet.getText(), pdfWaterSet.getTextX(), pdfWaterSet.getTextY(), pdfWaterSet.getText(), pdfWaterSet.getTextX(), pdfWaterSet.getTextY(),
pdfWaterSet.getTextColor(), pdfWaterSet.getTextSize(), pdfWaterSet.getTextRotation(), pdfWaterSet.getTextColor(), pdfWaterSet.getTextSize(), pdfWaterSet.getTextRotation(),
pdfWaterSet.getEffective(),pdfWaterSet.getIsImg(),pdfWaterSet.getImgFile(), pdfWaterSet.getImgWidth(), pdfWaterSet.getEffective(), pdfWaterSet.getIsImg(), pdfWaterSet.getImgFile(), pdfWaterSet.getImgWidth(),
pdfWaterSet.getImgHeight(), pdfWaterSet.getImgX(), pdfWaterSet.getImgY()); pdfWaterSet.getImgHeight(), pdfWaterSet.getImgX(), pdfWaterSet.getImgY());
} }
} catch (Exception e) { } catch (Exception e) {
@ -83,35 +82,74 @@ public class img2PdfUtil {
} }
} }
public static void imageToPdfFont(List<String> filePaths,EmrPdfWaterSet pdfWaterSet,String fileOutPath){ public static void imageToPdf2(HttpServletResponse response, String filePath, String targetPath, EmrPdfWaterSet pdfWaterSet) {
Document document = new Document(PageSize.A4,30,30,30,30); //创建文档容器 Document document = new Document(PageSize.A4, 30, 30, 30, 30); //创建文档容器
ByteArrayOutputStream bos = new ByteArrayOutputStream(); ByteArrayOutputStream bos = new ByteArrayOutputStream();
OutputStream out = null; OutputStream out = null;
//是否启用水印 //是否启用水印
Short effective = pdfWaterSet.getEffective(); Short effective = pdfWaterSet.getEffective();
Short isImg = pdfWaterSet.getIsImg(); Short isImg = pdfWaterSet.getIsImg();
try { try {
if(effective == 1 || isImg == 1){ if (effective == 1 || isImg == 1) {
PdfWriter.getInstance(document,bos); //创建编写器PDF类型 PdfWriter.getInstance(document, bos); //创建编写器PDF类型
}else{ } else {
out = new FileOutputStream(filePath);
PdfWriter.getInstance(document, out); //创建编写器PDF类型
}
//图片合成pdf
List<String> files = new ArrayList<>();
files.add(filePath);
imgToPdf(document, files);
if (effective == 1 || isImg == 1) {
addWaterMarkFont(bos, pdfWaterSet.getUpOrUnder(), pdfWaterSet.getTransparent(),
pdfWaterSet.getText(), pdfWaterSet.getTextX(), pdfWaterSet.getTextY(),
pdfWaterSet.getTextColor(), pdfWaterSet.getTextSize(), pdfWaterSet.getTextRotation(),
pdfWaterSet.getEffective(), pdfWaterSet.getIsImg(), pdfWaterSet.getImgFile(), pdfWaterSet.getImgWidth(),
pdfWaterSet.getImgHeight(), pdfWaterSet.getImgX(), pdfWaterSet.getImgY(), targetPath);
}
} catch (Exception e) {
ExceptionPrintUtil.printException(e);
e.printStackTrace();
} finally {
try {
bos.flush();
bos.close();
} catch (IOException e) {
e.printStackTrace();
}
document.close();
}
}
public static void imageToPdfFont(List<String> filePaths, EmrPdfWaterSet pdfWaterSet, String fileOutPath) {
Document document = new Document(PageSize.A4, 30, 30, 30, 30); //创建文档容器
ByteArrayOutputStream bos = new ByteArrayOutputStream();
OutputStream out = null;
//是否启用水印
Short effective = pdfWaterSet.getEffective();
Short isImg = pdfWaterSet.getIsImg();
try {
if (effective == 1 || isImg == 1) {
PdfWriter.getInstance(document, bos); //创建编写器PDF类型
} else {
out = new FileOutputStream(fileOutPath); out = new FileOutputStream(fileOutPath);
PdfWriter.getInstance(document,out); //创建编写器PDF类型 PdfWriter.getInstance(document, out); //创建编写器PDF类型
} }
//图片合成pdf //图片合成pdf
imgToPdf(document,filePaths); imgToPdf(document, filePaths);
if(effective == 1 || isImg == 1) { if (effective == 1 || isImg == 1) {
addWaterMarkFont(bos,pdfWaterSet.getUpOrUnder(), pdfWaterSet.getTransparent(), addWaterMarkFont(bos, pdfWaterSet.getUpOrUnder(), pdfWaterSet.getTransparent(),
pdfWaterSet.getText(), pdfWaterSet.getTextX(), pdfWaterSet.getTextY(), pdfWaterSet.getText(), pdfWaterSet.getTextX(), pdfWaterSet.getTextY(),
pdfWaterSet.getTextColor(), pdfWaterSet.getTextSize(), pdfWaterSet.getTextRotation(), pdfWaterSet.getTextColor(), pdfWaterSet.getTextSize(), pdfWaterSet.getTextRotation(),
pdfWaterSet.getEffective(),pdfWaterSet.getIsImg(),pdfWaterSet.getImgFile(), pdfWaterSet.getImgWidth(), pdfWaterSet.getEffective(), pdfWaterSet.getIsImg(), pdfWaterSet.getImgFile(), pdfWaterSet.getImgWidth(),
pdfWaterSet.getImgHeight(), pdfWaterSet.getImgX(), pdfWaterSet.getImgY(),fileOutPath); pdfWaterSet.getImgHeight(), pdfWaterSet.getImgX(), pdfWaterSet.getImgY(), fileOutPath);
} }
} catch (Exception e) { } catch (Exception e) {
ExceptionPrintUtil.printException(e); ExceptionPrintUtil.printException(e);
e.printStackTrace(); e.printStackTrace();
} finally { } finally {
try { try {
if(null != out) { if (null != out) {
out.flush(); out.flush();
out.close(); out.close();
} }
@ -125,22 +163,22 @@ public class img2PdfUtil {
} }
//脐血库下载批量 //脐血库下载批量
public static void imageToPdfToBuffOut(ByteArrayOutputStream bos, List<String> filePaths,EmrPdfWaterSet pdfWaterSet) throws Exception{ public static void imageToPdfToBuffOut(ByteArrayOutputStream bos, List<String> filePaths, EmrPdfWaterSet pdfWaterSet) throws Exception {
// 实例化图牿 // 实例化图牿
Document document = new Document(PageSize.A4,30,30,30,30); //创建文档容器 Document document = new Document(PageSize.A4, 30, 30, 30, 30); //创建文档容器
//是否启用水印 //是否启用水印
PdfWriter.getInstance(document,bos); PdfWriter.getInstance(document, bos);
try { try {
//图片合成pdf //图片合成pdf
imgToPdf(document,filePaths); imgToPdf(document, filePaths);
//是否启用水印 //是否启用水印
Short effective = pdfWaterSet.getDownloadEffective(); Short effective = pdfWaterSet.getDownloadEffective();
Short isImg = pdfWaterSet.getDownloadIsImg(); Short isImg = pdfWaterSet.getDownloadIsImg();
if(effective == 1 || isImg == 1) { if (effective == 1 || isImg == 1) {
addWaterMark(bos, null, pdfWaterSet.getUpOrUnder(), pdfWaterSet.getTransparent(), addWaterMark(bos, null, pdfWaterSet.getUpOrUnder(), pdfWaterSet.getTransparent(),
pdfWaterSet.getText(), pdfWaterSet.getTextX(), pdfWaterSet.getTextY(), pdfWaterSet.getText(), pdfWaterSet.getTextX(), pdfWaterSet.getTextY(),
pdfWaterSet.getTextColor(), pdfWaterSet.getTextSize(), pdfWaterSet.getTextRotation(), pdfWaterSet.getTextColor(), pdfWaterSet.getTextSize(), pdfWaterSet.getTextRotation(),
effective,isImg,pdfWaterSet.getImgFile(), pdfWaterSet.getImgWidth(), effective, isImg, pdfWaterSet.getImgFile(), pdfWaterSet.getImgWidth(),
pdfWaterSet.getImgHeight(), pdfWaterSet.getImgX(), pdfWaterSet.getImgY()); pdfWaterSet.getImgHeight(), pdfWaterSet.getImgX(), pdfWaterSet.getImgY());
} }
} catch (Exception e) { } catch (Exception e) {
@ -150,18 +188,13 @@ public class img2PdfUtil {
document.close(); document.close();
} }
} }
public static String addWatermarkPic1(File srcImgFile, EmrPdfWaterSet pdfWaterSet,String outPath) {
public static String addWatermarkPic1(File srcImgFile, EmrPdfWaterSet pdfWaterSet, String outPath) {
java.awt.Image srcImg = null; java.awt.Image srcImg = null;
BufferedImage bufImg = null; BufferedImage bufImg = null;
Graphics2D g = null; Graphics2D g = null;
try { try {
srcImg = ImageIO.read(new FileInputStream(srcImgFile)); srcImg = ImageIO.read(srcImgFile);//文件转化为图片
if(null == srcImg){
IIORegistry registry = IIORegistry.getDefaultInstance();
registry.registerServiceProvider(new com.twelvemonkeys.imageio.plugins.tiff.TIFFImageWriterSpi());
registry.registerServiceProvider(new com.twelvemonkeys.imageio.plugins.tiff.TIFFImageReaderSpi());
srcImg = ImageIO.read(new FileInputStream(srcImgFile));
}
//System.out.println("读取图片"+(end-start)/1000.0+"s"); //System.out.println("读取图片"+(end-start)/1000.0+"s");
int srcImgWidth = srcImg.getWidth(null);//获取图片的宽 int srcImgWidth = srcImg.getWidth(null);//获取图片的宽
int srcImgHeight = srcImg.getHeight(null);//获取图片的高 int srcImgHeight = srcImg.getHeight(null);//获取图片的高
@ -186,7 +219,7 @@ public class img2PdfUtil {
//System.out.println("画文字图片"+(end2-start2)/1000.0+"s"); //System.out.println("画文字图片"+(end2-start2)/1000.0+"s");
} }
//ByteArrayInputStream fis = new ByteArrayInputStream(imageToByteArr);//创建输入流对象 //ByteArrayInputStream fis = new ByteArrayInputStream(imageToByteArr);//创建输入流对象
if(!new File(outPath).exists()) { if (!new File(outPath).exists()) {
ImageIO.write(bufImg, "jpg", new File(outPath)); ImageIO.write(bufImg, "jpg", new File(outPath));
} }
/* FileOutputStream fos = new FileOutputStream("d:\\jiashi\\reload\\00004312bfd54291b31d77cc4b8e4c3b\\" + srcImgFile.getName()); //创建输出流对象 /* FileOutputStream fos = new FileOutputStream("d:\\jiashi\\reload\\00004312bfd54291b31d77cc4b8e4c3b\\" + srcImgFile.getName()); //创建输出流对象
@ -202,24 +235,25 @@ public class img2PdfUtil {
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
e.getMessage(); e.getMessage();
return outPath; return null;
}finally { } finally {
if(null != g){ if (null != g) {
g.dispose();// 释放资源*/ g.dispose();// 释放资源*/
} }
if(null != bufImg){ if (null != bufImg) {
bufImg.flush(); bufImg.flush();
} }
if(null != srcImg){ if (null != srcImg) {
srcImg.flush(); srcImg.flush();
} }
} }
} }
//图片合成pdf //图片合成pdf
private static void imgToPdf(Document document,List<String> filePaths) throws Exception{ private static void imgToPdf(Document document, List<String> filePaths) throws Exception {
document.open(); //打开容器 document.open(); //打开容器
float percent=100; float percent = 100;
float w,h; float w, h;
for (String filePath : filePaths) { for (String filePath : filePaths) {
File file = new File(filePath); File file = new File(filePath);
if (file.isFile()) { if (file.isFile()) {
@ -232,6 +266,7 @@ public class img2PdfUtil {
} else if ((w < A4_weight) && (h > A4_height)) { } else if ((w < A4_weight) && (h > A4_height)) {
percent = (A4_height * 100) / h; percent = (A4_height * 100) / h;
} else if ((w > A4_weight) && (h > A4_height)) { } else if ((w > A4_weight) && (h > A4_height)) {
percent = (A4_weight * 100) / w; percent = (A4_weight * 100) / w;
h = (h * percent) / 100; h = (h * percent) / 100;
if (h > A4_height) { if (h > A4_height) {
@ -249,39 +284,40 @@ public class img2PdfUtil {
} }
document.close(); //关闭容器 document.close(); //关闭容器
} }
/** /**
* *
* *
* @param * @param
* @param response * @param response
* @param upOrUnder * @param upOrUnder
* @param transparent * @param transparent
* @param text * @param text
* @param textX * @param textX
* @param textY * @param textY
* @param textColor * @param textColor
* @param textSize * @param textSize
* @param textRotation * @param textRotation
* @param imgFile * @param imgFile
* @param imgWidth * @param imgWidth
* @param imgHeight * @param imgHeight
* @param imgX * @param imgX
* @param imgY * @param imgY
* @throws IOException * @throws IOException
* @throws DocumentException * @throws DocumentException
*/ */
public static void addWaterMark(ByteArrayOutputStream bos,HttpServletResponse response,int upOrUnder,float transparent, String text, int textX, int textY, public static void addWaterMark(ByteArrayOutputStream bos, HttpServletResponse response, int upOrUnder, float transparent, String text, int textX, int textY,
String textColor,int textSize,int textRotation,Short effective,Short isImg, String textColor, int textSize, int textRotation, Short effective, Short isImg,
String imgFile, int imgWidth, int imgHeight,int imgX,int imgY){ String imgFile, int imgWidth, int imgHeight, int imgX, int imgY) {
PdfReader reader = null; PdfReader reader = null;
PdfStamper stamper = null; PdfStamper stamper = null;
try { try {
reader = new PdfReader(bos.toByteArray()); reader = new PdfReader(bos.toByteArray());
// 加完水印的文件 // 加完水印的文件
if(null != response){ if (null != response) {
stamper = new PdfStamper(reader,response.getOutputStream()); stamper = new PdfStamper(reader, response.getOutputStream());
}else{ } else {
stamper = new PdfStamper(reader,bos); stamper = new PdfStamper(reader, bos);
} }
// 设置字体 // 设置字体
BaseFont font = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.EMBEDDED); BaseFont font = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.EMBEDDED);
@ -292,10 +328,10 @@ public class img2PdfUtil {
PdfGState gs = new PdfGState(); PdfGState gs = new PdfGState();
for (int i = 1; i < total; i++) { for (int i = 1; i < total; i++) {
//upOrUnder = 1为在文本之上 //upOrUnder = 1为在文本之上
if(upOrUnder == 1){ if (upOrUnder == 1) {
// 水印在之前文本之上 // 水印在之前文本之上
content = stamper.getOverContent(i); content = stamper.getOverContent(i);
}else{ } else {
// 水印在文本之下 // 水印在文本之下
content = stamper.getUnderContent(i); content = stamper.getUnderContent(i);
} }
@ -304,7 +340,7 @@ public class img2PdfUtil {
content.setGState(gs); content.setGState(gs);
// 图片水印 // 图片水印
if (null != isImg && isImg == 1) { if (null != isImg && isImg == 1) {
HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest(); HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String tomcatPath = request.getSession().getServletContext().getRealPath("/"); String tomcatPath = request.getSession().getServletContext().getRealPath("/");
String imgStr = tomcatPath + "static\\pdfWaterSet\\upload\\" + imgFile; String imgStr = tomcatPath + "static\\pdfWaterSet\\upload\\" + imgFile;
com.lowagie.text.Image image = null; com.lowagie.text.Image image = null;
@ -343,22 +379,22 @@ public class img2PdfUtil {
ExceptionPrintUtil.printException(e); ExceptionPrintUtil.printException(e);
e.printStackTrace(); e.printStackTrace();
} finally { } finally {
if(null != stamper){ if (null != stamper) {
try { try {
stamper.close(); stamper.close();
} catch (DocumentException | IOException e) { } catch (DocumentException | IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
if(null != reader){ if (null != reader) {
reader.close(); reader.close();
} }
} }
} }
private static void addWaterMarkFont(ByteArrayOutputStream bos,int upOrUnder,float transparent, String text, int textX, int textY, private static void addWaterMarkFont(ByteArrayOutputStream bos, int upOrUnder, float transparent, String text, int textX, int textY,
String textColor,int textSize,int textRotation,Short effective,Short isImg, String textColor, int textSize, int textRotation, Short effective, Short isImg,
String imgFile, int imgWidth, int imgHeight,int imgX,int imgY,String fileOutPath){ String imgFile, int imgWidth, int imgHeight, int imgX, int imgY, String fileOutPath) {
//ByteArrayInputStream fileToUpload = new ByteArrayInputStream(bos.toByteArray()); //ByteArrayInputStream fileToUpload = new ByteArrayInputStream(bos.toByteArray());
// 待加水印的文件 // 待加水印的文件
//String fileStr = "e:\\11111.pdf"; //String fileStr = "e:\\11111.pdf";
@ -370,9 +406,11 @@ public class img2PdfUtil {
//输出到本地 //输出到本地
out = new FileOutputStream(fileOutPath); out = new FileOutputStream(fileOutPath);
// 加完水印的文件 // 加完水印的文件
stamper = new PdfStamper(reader,out); stamper = new PdfStamper(reader, out);
//设置不允许打印 //设置不允许打印
/*
stamper.setEncryption(null, null, ~(PdfWriter.ALLOW_COPY | PdfWriter.ALLOW_PRINTING ), PdfWriter.STANDARD_ENCRYPTION_128); stamper.setEncryption(null, null, ~(PdfWriter.ALLOW_COPY | PdfWriter.ALLOW_PRINTING ), PdfWriter.STANDARD_ENCRYPTION_128);
*/
// 设置字体 // 设置字体
BaseFont font = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.EMBEDDED); BaseFont font = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.EMBEDDED);
// PDF总页数 // PDF总页数
@ -382,10 +420,10 @@ public class img2PdfUtil {
PdfGState gs = new PdfGState(); PdfGState gs = new PdfGState();
for (int i = 1; i < total; i++) { for (int i = 1; i < total; i++) {
//upOrUnder = 1为在文本之上 //upOrUnder = 1为在文本之上
if(upOrUnder == 1){ if (upOrUnder == 1) {
// 水印在之前文本之上 // 水印在之前文本之上
content = stamper.getOverContent(i); content = stamper.getOverContent(i);
}else{ } else {
// 水印在文本之下 // 水印在文本之下
content = stamper.getUnderContent(i); content = stamper.getUnderContent(i);
} }
@ -394,7 +432,7 @@ public class img2PdfUtil {
content.setGState(gs); content.setGState(gs);
// 图片水印 // 图片水印
if (null != isImg && isImg == 1) { if (null != isImg && isImg == 1) {
HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest(); HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String tomcatPath = request.getSession().getServletContext().getRealPath("/"); String tomcatPath = request.getSession().getServletContext().getRealPath("/");
String imgStr = tomcatPath + "static\\pdfWaterSet\\upload\\" + imgFile; String imgStr = tomcatPath + "static\\pdfWaterSet\\upload\\" + imgFile;
com.lowagie.text.Image image = null; com.lowagie.text.Image image = null;
@ -426,14 +464,14 @@ public class img2PdfUtil {
ExceptionPrintUtil.printException(e); ExceptionPrintUtil.printException(e);
e.printStackTrace(); e.printStackTrace();
} finally { } finally {
if(null != stamper){ if (null != stamper) {
try { try {
stamper.close(); stamper.close();
} catch (DocumentException | IOException e) { } catch (DocumentException | IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
if(null != out){ if (null != out) {
try { try {
out.flush(); out.flush();
out.close(); out.close();
@ -441,7 +479,7 @@ public class img2PdfUtil {
e.printStackTrace(); e.printStackTrace();
} }
} }
if(null != reader){ if (null != reader) {
reader.close(); reader.close();
} }
} }
@ -449,15 +487,16 @@ public class img2PdfUtil {
/** /**
* Color * Color
*
* @param colorStr 16 * @param colorStr 16
* @return Color * @return Color
* */ */
private static Color toColorFromString(String colorStr){ private static Color toColorFromString(String colorStr) {
int r= Integer.valueOf( colorStr.substring( 1, 3 ), 16 ); int r = Integer.valueOf(colorStr.substring(1, 3), 16);
int g= Integer.valueOf( colorStr.substring( 3, 5 ), 16 ); int g = Integer.valueOf(colorStr.substring(3, 5), 16);
int b= Integer.valueOf( colorStr.substring( 5, 7 ), 16 ); int b = Integer.valueOf(colorStr.substring(5, 7), 16);
//java.awt.Color[r=0,g=0,b=255] //java.awt.Color[r=0,g=0,b=255]
return new Color(r,g,b); return new Color(r, g, b);
} }
/** /**
@ -494,4 +533,3 @@ public class img2PdfUtil {
return turnJpgFile; return turnJpgFile;
} }
} }

@ -385,6 +385,16 @@ public class CommomVo {
private Integer delCount;//病案图片已删除的个数 private Integer delCount;//病案图片已删除的个数
private String filePath2;//第二套图像存放地址
public String getFilePath2() {
return filePath2;
}
public void setFilePath2(String filePath2) {
this.filePath2 = filePath2;
}
public Integer getDelCount() { public Integer getDelCount() {
return delCount; return delCount;
} }

@ -0,0 +1,50 @@
package com.emr.vo.commomSearch;
/**
* @program: emr_record
* @description
* @author: wangsiyi
* @create: 2020-10-23 10:44
**/
public class ScanAssortVo {
private String oldPatientId;
private String newPatientId;
private String newAssortId;
private String scanPage;
public String getOldPatientId() {
return oldPatientId;
}
public void setOldPatientId(String oldPatientId) {
this.oldPatientId = oldPatientId;
}
public String getNewPatientId() {
return newPatientId;
}
public void setNewPatientId(String newPatientId) {
this.newPatientId = newPatientId;
}
public String getNewAssortId() {
return newAssortId;
}
public void setNewAssortId(String newAssortId) {
this.newAssortId = newAssortId;
}
public String getScanPage() {
return scanPage;
}
public void setScanPage(String scanPage) {
this.scanPage = scanPage;
}
}

@ -1,12 +1,12 @@
#power\u6743\u9650\u7CFB\u7EDF\u7684\u670D\u52A1\u5668\u5730\u5740\u5934 #power\u6743\u9650\u7CFB\u7EDF\u7684\u670D\u52A1\u5668\u5730\u5740\u5934
POWER_IP = 192.168.1.3 POWER_IP = localhost
POWER_URLHEAD = http://192.168.1.3:8080/power POWER_URLHEAD = http://localhost:8081/power
POWER_JSPHEAD = 192.168.1.3 POWER_JSPHEAD = localhost
POWER_JSP = http://192.168.1.3:8080/power POWER_JSP = http://localhost:8081/power
#\u672C\u8EAB\u7CFB\u7EDF\u7684\u670D\u52A1\u5668\u5730\u5740\u5934 #\u672C\u8EAB\u7CFB\u7EDF\u7684\u670D\u52A1\u5668\u5730\u5740\u5934
EMR_RECORD_JSP = http://192.168.1.3:8080/emr_record EMR_RECORD_JSP = http://localhost:8083/emr_record
#webSocket\u670D\u52A1\u5668\u5730\u5740 #webSocket\u670D\u52A1\u5668\u5730\u5740
@ -29,3 +29,5 @@ picPath = static/pdfWaterSet/upload/
#1\u751F\u6210\u52A0\u4E0A\u6C34\u5370\u540E\u7684\u56FE\u7247\u7684\u66F4\u76EE\u5F55 #1\u751F\u6210\u52A0\u4E0A\u6C34\u5370\u540E\u7684\u56FE\u7247\u7684\u66F4\u76EE\u5F55
#2\u9884\u89C8\u75C5\u6848\u63A5\u53E3pdf\u4E34\u65F6\u751F\u6210\u76EE\u5F55 #2\u9884\u89C8\u75C5\u6848\u63A5\u53E3pdf\u4E34\u65F6\u751F\u6210\u76EE\u5F55
waterPicPath = D:/jiashi/reload/ waterPicPath = D:/jiashi/reload/
waterTifToJpgPath = D:/jiashi/tifToJpgLoad/

@ -1262,12 +1262,8 @@
select patient_id,inpatient_no,name,admiss_id,admiss_times,dis_date,dis_dept select patient_id,inpatient_no,name,admiss_id,admiss_times,dis_date,dis_dept
from commomtable from commomtable
where inpatient_no like '%${inpatientNo}%' where inpatient_no like '%${inpatientNo}%'
order by admiss_times desc
</select> </select>
<!--<select id="selectCommomCount" parameterType="java.lang.Integer">
select
COUNT(*)
FROM dbo.commomtable
</select>-->
<select id="selectCommomCount" resultType="java.lang.Integer"> <select id="selectCommomCount" resultType="java.lang.Integer">
SELECT SELECT
COUNT(1) COUNT(1)

@ -1,41 +1,41 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.emr.dao.approve.Emr_Apply_ApproveMapper" > <mapper namespace="com.emr.dao.approve.Emr_Apply_ApproveMapper">
<resultMap id="BaseResultMap" type="com.emr.entity.approve.Emr_Apply_Approve" > <resultMap id="BaseResultMap" type="com.emr.entity.approve.Emr_Apply_Approve">
<id column="id" property="id" jdbcType="INTEGER" /> <id column="id" property="id" jdbcType="INTEGER"/>
<result column="applyer" property="applyer" jdbcType="NVARCHAR" /> <result column="applyer" property="applyer" jdbcType="NVARCHAR"/>
<result column="apply_time" property="applyTime" jdbcType="NCHAR" /> <result column="apply_time" property="applyTime" jdbcType="NCHAR"/>
<result column="effe_time" property="effeTime" jdbcType="NCHAR" /> <result column="effe_time" property="effeTime" jdbcType="NCHAR"/>
<result column="effe_days" property="effeDays" jdbcType="INTEGER" /> <result column="effe_days" property="effeDays" jdbcType="INTEGER"/>
<result column="apply_type" property="applyType" jdbcType="NVARCHAR" /> <result column="apply_type" property="applyType" jdbcType="NVARCHAR"/>
<result column="apply_reason" property="applyReason" jdbcType="NVARCHAR" /> <result column="apply_reason" property="applyReason" jdbcType="NVARCHAR"/>
<result column="apply_state" property="applyState" jdbcType="NVARCHAR" /> <result column="apply_state" property="applyState" jdbcType="NVARCHAR"/>
<result column="approver" property="approver" jdbcType="NVARCHAR" /> <result column="approver" property="approver" jdbcType="NVARCHAR"/>
<result column="approve_time" property="approveTime" jdbcType="NCHAR" /> <result column="approve_time" property="approveTime" jdbcType="NCHAR"/>
<result column="approve_state" property="approveState" jdbcType="NVARCHAR" /> <result column="approve_state" property="approveState" jdbcType="NVARCHAR"/>
<result column="approve_notes" property="approveNotes" jdbcType="NVARCHAR" /> <result column="approve_notes" property="approveNotes" jdbcType="NVARCHAR"/>
<result column="patient_id" property="patientId" jdbcType="VARCHAR" /> <result column="patient_id" property="patientId" jdbcType="VARCHAR"/>
<result column="admiss_id" property="admissId" jdbcType="CHAR" /> <result column="admiss_id" property="admissId" jdbcType="CHAR"/>
<result column="inpatient_no" property="inpatientNo" jdbcType="CHAR" /> <result column="inpatient_no" property="inpatientNo" jdbcType="CHAR"/>
<result column="admiss_times" property="admissTimes" jdbcType="SMALLINT" /> <result column="admiss_times" property="admissTimes" jdbcType="SMALLINT"/>
<result column="dis_date" property="disDate" jdbcType="TIMESTAMP" /> <result column="dis_date" property="disDate" jdbcType="TIMESTAMP"/>
</resultMap> </resultMap>
<sql id="Base_Column_List" > <sql id="Base_Column_List">
id, applyer, apply_time, effe_time, effe_days, apply_type, apply_reason, apply_state, id, applyer, apply_time, effe_time, effe_days, apply_type, apply_reason, apply_state,
approver, approve_time, approve_state, approve_notes, patient_id, admiss_id, inpatient_no, approver, approve_time, approve_state, approve_notes, patient_id, admiss_id, inpatient_no,
admiss_times, dis_date admiss_times, dis_date
</sql> </sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" > <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from emr_apply_approve from emr_apply_approve
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" > <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from emr_apply_approve delete from emr_apply_approve
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</delete> </delete>
<insert id="insert" parameterType="com.emr.entity.approve.Emr_Apply_Approve" > <insert id="insert" parameterType="com.emr.entity.approve.Emr_Apply_Approve">
insert into emr_apply_approve (applyer, apply_time, insert into emr_apply_approve (applyer, apply_time,
effe_time, effe_days, apply_type, effe_time, effe_days, apply_type,
apply_reason, apply_state, approver, apply_reason, apply_state, approver,
@ -49,170 +49,170 @@
#{patientId,jdbcType=VARCHAR}, #{admissId,jdbcType=CHAR}, #{inpatientNo,jdbcType=CHAR}, #{patientId,jdbcType=VARCHAR}, #{admissId,jdbcType=CHAR}, #{inpatientNo,jdbcType=CHAR},
#{admissTimes,jdbcType=SMALLINT}, #{disDate,jdbcType=TIMESTAMP}) #{admissTimes,jdbcType=SMALLINT}, #{disDate,jdbcType=TIMESTAMP})
</insert> </insert>
<insert id="insertSelective" parameterType="com.emr.entity.approve.Emr_Apply_Approve" > <insert id="insertSelective" parameterType="com.emr.entity.approve.Emr_Apply_Approve">
insert into emr_apply_approve insert into emr_apply_approve
<trim prefix="(" suffix=")" suffixOverrides="," > <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null" > <if test="id != null">
id, id,
</if> </if>
<if test="applyer != null" > <if test="applyer != null">
applyer, applyer,
</if> </if>
<if test="applyTime != null" > <if test="applyTime != null">
apply_time, apply_time,
</if> </if>
<if test="effeTime != null" > <if test="effeTime != null">
effe_time, effe_time,
</if> </if>
<if test="effeDays != null" > <if test="effeDays != null">
effe_days, effe_days,
</if> </if>
<if test="applyType != null" > <if test="applyType != null">
apply_type, apply_type,
</if> </if>
<if test="applyReason != null" > <if test="applyReason != null">
apply_reason, apply_reason,
</if> </if>
<if test="applyState != null" > <if test="applyState != null">
apply_state, apply_state,
</if> </if>
<if test="approver != null" > <if test="approver != null">
approver, approver,
</if> </if>
<if test="approveTime != null" > <if test="approveTime != null">
approve_time, approve_time,
</if> </if>
<if test="approveState != null" > <if test="approveState != null">
approve_state, approve_state,
</if> </if>
<if test="approveNotes != null" > <if test="approveNotes != null">
approve_notes, approve_notes,
</if> </if>
<if test="patientId != null" > <if test="patientId != null">
patient_id, patient_id,
</if> </if>
<if test="admissId != null" > <if test="admissId != null">
admiss_id, admiss_id,
</if> </if>
<if test="inpatientNo != null" > <if test="inpatientNo != null">
inpatient_no, inpatient_no,
</if> </if>
<if test="admissTimes != null" > <if test="admissTimes != null">
admiss_times, admiss_times,
</if> </if>
<if test="disDate != null" > <if test="disDate != null">
dis_date, dis_date,
</if> </if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides="," > <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null" > <if test="id != null">
#{id,jdbcType=INTEGER}, #{id,jdbcType=INTEGER},
</if> </if>
<if test="applyer != null" > <if test="applyer != null">
#{applyer,jdbcType=NVARCHAR}, #{applyer,jdbcType=NVARCHAR},
</if> </if>
<if test="applyTime != null" > <if test="applyTime != null">
#{applyTime,jdbcType=NCHAR}, #{applyTime,jdbcType=NCHAR},
</if> </if>
<if test="effeTime != null" > <if test="effeTime != null">
#{effeTime,jdbcType=NCHAR}, #{effeTime,jdbcType=NCHAR},
</if> </if>
<if test="effeDays != null" > <if test="effeDays != null">
#{effeDays,jdbcType=INTEGER}, #{effeDays,jdbcType=INTEGER},
</if> </if>
<if test="applyType != null" > <if test="applyType != null">
#{applyType,jdbcType=NVARCHAR}, #{applyType,jdbcType=NVARCHAR},
</if> </if>
<if test="applyReason != null" > <if test="applyReason != null">
#{applyReason,jdbcType=NVARCHAR}, #{applyReason,jdbcType=NVARCHAR},
</if> </if>
<if test="applyState != null" > <if test="applyState != null">
#{applyState,jdbcType=NVARCHAR}, #{applyState,jdbcType=NVARCHAR},
</if> </if>
<if test="approver != null" > <if test="approver != null">
#{approver,jdbcType=NVARCHAR}, #{approver,jdbcType=NVARCHAR},
</if> </if>
<if test="approveTime != null" > <if test="approveTime != null">
#{approveTime,jdbcType=NCHAR}, #{approveTime,jdbcType=NCHAR},
</if> </if>
<if test="approveState != null" > <if test="approveState != null">
#{approveState,jdbcType=NVARCHAR}, #{approveState,jdbcType=NVARCHAR},
</if> </if>
<if test="approveNotes != null" > <if test="approveNotes != null">
#{approveNotes,jdbcType=NVARCHAR}, #{approveNotes,jdbcType=NVARCHAR},
</if> </if>
<if test="patientId != null" > <if test="patientId != null">
#{patientId,jdbcType=VARCHAR}, #{patientId,jdbcType=VARCHAR},
</if> </if>
<if test="admissId != null" > <if test="admissId != null">
#{admissId,jdbcType=CHAR}, #{admissId,jdbcType=CHAR},
</if> </if>
<if test="inpatientNo != null" > <if test="inpatientNo != null">
#{inpatientNo,jdbcType=CHAR}, #{inpatientNo,jdbcType=CHAR},
</if> </if>
<if test="admissTimes != null" > <if test="admissTimes != null">
#{admissTimes,jdbcType=SMALLINT}, #{admissTimes,jdbcType=SMALLINT},
</if> </if>
<if test="disDate != null" > <if test="disDate != null">
#{disDate,jdbcType=TIMESTAMP}, #{disDate,jdbcType=TIMESTAMP},
</if> </if>
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective" parameterType="com.emr.entity.approve.Emr_Apply_Approve" > <update id="updateByPrimaryKeySelective" parameterType="com.emr.entity.approve.Emr_Apply_Approve">
update emr_apply_approve update emr_apply_approve
<set > <set>
<if test="applyer != null" > <if test="applyer != null">
applyer = #{applyer,jdbcType=NVARCHAR}, applyer = #{applyer,jdbcType=NVARCHAR},
</if> </if>
<if test="applyTime != null" > <if test="applyTime != null">
apply_time = #{applyTime,jdbcType=NCHAR}, apply_time = #{applyTime,jdbcType=NCHAR},
</if> </if>
<if test="effeTime != null" > <if test="effeTime != null">
effe_time = #{effeTime,jdbcType=NCHAR}, effe_time = #{effeTime,jdbcType=NCHAR},
</if> </if>
<if test="effeDays != null" > <if test="effeDays != null">
effe_days = #{effeDays,jdbcType=INTEGER}, effe_days = #{effeDays,jdbcType=INTEGER},
</if> </if>
<if test="applyType != null" > <if test="applyType != null">
apply_type = #{applyType,jdbcType=NVARCHAR}, apply_type = #{applyType,jdbcType=NVARCHAR},
</if> </if>
<if test="applyReason != null" > <if test="applyReason != null">
apply_reason = #{applyReason,jdbcType=NVARCHAR}, apply_reason = #{applyReason,jdbcType=NVARCHAR},
</if> </if>
<if test="applyState != null" > <if test="applyState != null">
apply_state = #{applyState,jdbcType=NVARCHAR}, apply_state = #{applyState,jdbcType=NVARCHAR},
</if> </if>
<if test="approver != null" > <if test="approver != null">
approver = #{approver,jdbcType=NVARCHAR}, approver = #{approver,jdbcType=NVARCHAR},
</if> </if>
<if test="approveTime != null" > <if test="approveTime != null">
approve_time = #{approveTime,jdbcType=NCHAR}, approve_time = #{approveTime,jdbcType=NCHAR},
</if> </if>
<if test="approveState != null" > <if test="approveState != null">
approve_state = #{approveState,jdbcType=NVARCHAR}, approve_state = #{approveState,jdbcType=NVARCHAR},
</if> </if>
<if test="approveNotes != null" > <if test="approveNotes != null">
approve_notes = #{approveNotes,jdbcType=NVARCHAR}, approve_notes = #{approveNotes,jdbcType=NVARCHAR},
</if> </if>
<if test="patientId != null" > <if test="patientId != null">
patient_id = #{patientId,jdbcType=VARCHAR}, patient_id = #{patientId,jdbcType=VARCHAR},
</if> </if>
<if test="admissId != null" > <if test="admissId != null">
admiss_id = #{admissId,jdbcType=CHAR}, admiss_id = #{admissId,jdbcType=CHAR},
</if> </if>
<if test="inpatientNo != null" > <if test="inpatientNo != null">
inpatient_no = #{inpatientNo,jdbcType=CHAR}, inpatient_no = #{inpatientNo,jdbcType=CHAR},
</if> </if>
<if test="admissTimes != null" > <if test="admissTimes != null">
admiss_times = #{admissTimes,jdbcType=SMALLINT}, admiss_times = #{admissTimes,jdbcType=SMALLINT},
</if> </if>
<if test="disDate != null" > <if test="disDate != null">
dis_date = #{disDate,jdbcType=TIMESTAMP}, dis_date = #{disDate,jdbcType=TIMESTAMP},
</if> </if>
</set> </set>
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
<update id="updateByPrimaryKey" parameterType="com.emr.entity.approve.Emr_Apply_Approve" > <update id="updateByPrimaryKey" parameterType="com.emr.entity.approve.Emr_Apply_Approve">
update emr_apply_approve update emr_apply_approve
set applyer = #{applyer,jdbcType=NVARCHAR}, set applyer = #{applyer,jdbcType=NVARCHAR},
apply_time = #{applyTime,jdbcType=NCHAR}, apply_time = #{applyTime,jdbcType=NCHAR},
@ -232,77 +232,77 @@
dis_date = #{disDate,jdbcType=TIMESTAMP} dis_date = #{disDate,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
<!--根据用户获取审批通过且未过期的patientId集合--> <!--根据用户获取审批通过且未过期的patientId集合-->
<select id="selectPatientIdsByUser" resultMap="BaseResultMap" parameterType="java.lang.String"> <select id="selectPatientIdsByUser" resultMap="BaseResultMap" parameterType="java.lang.String">
SELECT SELECT
patient_id,inpatient_no patient_id,inpatient_no
FROM FROM
emr_apply_approve emr_apply_approve
WHERE WHERE
effe_time > GETDATE() -1 effe_time > GETDATE() -1
AND AND
approve_state = '1' approve_state = '1'
AND AND
applyer = #{userName} applyer = #{userName}
<if test="patientId != null and patientId != ''"> <if test="patientId != null and patientId != ''">
AND patient_id = #{patientId} AND patient_id = #{patientId}
</if> </if>
<choose> <choose>
<when test="type != null and type == 3"> <when test="type != null and type == 3">
AND apply_type = 3 AND apply_type = 3
</when> </when>
<otherwise> <otherwise>
AND apply_type != 3 AND apply_type != 3
</otherwise> </otherwise>
</choose> </choose>
</select> </select>
<!--根据用户获取确认且未过期的patientId集合--> <!--根据用户获取确认且未过期的patientId集合-->
<select id="selectPatientIdsByUserAndApplyStatus" resultMap="BaseResultMap" parameterType="java.lang.String"> <select id="selectPatientIdsByUserAndApplyStatus" resultMap="BaseResultMap" parameterType="java.lang.String">
SELECT SELECT
patient_id patient_id
FROM FROM
emr_apply_approve emr_apply_approve
WHERE WHERE
effe_time > GETDATE() -1 effe_time > GETDATE() -1
AND AND
apply_state = '2' apply_state = '2'
AND AND
approve_state != '2' approve_state != '2'
AND AND
applyer = #{userName} applyer = #{userName}
<if test="patientId != null and patientId != ''"> <if test="patientId != null and patientId != ''">
AND patient_id IN (${patientId}) AND patient_id IN (${patientId})
</if> </if>
<if test="applyType != null and applyType != ''"> <if test="applyType != null and applyType != ''">
AND apply_type = #{applyType} AND apply_type = #{applyType}
</if> </if>
GROUP BY patient_id GROUP BY patient_id
</select> </select>
<!--根据用户获取保存未提交的patientId集合--> <!--根据用户获取保存未提交的patientId集合-->
<select id="selectNotSumbitPatientIdsByUser" resultMap="BaseResultMap" parameterType="java.lang.String"> <select id="selectNotSumbitPatientIdsByUser" resultMap="BaseResultMap" parameterType="java.lang.String">
SELECT SELECT
id,effe_time,effe_days,apply_type,apply_reason,inpatient_no id,effe_time,effe_days,apply_type,apply_reason,inpatient_no
FROM FROM
emr_apply_approve emr_apply_approve
WHERE WHERE
apply_state = '1' apply_state = '1'
AND AND
applyer = #{userName} applyer = #{userName}
AND AND
patient_id = #{patientId} patient_id = #{patientId}
<choose> <choose>
<when test="type != '' and type == 2"> <when test="type != '' and type == 2">
AND apply_type == 3 AND apply_type == 3
</when> </when>
<otherwise> <otherwise>
AND apply_type != 3 AND apply_type != 3
</otherwise> </otherwise>
</choose> </choose>
</select> </select>
<!--根据申请者查询申请集合--> <!--根据申请者查询申请集合-->
<select id="selectAllApproveByCreater" resultMap="BaseResultMap"> <select id="selectAllApproveByCreater" resultMap="BaseResultMap">
SELECT SELECT
a.id, a.id,
a.applyer, a.applyer,
a.apply_time, a.apply_time,
@ -315,74 +315,79 @@
a.dis_date, a.dis_date,
a.approve_notes, a.approve_notes,
a.patient_id, a.patient_id,
CASE WHEN effe_time &lt;= GETDATE() THEN '已过期' WHEN apply_state='1' THEN '未提交' WHEN apply_state='2' THEN '已提交' END apply_state, CASE WHEN effe_time &lt;= GETDATE() THEN '已过期' WHEN apply_state='1' THEN '未提交' WHEN apply_state='2' THEN '已提交'
END apply_state,
a.approver, a.approver,
a.approve_time, a.approve_time,
CASE WHEN effe_time &lt;= GETDATE() THEN '已过期' WHEN approve_state = '1' THEN '审核通过' WHEN approve_state='2' THEN '审核不通过' WHEN approve_state is null THEN '待审批' END approve_state, CASE WHEN effe_time &lt;= GETDATE() THEN '已过期' WHEN approve_state = '1' THEN '审核通过' WHEN approve_state='2' THEN
'审核不通过' WHEN approve_state is null THEN '待审批' END approve_state,
c.name, c.name,
CASE WHEN emr_lock.id is null THEN 0 ELSE 1 END lockStatus CASE WHEN emr_lock.id is null THEN 0 ELSE 1 END lockStatus
FROM FROM
emr_apply_approve a emr_apply_approve a
LEFT JOIN LEFT JOIN
commomtable c commomtable c
ON ON
a.patient_id = c.patient_id a.patient_id = c.patient_id
LEFT JOIN LEFT JOIN
(select code,Name from emr_dictionary where parent_id = 'apply_type') emr_dictionary (select code,Name from emr_dictionary where parent_id = 'apply_type') emr_dictionary
ON ON
a.apply_type = emr_dictionary.code a.apply_type = emr_dictionary.code
LEFT JOIN LEFT JOIN
emr_lock emr_lock
ON ON
a.patient_id = emr_lock.patient_id a.patient_id = emr_lock.patient_id
AND emr_lock.lock_state = 1 AND emr_lock.lock_state = 1
<where> <where>
<if test="applyers != '' and applyers != null"> <if test="applyers != '' and applyers != null">
a.applyer IN (${applyers}) a.applyer IN (${applyers})
</if> </if>
<if test="record.applyer != '' and record.applyer != null"> <if test="record.applyer != '' and record.applyer != null">
AND a.applyer LIKE '%${record.applyer}%' AND a.applyer LIKE '%${record.applyer}%'
</if> </if>
<if test="record.approver != '' and record.approver != null"> <if test="record.approver != '' and record.approver != null">
AND a.approver LIKE '${record.approver}%' AND a.approver LIKE '${record.approver}%'
</if> </if>
<if test="record.effeDays != '' and record.effeDays != null"> <if test="record.effeDays != '' and record.effeDays != null">
AND a.effe_days = ${record.effeDays} AND a.effe_days = ${record.effeDays}
</if> </if>
<if test="record.inpatientNo != '' and record.inpatientNo != null"> <if test="record.inpatientNo != '' and record.inpatientNo != null">
AND a.inpatient_no LIKE '%${record.inpatientNo}%' AND a.inpatient_no LIKE '%${record.inpatientNo}%'
</if> </if>
<if test="startTime1 != '' and startTime1 != null"> <if test="startTime1 != '' and startTime1 != null">
AND a.apply_time &gt;= #{startTime1} AND a.apply_time &gt;= #{startTime1}
<if test="endTime1 != '' and endTime1 != null"> <if test="endTime1 != '' and endTime1 != null">
AND a.apply_time &lt;= #{endTime1} AND a.apply_time &lt;= #{endTime1}
</if> </if>
</if> </if>
<if test="startTime2 != '' and startTime2 != null"> <if test="startTime2 != '' and startTime2 != null">
AND a.approve_time &gt;= #{startTime2} AND a.approve_time &gt;= #{startTime2}
<if test="endTime2 != '' and endTime2 != null"> <if test="endTime2 != '' and endTime2 != null">
AND a.approve_time &lt;= #{endTime2} AND a.approve_time &lt;= #{endTime2}
</if> </if>
</if> </if>
<if test="record.name != '' and record.name != null"> <if test="record.name != '' and record.name != null">
AND c.name LIKE '%${record.name}%' AND c.name LIKE '%${record.name}%'
</if> </if>
<if test="record.applyType != '' and record.applyType != null"> <if test="record.applyType != '' and record.applyType != null">
AND a.apply_type = ${record.applyType} AND a.apply_type = ${record.applyType}
</if> </if>
<if test="record.applyState != '' and record.applyState != null"> <if test="record.applyState != '' and record.applyState != null">
AND (CASE WHEN effe_time &lt;= GETDATE() THEN '已过期' WHEN apply_state='1' THEN '未提交' WHEN apply_state='2' THEN '已提交' END) = #{record.applyState} AND (CASE WHEN effe_time &lt;= GETDATE() THEN '已过期' WHEN apply_state='1' THEN '未提交' WHEN apply_state='2'
</if> THEN '已提交' END) = #{record.applyState}
<if test="record.approveState != '' and record.approveState != null"> </if>
AND (CASE WHEN effe_time &lt;= GETDATE() THEN '已过期' WHEN approve_state = '1' THEN '审核通过' WHEN approve_state='2' THEN '审核不通过' WHEN approve_state is null THEN '待审批' WHEN approve_state = '' THEN '待审批' END) = #{record.approveState} <if test="record.approveState != '' and record.approveState != null">
</if> AND (CASE WHEN effe_time &lt;= GETDATE() THEN '已过期' WHEN approve_state = '1' THEN '审核通过' WHEN
</where> approve_state='2' THEN '审核不通过' WHEN approve_state is null THEN '待审批' WHEN approve_state = '' THEN '待审批'
ORDER BY a.apply_time DESC END) = #{record.approveState}
</select> </if>
</where>
ORDER BY a.apply_time DESC
</select>
<!--查询审批集合--> <!--查询审批集合-->
<select id="selectAllApprove" resultMap="BaseResultMap"> <select id="selectAllApprove" resultMap="BaseResultMap">
SELECT SELECT
a.id, a.id,
a.applyer, a.applyer,
a.apply_time, a.apply_time,
@ -395,73 +400,77 @@
a.dis_date, a.dis_date,
a.approve_notes, a.approve_notes,
a.patient_id, a.patient_id,
CASE WHEN effe_time &lt;= GETDATE() THEN '已过期' WHEN apply_state='1' THEN '未提交' WHEN apply_state='2' THEN '已提交' END apply_state, CASE WHEN effe_time &lt;= GETDATE() THEN '已过期' WHEN apply_state='1' THEN '未提交' WHEN apply_state='2' THEN '已提交'
END apply_state,
a.approver, a.approver,
a.approve_time, a.approve_time,
CASE WHEN effe_time &lt;= GETDATE() THEN '已过期' WHEN approve_state = '1' THEN '审核通过' WHEN approve_state='2' THEN '审核不通过' WHEN approve_state is null THEN '待审批' WHEN approve_state = '' THEN '待审批' END approve_state, CASE WHEN effe_time &lt;= GETDATE() THEN '已过期' WHEN approve_state = '1' THEN '审核通过' WHEN approve_state='2' THEN
'审核不通过' WHEN approve_state is null THEN '待审批' WHEN approve_state = '' THEN '待审批' END approve_state,
c.name, c.name,
CASE WHEN emr_lock.id is null THEN 0 ELSE 1 END lockStatus CASE WHEN emr_lock.id is null THEN 0 ELSE 1 END lockStatus
FROM FROM
emr_apply_approve a emr_apply_approve a
LEFT JOIN LEFT JOIN
commomtable c commomtable c
ON ON
a.patient_id = c.patient_id a.patient_id = c.patient_id
LEFT JOIN LEFT JOIN
(select code,Name from emr_dictionary where parent_id = 'apply_type') emr_dictionary (select code,Name from emr_dictionary where parent_id = 'apply_type') emr_dictionary
ON ON
a.apply_type = emr_dictionary.code a.apply_type = emr_dictionary.code
LEFT JOIN LEFT JOIN
emr_lock emr_lock
ON ON
a.patient_id = emr_lock.patient_id a.patient_id = emr_lock.patient_id
AND emr_lock.lock_state = 1 AND emr_lock.lock_state = 1
<where> <where>
<if test="userIds != '' and userIds != null"> <if test="userIds != '' and userIds != null">
a.applyer IN (${userIds}) a.applyer IN (${userIds})
</if> </if>
<if test="record.applyer != '' and record.applyer != null"> <if test="record.applyer != '' and record.applyer != null">
AND a.applyer LIKE '%${record.applyer}%' AND a.applyer LIKE '%${record.applyer}%'
</if> </if>
<if test="record.approver != '' and record.approver != null"> <if test="record.approver != '' and record.approver != null">
AND a.approver IN (${record.approver}) AND a.approver IN (${record.approver})
</if> </if>
<if test="record.effeDays != '' and record.effeDays != null"> <if test="record.effeDays != '' and record.effeDays != null">
AND a.effe_days = ${record.effeDays} AND a.effe_days = ${record.effeDays}
</if> </if>
<if test="record.inpatientNo != '' and record.inpatientNo != null"> <if test="record.inpatientNo != '' and record.inpatientNo != null">
AND a.inpatient_no LIKE '%${record.inpatientNo}%' AND a.inpatient_no LIKE '%${record.inpatientNo}%'
</if> </if>
<if test="startTime1 != '' and startTime1 != null"> <if test="startTime1 != '' and startTime1 != null">
AND a.apply_time &gt;= #{startTime1} AND a.apply_time &gt;= #{startTime1}
<if test="endTime1 != '' and endTime1 != null"> <if test="endTime1 != '' and endTime1 != null">
AND a.apply_time &lt;= #{endTime1} AND a.apply_time &lt;= #{endTime1}
</if> </if>
</if> </if>
<if test="startTime2 != '' and startTime2 != null"> <if test="startTime2 != '' and startTime2 != null">
AND a.approve_time &gt;= #{startTime2} AND a.approve_time &gt;= #{startTime2}
<if test="endTime2 != '' and endTime2 != null"> <if test="endTime2 != '' and endTime2 != null">
AND a.approve_time &lt;= #{endTime2} AND a.approve_time &lt;= #{endTime2}
</if> </if>
</if> </if>
<if test="record.name != '' and record.name != null"> <if test="record.name != '' and record.name != null">
AND c.name LIKE '%${record.name}%' AND c.name LIKE '%${record.name}%'
</if> </if>
<if test="record.applyType != '' and record.applyType != null"> <if test="record.applyType != '' and record.applyType != null">
AND a.apply_type = ${record.applyType} AND a.apply_type = ${record.applyType}
</if> </if>
<if test="record.applyState != '' and record.applyState != null"> <if test="record.applyState != '' and record.applyState != null">
AND (CASE WHEN effe_time &lt;= GETDATE() THEN '已过期' WHEN apply_state='1' THEN '未提交' WHEN apply_state='2' THEN '已提交' END) = #{record.applyState} AND (CASE WHEN effe_time &lt;= GETDATE() THEN '已过期' WHEN apply_state='1' THEN '未提交' WHEN apply_state='2'
</if> THEN '已提交' END) = #{record.applyState}
<if test="record.approveState != '' and record.approveState != null"> </if>
AND (CASE WHEN effe_time &lt;= GETDATE() THEN '已过期' WHEN approve_state = '1' THEN '审核通过' WHEN approve_state='2' THEN '审核不通过' WHEN approve_state is null THEN '待审批' WHEN approve_state = '' THEN '待审批' END) = #{record.approveState} <if test="record.approveState != '' and record.approveState != null">
</if> AND (CASE WHEN effe_time &lt;= GETDATE() THEN '已过期' WHEN approve_state = '1' THEN '审核通过' WHEN
</where> approve_state='2' THEN '审核不通过' WHEN approve_state is null THEN '待审批' WHEN approve_state = '' THEN '待审批'
ORDER BY a.apply_time DESC END) = #{record.approveState}
</select> </if>
</where>
<!--根据id查询包括患者姓名的申请对象--> ORDER BY a.apply_time DESC
<select id="selectApproveById" resultMap="BaseResultMap"> </select>
<!--根据id查询包括患者姓名的申请对象-->
<select id="selectApproveById" resultMap="BaseResultMap">
SELECT SELECT
emr_apply_approve.id, emr_apply_approve.id,
emr_apply_approve.applyer, emr_apply_approve.applyer,
@ -532,10 +541,12 @@
a.inpatient_no, a.inpatient_no,
a.admiss_times, a.admiss_times,
a.approve_notes, a.approve_notes,
CASE WHEN effe_time &lt;= GETDATE() THEN '已过期' WHEN apply_state=1 THEN '未提交' WHEN apply_state=2 THEN '已提交' END apply_state, CASE WHEN effe_time &lt;= GETDATE() THEN '已过期' WHEN apply_state=1 THEN '未提交' WHEN apply_state=2 THEN '已提交' END
apply_state,
a.approver, a.approver,
a.approve_time, a.approve_time,
CASE WHEN effe_time &lt;= GETDATE() THEN '已过期' WHEN approve_state = 1 THEN '审核通过' WHEN approve_state=2 THEN '审核不通过' WHEN approve_state is null THEN '待审批' WHEN approve_state = '' THEN '待审批' END approve_state, CASE WHEN effe_time &lt;= GETDATE() THEN '已过期' WHEN approve_state = 1 THEN '审核通过' WHEN approve_state=2 THEN
'审核不通过' WHEN approve_state is null THEN '待审批' WHEN approve_state = '' THEN '待审批' END approve_state,
c.name, c.name,
CASE WHEN emr_lock.id is null THEN 0 ELSE 1 END lockStatus CASE WHEN emr_lock.id is null THEN 0 ELSE 1 END lockStatus
FROM FROM
@ -557,29 +568,29 @@
AND a.id IN (${checks}) AND a.id IN (${checks})
</where> </where>
</select> </select>
<!--批量插入--> <!--批量插入-->
<insert id="SimpleInsert" parameterType="java.util.List"> <insert id="SimpleInsert" parameterType="java.util.List">
INSERT INTO INSERT INTO
emr_apply_approve( emr_apply_approve(
applyer, apply_time, effe_time, effe_days, apply_type, apply_reason, apply_state, applyer, apply_time, effe_time, effe_days, apply_type, apply_reason, apply_state,
approver, approve_time, approve_state, approve_notes, patient_id, admiss_id, inpatient_no, approver, approve_time, approve_state, approve_notes, patient_id, admiss_id, inpatient_no,
admiss_times, dis_date admiss_times, dis_date
) )
<foreach collection="list" item="item" separator="union"> <foreach collection="list" item="item" separator="union">
select #{item.applyer,jdbcType=NVARCHAR}, #{item.applyTime,jdbcType=NCHAR}, select #{item.applyer,jdbcType=NVARCHAR}, #{item.applyTime,jdbcType=NCHAR},
#{item.effeTime,jdbcType=NCHAR}, #{item.effeDays,jdbcType=INTEGER}, #{item.applyType,jdbcType=NVARCHAR}, #{item.effeTime,jdbcType=NCHAR}, #{item.effeDays,jdbcType=INTEGER}, #{item.applyType,jdbcType=NVARCHAR},
#{item.applyReason,jdbcType=NVARCHAR}, #{item.applyState,jdbcType=NVARCHAR}, #{item.approver,jdbcType=NVARCHAR}, #{item.applyReason,jdbcType=NVARCHAR}, #{item.applyState,jdbcType=NVARCHAR},
#{item.approveTime,jdbcType=NCHAR}, #{item.approveState,jdbcType=NVARCHAR}, #{item.approveNotes,jdbcType=NVARCHAR}, #{item.approver,jdbcType=NVARCHAR},
#{item.patientId,jdbcType=VARCHAR}, #{item.admissId,jdbcType=CHAR}, #{item.inpatientNo,jdbcType=CHAR}, #{item.approveTime,jdbcType=NCHAR}, #{item.approveState,jdbcType=NVARCHAR},
#{item.admissTimes,jdbcType=SMALLINT}, #{item.disDate,jdbcType=TIMESTAMP} #{item.approveNotes,jdbcType=NVARCHAR},
</foreach> #{item.patientId,jdbcType=VARCHAR}, #{item.admissId,jdbcType=CHAR}, #{item.inpatientNo,jdbcType=CHAR},
#{item.admissTimes,jdbcType=SMALLINT}, #{item.disDate,jdbcType=TIMESTAMP}
</foreach>
</insert> </insert>
<!--查询未过期且审核通过--> <!--查询未过期且审核通过-->
<select id="selectIsPowerByUser" resultType="java.lang.Integer"> <select id="selectIsPowerByUser" resultType="java.lang.Integer">
SELECT SELECT
COUNT(1) COUNT(1)
FROM emr_apply_approve FROM emr_apply_approve
where approve_state = 1 where approve_state = 1
AND effe_time > GETDATE() AND effe_time > GETDATE()
@ -597,53 +608,53 @@
<!--批量更新--> <!--批量更新-->
<update id="SimpleUpdate"> <update id="SimpleUpdate">
update emr_apply_approve update emr_apply_approve
<set > <set>
<if test="record.applyer != null" > <if test="record.applyer != null">
applyer = #{record.applyer,jdbcType=NVARCHAR}, applyer = #{record.applyer,jdbcType=NVARCHAR},
</if> </if>
<if test="record.applyTime != null" > <if test="record.applyTime != null">
apply_time = #{record.applyTime,jdbcType=NCHAR}, apply_time = #{record.applyTime,jdbcType=NCHAR},
</if> </if>
<if test="record.effeTime != null" > <if test="record.effeTime != null">
effe_time = #{record.effeTime,jdbcType=NCHAR}, effe_time = #{record.effeTime,jdbcType=NCHAR},
</if> </if>
<if test="record.effeDays != null" > <if test="record.effeDays != null">
effe_days = #{record.effeDays,jdbcType=INTEGER}, effe_days = #{record.effeDays,jdbcType=INTEGER},
</if> </if>
<if test="record.applyType != null" > <if test="record.applyType != null">
apply_type = #{record.applyType,jdbcType=NVARCHAR}, apply_type = #{record.applyType,jdbcType=NVARCHAR},
</if> </if>
<if test="record.applyReason != null" > <if test="record.applyReason != null">
apply_reason = #{record.applyReason,jdbcType=NVARCHAR}, apply_reason = #{record.applyReason,jdbcType=NVARCHAR},
</if> </if>
<if test="record.applyState != null" > <if test="record.applyState != null">
apply_state = #{record.applyState,jdbcType=NVARCHAR}, apply_state = #{record.applyState,jdbcType=NVARCHAR},
</if> </if>
<if test="record.approver != null" > <if test="record.approver != null">
approver = #{record.approver,jdbcType=NVARCHAR}, approver = #{record.approver,jdbcType=NVARCHAR},
</if> </if>
<if test="record.approveTime != null" > <if test="record.approveTime != null">
approve_time = #{record.approveTime,jdbcType=NCHAR}, approve_time = #{record.approveTime,jdbcType=NCHAR},
</if> </if>
<if test="record.approveState != null" > <if test="record.approveState != null">
approve_state = #{record.approveState,jdbcType=NVARCHAR}, approve_state = #{record.approveState,jdbcType=NVARCHAR},
</if> </if>
<if test="record.approveNotes != null" > <if test="record.approveNotes != null">
approve_notes = #{record.approveNotes,jdbcType=NVARCHAR}, approve_notes = #{record.approveNotes,jdbcType=NVARCHAR},
</if> </if>
<if test="record.patientId != null" > <if test="record.patientId != null">
patient_id = #{record.patientId,jdbcType=VARCHAR}, patient_id = #{record.patientId,jdbcType=VARCHAR},
</if> </if>
<if test="record.admissId != null" > <if test="record.admissId != null">
admiss_id = #{record.admissId,jdbcType=CHAR}, admiss_id = #{record.admissId,jdbcType=CHAR},
</if> </if>
<if test="record.inpatientNo != null" > <if test="record.inpatientNo != null">
inpatient_no = #{record.inpatientNo,jdbcType=CHAR}, inpatient_no = #{record.inpatientNo,jdbcType=CHAR},
</if> </if>
<if test="record.admissTimes != null" > <if test="record.admissTimes != null">
admiss_times = #{record.admissTimes,jdbcType=SMALLINT}, admiss_times = #{record.admissTimes,jdbcType=SMALLINT},
</if> </if>
<if test="record.disDate != null" > <if test="record.disDate != null">
dis_date = #{record.disDate,jdbcType=TIMESTAMP}, dis_date = #{record.disDate,jdbcType=TIMESTAMP},
</if> </if>
</set> </set>
@ -667,4 +678,12 @@
AND ( approve_state IS NULL OR approve_state = '' ) AND ( approve_state IS NULL OR approve_state = '' )
AND ( emr_lock.lock_state = 0 OR emr_lock.lock_state IS NULL ) AND ( emr_lock.lock_state = 0 OR emr_lock.lock_state IS NULL )
</select> </select>
<select id="selectByApplyerAndPatientId" resultMap="BaseResultMap" parameterType="java.lang.String">
select top 1 *
from emr_apply_approve
where applyer = #{userName}
and patient_id = #{patientId}
and apply_type = 4
order by id desc
</select>
</mapper> </mapper>

@ -1,70 +1,82 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.emr.dao.commomSearch.ScanPathMapper" > <mapper namespace="com.emr.dao.commomSearch.ScanPathMapper">
<resultMap id="BaseResultMap" type="com.emr.vo.commomSearch.ScanPathVo" > <resultMap id="BaseResultMap" type="com.emr.vo.commomSearch.ScanPathVo">
<result column="patient_id" property="patientId" jdbcType="VARCHAR" /> <result column="patient_id" property="patientId" jdbcType="VARCHAR"/>
<result column="inpatient_no" property="inpatientNo" jdbcType="VARCHAR" /> <result column="inpatient_no" property="inpatientNo" jdbcType="VARCHAR"/>
<result column="assort_id" property="assortId" jdbcType="VARCHAR" /> <result column="assort_id" property="assortId" jdbcType="VARCHAR"/>
<result column="scan_page" property="scanPage" jdbcType="VARCHAR" /> <result column="scan_page" property="scanPage" jdbcType="VARCHAR"/>
<result column="dis_date" property="disDate" jdbcType="TIMESTAMP" /> <result column="dis_date" property="disDate" jdbcType="TIMESTAMP"/>
<result column="fileRealPath" property="fileRealPath" jdbcType="VARCHAR" /> <result column="fileRealPath" property="fileRealPath" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<!--湛江、英德根据patientId集合查询图片路径--> <!--湛江、英德根据patientId集合查询图片路径-->
<select id="selectScanFileByPatientIds" resultMap="BaseResultMap" parameterType="java.lang.String"> <select id="selectScanFileByPatientIds" resultMap="BaseResultMap" parameterType="java.lang.String">
SELECT SELECT
dbo.t_scan_assort.assort_id, dbo.t_scan_assort.assort_id,
dbo.t_scan_assort.scan_page, dbo.t_scan_assort.scan_page,
(dbo.t_gdh_index.file_path+'\'+dbo.t_scan_assort.scan_page) fileRealPath (dbo.t_gdh_index.file_path+'\'+dbo.t_scan_assort.scan_page) fileRealPath
FROM FROM
dbo.t_gdh_index dbo.t_gdh_index
LEFT OUTER JOIN LEFT OUTER JOIN
dbo.t_scan_assort dbo.t_scan_assort
ON ON
dbo.t_gdh_index.patient_id = dbo.t_scan_assort.patient_id dbo.t_gdh_index.patient_id = dbo.t_scan_assort.patient_id
<where> <where>
dbo.t_scan_assort.patient_id in (${patientIds}) dbo.t_scan_assort.patient_id in (${patientIds})
<if test="assortIds != null"> <if test="assortIds != null">
AND dbo.t_scan_assort.assort_id in (${assortIds}) AND dbo.t_scan_assort.assort_id in (${assortIds})
</if> </if>
</where> </where>
ORDER BY ORDER BY
dbo.t_scan_assort.assort_id dbo.t_scan_assort.assort_id
</select> </select>
<!--脐血库、祈福根据patientId集合查询图片路径--> <!--脐血库、祈福根据patientId集合查询图片路径-->
<select id="selectScanFileByBloodPatientIds" resultMap="BaseResultMap" parameterType="java.lang.String"> <select id="selectScanFileByBloodPatientIds" resultMap="BaseResultMap" parameterType="java.lang.String">
SELECT SELECT
commomtable.patient_id, commomtable.patient_id,
commomtable.name, commomtable.name,
commomtable.inpatient_no, commomtable.inpatient_no,
commomtable.dis_date, commomtable.dis_date,
dbo.t_scan_assort.assort_id, dbo.t_scan_assort.assort_id,
dbo.t_scan_assort.scan_page, dbo.t_scan_assort.scan_page,
case case
when t_scan_assort.source = 1 when t_scan_assort.source = 1
then convert(nvarchar(255),dbo.commomtable.${flag})+'\'+dbo.t_scan_assort.scan_page then convert(nvarchar(255),dbo.commomtable.${flag})+'\'+dbo.t_scan_assort.scan_page
when t_scan_assort.source = 2 when t_scan_assort.source = 2
then convert(nvarchar(255),dbo.commomtable.new_path)+'\'+dbo.t_scan_assort.scan_page then convert(nvarchar(255),dbo.commomtable.new_path)+'\'+dbo.t_scan_assort.scan_page
end fileRealPath end fileRealPath
FROM FROM
dbo.commomtable dbo.commomtable
LEFT OUTER JOIN LEFT OUTER JOIN
dbo.t_scan_assort dbo.t_scan_assort
ON ON
dbo.commomtable.patient_id = dbo.t_scan_assort.patient_id dbo.commomtable.patient_id = dbo.t_scan_assort.patient_id
LEFT OUTER JOIN LEFT OUTER JOIN
dbo.zd_assort dbo.zd_assort
ON ON
dbo.zd_assort.assort_id = dbo.t_scan_assort.assort_id dbo.zd_assort.assort_id = dbo.t_scan_assort.assort_id
<where> <where>
dbo.commomtable.patient_id in (${patientIds}) dbo.commomtable.patient_id in (${patientIds})
AND t_scan_assort.is_del != 1 AND t_scan_assort.is_del != 1
<if test="assortIds != null"> <if test="assortIds != null">
AND dbo.t_scan_assort.scan_page in (${assortIds}) AND dbo.t_scan_assort.scan_page in (${assortIds})
</if> </if>
</where> </where>
ORDER BY ORDER BY
dbo.zd_assort.assort_sort dbo.zd_assort.assort_sort
</select> </select>
<update id="updateScanFileByPatientIdAndScanPage" parameterType="java.lang.String">
${sql}
</update>
<select id="selectCountPh" resultType="java.lang.Integer">
SELECT COUNT(*) FROM dbo.t_gdh_index GROUP BY ph
</select>
<select id="selectCountPdf" resultType="java.lang.Integer">
SELECT COUNT(*) FROM dbo.t_scan_assort
</select>
</mapper> </mapper>

@ -162,6 +162,28 @@
</where> </where>
ORDER BY create_date DESC,log_id DESC ORDER BY create_date DESC,log_id DESC
</select> </select>
<select id="selectAllByFont" resultMap="BaseResultMap">
SELECT
*
FROM
emr_log
WHERE
log_title Like '%接口%'
<if test="record.logContent != '' and record.logContent != null">
AND log_content LIKE '%${record.logContent}%'
</if>
<if test="record.creater != '' and record.creater != null">
AND creater LIKE '%${record.creater}%'
</if>
<if test="startTime != '' and startTime != null">
AND create_date >= #{startTime}
</if>
<if test="endTime != '' and endTime != null">
AND create_date &lt;= #{endTime}
</if>
AND sys_flag = 'emr_record'
ORDER BY create_date DESC,log_id DESC
</select>
<select id="selectObjectByKey" resultType="java.util.Map"> <select id="selectObjectByKey" resultType="java.util.Map">
select * from ${tableName} where ${whereSql} select * from ${tableName} where ${whereSql}
</select> </select>

@ -526,13 +526,11 @@
</div> </div>
</div> </div>
<script> <script>
/*$(function () {
$(".modal-dialog").draggable();//为模态对话框添加拖拽
})*/
var time = new Date().getTime(); var time = new Date().getTime();
document.write('<script src="${path}/static/js/approveManage/approveList/approveList174.js?t=' + time + '"><\/script>') document.write('<script src="${path}/static/js/approveManage/approveList/approveList174.js?t=' + time + '"><\/script>')
document.write('<script src="${path}/static/js/approveManage/approveList/approveDateCommmomMethod.js?t=' + time + '"><\/script>') document.write('<script src="${path}/static/js/approveManage/approveList/approveDateCommmomMethod.js?t=' + time + '"><\/script>')
document.write('<script src="${path}/static/js/approveManage/approveList/approveSaveCommomMethod.js?t=' + time + '"><\/script>') document.write('<script src="${path}/static/js/approveManage/approveList/approveSaveCommomMethod.js?t=' + time + '"><\/script>')
document.write('<script src="${path}/static/js/recordManage/templateSearch/searchCommomMethodqf.js?t=' + time + '"><\/script>')
document.write('<script src="${path}/static/js/dateUtil.js?t=' + time + '"><\/script>') document.write('<script src="${path}/static/js/dateUtil.js?t=' + time + '"><\/script>')
document.write('<script src="${path}/static/js/commom.js?t=' + time + '"><\/script>') document.write('<script src="${path}/static/js/commom.js?t=' + time + '"><\/script>')
</script> </script>
@ -543,3 +541,4 @@
<script src="${path}/static/js/dateUtil.js"></script>--%> <script src="${path}/static/js/dateUtil.js"></script>--%>
</body> </body>
</html> </html>

@ -521,7 +521,7 @@
</script> </script>
<script src="${path}/static/js/approveManage/collection/collectManage174.js?t=2019-11-20"></script> <script src="${path}/static/js/approveManage/collection/collectManage174.js?t=2019-11-20"></script>
<script src="${path}/static/js/approveManage/approveList/approveDateCommmomMethod.js"></script> <script src="${path}/static/js/approveManage/approveList/approveDateCommmomMethod.js"></script>
<script src="${path}/static/js/approveManage/approveList/approveSaveCommomMethod.js"></script> <script src="${path}/static/js/approveManage/approveList/approveSaveCommomMethodBlood.js"></script>
<script src="${path}/static/js/dateUtil.js"></script> <script src="${path}/static/js/dateUtil.js"></script>
</body> </body>
</html> </html>

@ -0,0 +1,720 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<c:set var="path" value="${pageContext.request.contextPath}"/>
<%@ include file="/WEB-INF/jspf/common.jspf" %>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>常用查询</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv=X-UA-Compatible IE=EmulateIE7>
<link rel="stylesheet" href="${path}/static/bootstrap-3.3.7/bootstrap-table-fixed-columns.css" type="text/css">
<link href="${path}/static/bootstrap-3.3.7/bower_components/select2/dist/css/select2.min.css" rel="stylesheet"/>
<script type="text/javascript"
src="${path}/static/bootstrap-3.3.7/bootstrap-table-fixed-columns.js?time=2019-12-25"></script>
<script type="text/javascript" src="${path}/static/js/pinying.js"></script>
<script src="${path}/static/bootstrap-3.3.7/bower_components/select2/dist/js/select2.min.js"></script>
<script>
var path = "${path}";\
console.log(path);
</script>
<style type="text/css">
.labelDiv {
padding-top: 2%;
padding-right: 0;
text-align: right;
}
.radioDiv {
padding-top: 2%;
}
.btns {
background-color: #fff;
text-align: right;
margin-top: -15px;
margin-bottom: 5px;
}
.btn {
margin-left: -1%;
}
/*tableDiv*/
.tableDiv {
/*margin-top: 1%;*/
width: 100%;
background-color: #fff;
}
/*多选下拉框*/
.dropdown-menu {
position: absolute;
top: 103%;
left: 0;
z-index: 1000;
display: none;
float: left;
list-style: none;
text-shadow: none;
max-height: 400px;
/*设置最大高度为400 overflow: scroll;*/
/* 设置可滚动 padding: 5 px;*/
margin: 0px;
-webkit-box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1);
-moz-box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1);
box-shadow: 0 1px 8px rgba(120, 234, 61, 0.55);
font-size: 12px;
font-family: "Segoe UI", Helvetica, Arial, sans-serif;
border: 1px solid #ddd;
}
.TableView {
margin-left: 2%;
}
.form-group {
width: 110%;
}
/**级联病案号内容*/
.mouseOver {
background-color: #708090;
color: #FFFAFA;
}
.mouseOut {
background-color: #FFFAFA;
color: #000000;
}
/*模态框头*/
.modal-header {
background-color: #199ED8;
text-align: center;
}
/*搜索按钮div*/
.searchDiv {
margin-left: 33px;
}
/*清空按钮div*/
.clearDiv {
margin-left: 16px;
}
.col-sm-1, .col-sm-4 {
padding-left: 0 !important;
}
label {
font-weight: normal !important;
}
/**表格鼠标悬停样式*/
.table-hover > tbody > tr:hover > td,
.table-hover > tbody > tr:hover > th {
cursor: pointer;
}
.fht-cell {
width: 85px !important;
}
.table-hover > tbody > tr:hover > td,
.table-hover > tbody > tr:hover > th {
cursor: pointer;
}
.checkBoxClass {
cursor: pointer;
}
.row {
width: 100%;
}
.bootstrap-select {
margin-left: 3px !important;
height: 30px !important;
line-height: 30px !important;
}
form {
margin-bottom: 0 !important;
}
</style>
</head>
<body>
<div class="main">
<div class="headDiv">
<div class="headSpanDiv">
<span class="headspan">
常用查询
</span>
</div>
</div>
<!--搜索区-->
<div class="panel-group" id="accordion">
<div class="panel">
<div class="panel-heading" style="padding:0px 14px!important;">
<h5>
<a data-toggle="collapse" href="#b">
可收缩
</a>
</h5>
</div>
<div id="b" class="panel-collapse collapse in">
<div class="panel-body">
<form>
<!--查询的sql-->
<input type="hidden" id="sql">
<!--查询的菜单权限-->
<input type="hidden" id="powerMenu">
<!--登录者Id-->
<input type="hidden" id="userId" value="${CURRENT_USER.userId}">
<input type="hidden" id="roleId" value="${CURRENT_USER.roleId}">
<input type="hidden" id="userName" value="${CURRENT_USER.userName}">
<input type="hidden" id="powerMenus" value="${power_menus}">
<input type="hidden" id="showRecord" value="${CURRENT_USER.userTel}">
<input type="hidden" id="downloadRecord" value="${CURRENT_USER.userEmail}">
<input type="hidden" id="showPrint" value="${CURRENT_USER.userAge}">
<input type="hidden" id="flag" value="file_path">
<input type="hidden" id="cuserName" value="${cuserName}">
<!--查询的sql ORDER BY 语句-->
<input type="hidden" id="orderBys" value=" order by commomtable.name">
<!--该用户借阅申请的审批过了且未过期的病案不可重复申请可查看的病案主键patientId-->
<input type="hidden" id="approves">
<!--该用户下载申请的审批过了且未过期的病案不可重复申请可查看的病案主键patientId-->
<input type="hidden" id="loads">
<!--被锁的病案-->
<input type="hidden" id="locks">
<!--按条件搜索的patientIds-->
<input type="hidden" id="patientIds">
<!--类似自定义查询的搜索条件-->
<div id="block">
<div id="inputDiv">
<input type="hidden">
</div>
</div>
<!--表格头-->
<input type="hidden" id="tableThNames"
value="病案号,ID号,住院次数,姓名,性别,年龄_岁,年龄_月,入院日期,出院日期,出院科室,联系地址,主诊ICD码,主诊名称,主诊转归,住院天数,主治医生,其他诊断,病理诊断,损伤中毒,是否有手术">
<!--查询字段-->
<input type="hidden" id="englishFields"
value="commomtable.inpatient_no,commomtable.admiss_id,commomtable.admiss_times,commomtable.name,commomtable.sex,commomtable.age,commomtable.age_month,commomtable.admiss_date,commomtable.dis_date,commomtable.dis_dept,commomtable.home_addr,commomtable.main_diag_code,commomtable.main_diag_name,commomtable.main_dis_thing,commomtable.admiss_days,commomtable.attending,commomtable.other_diag_name,commomtable.pathology_name,commomtable.poisoning_name,commomtable.is_oper">
<!--数据字段-->
<input type="hidden" id="fields"
value="inpatientNo,admissId,admissTimes,name,sex,age,ageMonth,admissDate,disDate,disDept,homeAddr,mainDiagCode,mainDiagName,mainDisThing,admissDays,attending,otherDiagName,pathologyName,poisoningName,isOper">
<!--显示字段-->
<input type="hidden" id="fieldCns">
<!--查询总行数-->
<input type="hidden" id="rows">
<div class="row">
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-4 labelDiv">
<label class="control-label">姓名:</label>
</div>
<div class="col-sm-8 inputDiv">
<input type="text" class="form-control input-sm inputValue" id="name"
maxlength="16">
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-3 labelDiv">
<label class="control-label">年龄:</label>
</div>
<div style="float:left;width:20%;margin-left:4%">
<input type="number" class="form-control input-sm inputValue" id="age1" min="0"
oninput="if(value.length>9)value=value.slice(0,9)">
</div>
<div style="float:left;width:3%;margin-left:2%">-</div>
<div style="float:left;width:20%">
<input type="number" class="form-control input-sm inputValue" id="age2" min="0"
oninput="if(value.length>9)value=value.slice(0,9)">
</div>
<div style="float:left;width:20%;margin-left:2%">
<select class="form-control input-sm" id="ageType">
<option value="1">岁</option>
<option value="2">月</option>
<option value="3">日</option>
</select>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-2 labelDiv">
<label class="control-label">性别:</label>
</div>
<div class="col-sm-3 radioDiv">
<input type="radio" id="all" name="sex" checked value="" class="sexInput"><label
for="all" class="checkBoxClass">全部</label>
</div>
<div id="sex"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-4 labelDiv">
<label class="control-label">病案号:</label>
</div>
<div class="col-sm-8 inputDiv">
<input type="text" class="form-control input-sm inputValue" id="inpatient_no"
onkeyup="getInpatientNoContents('inpatient_no')"
onfocus="getInpatientNoContents('inpatient_no')"
onblur="clearContent('inpatient_no')">
<div id="inpatient_noDiv" style="position: absolute;z-index: 2000">
<table id="inpatient_noContent_table" bgcolor="#FFFAFA" border="0"
cellspacing="0" cellpadding="0">
<tbody id="inpatient_noContent"></tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-3 labelDiv">
<label class="control-label">ID号</label>
</div>
<div class="col-sm-9 inputDiv">
<input type="text" class="form-control input-sm inputValue" id="admiss_id"
maxlength="16">
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-3 labelDiv">
<label class="control-label">出院科室:</label>
</div>
<div class="col-sm-9 inputDiv">
<select class="selectpicker form-control input-sm inputValue" multiple
id="dis_dept" style="max-height:400px!important;overflow:scroll;"
data-live-search="true"></select>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-4 labelDiv">
<label class="control-label">主诊转归:</label>
</div>
<div class="col-sm-8 inputDiv">
<select class="form-control input-sm inputValue" id="dis_thing">
</select>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-3 labelDiv">
<label class="control-label">入院日期:</label>
</div>
<div class="col-sm-4 inputDiv">
<input type="text" class="form-control input-sm inputValue" id="startTime1"
style="margin-left: 15px" autocomplete="off">
</div>
<div class="col-sm-1" style="padding-top:2%">
<div style="margin-left: 50%">
</div>
</div>
<div class="col-sm-4 inputDiv">
<input type="text" class="form-control input-sm inputValue" id="endTime1"
autocomplete="off">
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-3 labelDiv">
<label class="control-label">出院日期:</label>
</div>
<div class="col-sm-4 inputDiv">
<input type="text" class="form-control input-sm inputValue" id="startTime2"
style="margin-left: 15px" autocomplete="off">
</div>
<div class="col-sm-1" style="padding-top:2%">
<div style="margin-left: 50%">
</div>
</div>
<div class="col-sm-4 inputDiv">
<input type="text" class="form-control input-sm inputValue" id="endTime2"
autocomplete="off">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-4 labelDiv">
<label class="control-label">主诊ICD码</label>
</div>
<div class="col-sm-8 inputDiv">
<input type="text" class="form-control input-sm otherTable diagTable inputValue"
id="diag_code" onkeyup="getDiagCodeContents('diag_code')"
onfocus="getDiagCodeContents('diag_code')"
onblur="clearContent('diag_code')" maxlength="16">
<div id="diag_codeDiv" style="position: absolute;z-index: 2000">
<table id="diag_codeContent_table" bgcolor="#FFFAFA" border="0"
cellspacing="0" cellpadding="0">
<tbody id="diag_codeContent"></tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-3 labelDiv">
<label class="control-label">主诊名称:</label>
</div>
<div class="col-sm-9 inputDiv">
<input type="text" class="form-control input-sm otherTable diagTable inputValue"
id="diag_name" onkeyup="getDiagNameContents('diag_name')"
onfocus="getDiagNameContents('diag_name')"
onblur="clearContent('diag_name')" maxlength="16">
<div id="diag_nameDiv" style="position: absolute;z-index: 2000">
<table id="diag_nameContent_table" bgcolor="#FFFAFA" border="0"
cellspacing="0" cellpadding="0">
<tbody id="diag_nameContent"></tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-3 labelDiv">
<label class="control-label">主诊编码范围:</label>
</div>
<div class="col-sm-4 inputDiv">
<input type="text" class="form-control input-sm inputValue" id="diag_code1"
style="margin-left: 15px">
</div>
<div class="col-sm-1" style="padding-top:2%;">
<div style="margin-left: 50%">
</div>
</div>
<div class="col-sm-4 inputDiv">
<input type="text" class="form-control input-sm inputValue" id="diag_code2">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-4 labelDiv">
<label class="control-label">手术编码:</label>
</div>
<div class="col-sm-8 inputDiv">
<input type="text" class="form-control input-sm otherTable operTable inputValue"
id="operate_code" onkeyup="getOperateCodeContents('operate_code')"
onfocus="getOperateCodeContents('operate_code')"
onblur="clearContent('operate_code')" maxlength="16">
<div id="operate_codeDiv" style="position: absolute;z-index: 2000">
<table id="operate_codeContent_table" bgcolor="#FFFAFA" border="0"
cellspacing="0" cellpadding="0">
<tbody id="operate_codeContent"></tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-3 labelDiv">
<label class="control-label">手术名称:</label>
</div>
<div class="col-sm-9 inputDiv">
<input type="text" class="form-control input-sm otherTable operTable inputValue"
id="operate_name" onkeyup="getOperateNameContents('operate_name')"
onfocus="getOperateNameContents('operate_name')"
onblur="clearContent('operate_name')" maxlength="16">
<div id="operate_nameDiv" style="position: absolute;z-index: 2000">
<table id="operate_nameContent_table" bgcolor="#FFFAFA" border="0"
cellspacing="0" cellpadding="0">
<tbody id="operate_nameContent"></tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-3 labelDiv">
<label class="control-label">手术编码范围:</label>
</div>
<div class="col-sm-4 inputDiv">
<input type="text" class="form-control input-sm inputValue" id="operate_code1"
style="margin-left: 15px">
</div>
<div class="col-sm-1" style="padding-top:2%">
<div style="margin-left: 50%">
</div>
</div>
<div class="col-sm-4 inputDiv">
<input type="text" class="form-control input-sm inputValue" id="operate_code2">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-4 labelDiv">
<label class="control-label">其他诊断:</label>
</div>
<div class="col-sm-8 inputDiv">
<input type="text" class="form-control input-sm otherTable diagTable inputValue"
id="other_diag_name" maxlength="100">
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-3 labelDiv">
<label class="control-label">病理诊断:</label>
</div>
<div class="col-sm-9 inputDiv">
<input type="text" class="form-control input-sm diagTable inputValue"
id="pathology_name" maxlength="100">
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-3 labelDiv">
<label class="control-label">其他诊断码范围:</label>
</div>
<div class="col-sm-4 inputDiv">
<input type="text" class="form-control input-sm inputValue"
id="other_diag_name1" style="margin-left: 15px">
</div>
<div class="col-sm-1" style="padding-top:2%">
<div style="margin-left: 50%">
</div>
</div>
<div class="col-sm-4 inputDiv">
<input type="text" class="form-control input-sm inputValue"
id="other_diag_name2">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-4 labelDiv">
<label class="control-label">全部诊断:</label>
</div>
<div class="col-sm-8 inputDiv">
<input type="text" class="form-control input-sm diagTable inputValue"
id="all_diag_name" maxlength="100">
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-3 labelDiv">
<label class="control-label">损伤中毒:</label>
</div>
<div class="col-sm-9 inputDiv">
<input type="text" class="form-control input-sm diagTable inputValue"
id="poisoning_name" maxlength="100">
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-3 labelDiv">
<label class="control-label">主治医生:</label>
</div>
<div class="col-sm-9 inputDiv">
<input type="text" class="form-control input-sm diagTable inputValue"
id="attending" maxlength="6">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-4 labelDiv">
<label class="control-label">科主任:</label>
</div>
<div class="col-sm-8 inputDiv">
<input type="text" class="form-control input-sm diagTable inputValue"
id="dept_director" maxlength="6">
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-3 labelDiv">
<label class="control-label">主任(副主任)</label>
</div>
<div class="col-sm-9 inputDiv">
<input type="text" class="form-control input-sm diagTable inputValue"
id="director" maxlength="6">
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-3 labelDiv">
<label class="control-label">住院医师:</label>
</div>
<div class="col-sm-9 inputDiv">
<input type="text" class="form-control input-sm diagTable inputValue"
id="admiss_doctor" maxlength="100">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-4 labelDiv"></div>
<div class="col-sm-8 inputDiv">
<input type="checkbox" id="isOper"
class="otherTable operTable isOperInput"><label for="isOper"
class="checkBoxClass">限手术</label>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="btns">
<div class="btn">
<button type="button" class="btn btn-sm btn-primary" onclick="search()">开始搜索</button>
</div>
<div class="btn">
<button type="button" class="btn btn-sm btn-default" onclick="clearForm()">&nbsp;&nbsp;清&nbsp;&nbsp;空&nbsp;&nbsp;</button>
</div>
<div class="btn" id="borrowingsBox">
<button type="button" class="btn btn-sm btn-primary" id="borrowings" onclick="borrowings()">批量借阅申请
</button>
</div>
<div class="btn">
<button type="button" class="btn btn-sm btn-default" data-toggle="modal" data-target="#myModal2" onclick="clearForm()">申请信息查询</button>
</div>
</div>
<!--数据表格-->
<div id="tableDiv" class="table-responsive tableDiv table-hover" style="overflow:scroll;">
<table id="mytab" class="table text-nowrap table-bordered" data-toggle="table" data-height="200">
</table>
</div>
<!-- 模态框1Modal借阅申请 -->
<div class="modal fade" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
<font size="30">&times;</font>
</button>
<h4 class="modal-title" style="font-weight: bold">
申请信息
</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" role="form">
<!--隐藏申请过的集合input Id-->
<input type="hidden" name="formToken" id="formToken" value="${formToken}">
<input type="hidden" id="checks">
<input type="hidden" id="typeId">
<div class="row">
<div class="form-group">
<label class="col-sm-4 control-label">有效时间:</label>
<div class="col-sm-7">
<input type="text" class="form-control input-sm input" id="effeTime" name="effeTime"
maxlength="10" autocomplete="off">
</div>
<div class="col-sm-1"></div>
</div>
</div>
<div class="row">
<div class="form-group">
<label class="col-sm-4 control-label">申请天数:</label>
<div class="col-sm-7">
<input type="number" class="form-control input-sm input" id="effeDays"
name="effeDays" oninput="if(value.length>3)value=value.slice(0,3)" readonly>
</div>
<div class="col-sm-1"></div>
</div>
</div>
<div class="row">
<div class="form-group">
<label class="col-sm-4 control-label">申请类型:</label>
<div class="col-sm-7">
<input class="form-control input-sm input" name="applyType"
id="applyType" value="接口借阅申请" readonly>
</div>
<div class="col-sm-1"></div>
</div>
</div>
<div class="row">
<div class="form-group">
<label class="col-sm-4 control-label">申请理由:</label>
<div class="col-sm-7">
<textarea class="form-control input-sm input" id="applyReason" name="applyReason"
maxlength="250"></textarea>
</div>
<div class="col-sm-1"></div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-sm btn-default" data-dismiss="modal">
关闭
</button>
<button type="button" class="btn btn-sm btn-primary" onclick="addApprove()">
确认提交
</button>
</div>
</div>
</div>
</div>
<!-- 模态框2Modal申请查询 -->
<div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><font size="30">&times;</font></button>
<h4 class="modal-title" style="font-weight: bold">申请信息</h4>
</div>
<div class="modal-body">
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="${path}/static/js/font/commomListSouth.js"></script>
<script type="text/javascript" src="${path}/static/js/recordManage/templateSearch/searchCommomMethodqf.js"></script>
<script type="text/javascript" src="${path}/static/js/dateUtil.js"></script>
<script type="text/javascript" src="${path}/static/js/approveManage/approveList/approveDateCommmomMethod.js"></script>
<script type="text/javascript" src="${path}/static/js/commom.js"></script>
</body>
</html>

@ -47,6 +47,7 @@
</head> </head>
<body> <body>
<input type="hidden" id="inpatientNo" value="${inpatientNo}"> <input type="hidden" id="inpatientNo" value="${inpatientNo}">
<input type="hidden" id="userName" value="${userName}">
<div class="main"> <div class="main">
<div class="headDiv"> <div class="headDiv">
<div class="headSpanDiv"> <div class="headSpanDiv">

@ -0,0 +1,139 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<c:set var="path" value="${pageContext.request.contextPath}"/>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>预览列表</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv=X-UA-Compatible IE=EmulateIE7>
<!--[if lt IE 9]>
<script src="${path}/static/js/jquery-1.11.3.min.js"></script>
<script src="${path}/static/js/html5shiv.js"></script>
<script src="${path}/static/js/respond.min.js"></script>
<![endif]-->
<%@ include file="/WEB-INF/jspf/common.jspf" %>
<script>
var path = "${path}";
</script>
<style type="text/css">
body {
margin-right: -15px;
margin-bottom: -15px;
}
.mainDiv{
background-color: #fff;
height:100%;
}
.tableDiv{
width: 100%;
height: 90%;
background-color: #fff;
margin-left: 1%;
padding-top:5px;
}
.table-hover > tbody > tr:hover > td,
.table-hover > tbody > tr:hover > th {
cursor: pointer;
}
</style>
</head>
<body>
<input type="hidden" id="inpatientNo" value="${inpatientNo}">
<input type="hidden" id="userName" value="${userName}">
<input type="hidden" id="deptName" value="${deptName}">
<div class="main">
<div class="headDiv">
<div class="headSpanDiv">
<span class="headspan">
预览列表
</span>
</div>
</div>
<div class="mainDiv">
<!--数据表格-->
<div id="tableDiv" class="tableDiv table-responsive table-hover">
<table id="mytab" class="table text-nowrap table-bordered">
</table>
</div>
</div>
</div>
<!-- 模态框1Modal借阅申请 -->
<div class="modal fade" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
<font size="30">&times;</font>
</button>
<h4 class="modal-title" style="font-weight: bold">
申请信息
</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" role="form">
<input type="hidden" name="formToken" id="formToken" value="${formToken}">
<input type="hidden" id="check">
<input type="hidden" id="approveId">
<!--隐藏申请过的集合input Id-->
<input type="hidden" id="typeId">
<div class="row">
<div class="form-group">
<label class="col-sm-4 control-label">有效时间:</label>
<div class="col-sm-7">
<input type="text" class="form-control input-sm input" id="effeTime" name="effeTime"
maxlength="10" autocomplete="off">
</div>
<div class="col-sm-1"></div>
</div>
</div>
<div class="row">
<div class="form-group">
<label class="col-sm-4 control-label">申请天数:</label>
<div class="col-sm-7">
<input type="number" class="form-control input-sm input" id="effeDays"
name="effeDays" oninput="if(value.length>3)value=value.slice(0,3)" readonly>
</div>
<div class="col-sm-1"></div>
</div>
</div>
<div class="row">
<div class="form-group">
<label class="col-sm-4 control-label">申请类型:</label>
<div class="col-sm-7">
<input class="form-control input-sm input" name="applyType"
id="applyType" value="接口借阅申请" readonly>
</div>
<div class="col-sm-1"></div>
</div>
</div>
<div class="row">
<div class="form-group">
<label class="col-sm-4 control-label">申请理由:</label>
<div class="col-sm-7">
<textarea class="form-control input-sm input" id="applyReason" name="applyReason"
maxlength="250"></textarea>
</div>
<div class="col-sm-1"></div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-sm btn-default" data-dismiss="modal">关闭
</button>
<button type="button" class="btn btn-sm btn-primary" onclick="addApprove()">
确认提交
</button>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="${path}/static/js/font/recordListSouth.js"></script>
<script type="text/javascript" src="${path}/static/js/dateUtil.js"></script>
<script type="text/javascript" src="${path}/static/js/recordManage/templateSearch/searchCommomMethodqf.js"></script>
<script type="text/javascript" src="${path}/static/js/approveManage/approveList/approveDateCommmomMethod.js"></script>
</body>
</html>

@ -22,7 +22,7 @@
onselect=document.selection.empty()> onselect=document.selection.empty()>
<div> <div>
<p style="margin-top:-50px;margin-bottom:0px;" media="print" class="noprint"> <p style="margin-top:-50px;margin-bottom:0px;" media="print" class="noprint">
<object classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" id="Pdf1" width="100%" height="120%" media="print" <object classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" id="Pdf1" width="100%" height="800px;" media="print"
oncontextmenu="return false" oncontextmenu="return false"
ondragstart="return false" ondragstart="return false"
onselectstart="return false" onselectstart="return false"

@ -0,0 +1,184 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<c:set var="path" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>预览PDF</title>
<meta http-equiv=X-UA-Compatible IE=EmulateIE7>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<!--[if lt IE 9]>
<script src="${path}/static/js/jquery-1.11.3.min.js"></script>
<script src="${path}/static/js/html5shiv.js"></script>
<script src="${path}/static/js/respond.min.js"></script>
<![endif]-->
<link rel="shortcut icon" href="${path}/static/js/favicon.ico">
<link rel="stylesheet" href="${path}/static/css/comm.css"/>
<script src="${path}/static/js/jquery-1.11.3.min.js"></script>
<script>
var path = "${path}";
</script>
<style type="text/css">
html,body{
width:100%;
height:100%;
margin:0;
padding:0;
background-color: #F2F2F2;
}
.searchDiv{
width:100%;
height:87px;
background-color: #FFF;
}
.contentDiv{
width:100%;
height:calc(100% - 135px);
margin-top:5px;
background-color: #FFF;
}
.labelDiv{
width:41.66%;
text-align: right;
float: left;
margin-top: 5px;
}
.textInputDiv{
width:58.33%;
float: left;
}
.rowDiv{
padding-top:10px;
width:100%;
height:30px;
}
.inputDiv{
width:24%;
float: left;
}
h4{
color: #fff;
font-size: 1.0em;
font-weight: bold;
}
hr{
margin:0!important;
}
.seal-result{
width: 60px;
height: 60px;
transform: rotate(30deg);
border: solid 2px red;
border-radius: 100%;
text-align: center;
color: red;
font-size: 16px;
font-weight: bold;
line-height: 60px;
left: 20%;
top: 6%;
position: absolute;
background-color: rgba(255,255,255,0.8);
z-index: 1000;
}
.main{
width: 100%;
height:100%;
background-color: #c1d7e3;
}
</style>
</head>
<body style="scroll:auto" onkeydown="disabledPrint()">
<input hidden type="hidden" id="patientId" value="${patientId}">
<input type="hidden" id="userName" value="${userName}">
<input type="hidden" id="deptName" value="${deptName}">
<!--174、祈福医院扫描图片存放根目录的字段-->
<input hidden type="hidden" id="flag" value="file_path">
<!--存放扫描图片和新上传图片根目录的集合-->
<input hidden type="hidden" id="rootPaths">
<div class="main">
<div class="headDiv">
<div class="headSpanDiv">
<span class="headspan">
病案浏览
</span>
</div>
</div>
<!--病案详情-->
<div class="searchDiv">
<input type="hidden" id="admissId" value="${commom.admissId}">
<div class="rowDiv">
<div class="inputDiv">
<div class="form-group">
<label class="control-label labelDiv">病案号:</label>
<div class="textInputDiv">
<input type="text" readonly class="form-control input input-sm inpatientNo" id="inpatientNo" onmouseover="this.title=this.value">
</div>
</div>
</div>
<div class="inputDiv">
<div class="form-group">
<label class="control-label labelDiv">姓名:</label>
<div class="textInputDiv">
<input type="text" readonly class="form-control input-sm input" id="name">
</div>
</div>
</div>
<div class="inputDiv">
<div class="form-group">
<label class="control-label labelDiv">住院次数:</label>
<div class="textInputDiv">
<select class="form-control input input-sm admissTimes" id="admissTimes" disabled></select>
</div>
<div type="hidden" id="admissTimesValue"></div>
</div>
</div>
<c:if test="${printCount == '1'}">
<div class="seal-result">已打印</div>
</c:if>
<div class="inputDiv">
<div class="form-group">
<label class="control-label labelDiv">出院日期:</label>
<div class="textInputDiv">
<input type="text" readonly class="form-control input-sm input" id="disDate">
</div>
</div>
</div>
</div>
<div class="rowDiv" style="padding-top:20px;">
<div class="inputDiv">
<div class="form-group">
<label class="control-label labelDiv">出院科室:</label>
<div class="textInputDiv">
<input type="text" readonly class="form-control input-sm input" id="disDeptName">
</div>
</div>
</div>
<div class="inputDiv">
<div class="form-group">
<label class="control-label labelDiv">主要诊断:</label>
<div class="textInputDiv">
<input type="text" readonly class="form-control input-sm input" id="diagName">
</div>
</div>
</div>
<div class="inputDiv">
<div class="form-group">
<label class="control-label labelDiv">其他诊断:</label>
<div class="textInputDiv">
<input type="text" readonly class="form-control input-sm input otherDiagName" id="otherDiagName">
</div>
</div>
</div>
</div>
</div>
<div class="contentDiv">
<iframe width="100%" height="100%" src="" id="iframe" frameborder="0" scrolling="no"></iframe>
</div>
</div>
<script type="text/javascript" src="${path}/static/js/font/showRecordFontSouth.js"></script>
<script type="text/javascript" src="${path}/static/js/font/showRecordIframeBloodCommom.js"></script>
</body>
</html>

@ -52,7 +52,7 @@
} }
.loading { .loading {
width: 160px; width: 160px;
height: 56px; height:100%;
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;

@ -0,0 +1,115 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<c:set var="path" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>预览pdfIframe页面</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv=X-UA-Compatible IE=EmulateIE7>
<!--[if lt IE 9]>
<script type="text/javascript" src="${path}/static/js/html5shiv.js"></script>
<script type="text/javascript" src="${path}/static/js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="${path}/static/js/respond.min.js"></script>
<![endif]-->
<%--<%@ include file="/WEB-INF/jspf/common.jspf" %>--%>
<link rel="stylesheet" href="${path}/static/css/comm.css"/>
<link rel="stylesheet" href="${path}/static/js/font/style.min.css" />
<script type="text/javascript" src="${path}/static/js/jquery-1.11.3.min.js"></script>
<script src="${path}/static/js/font/jstree.min.js"></script>
<script>
var path = "${path}";
</script>
<style type="text/css">
html,body{
width:100%;
height:100%;
margin:0;
padding:0;
background-color: #F2F2F2;
}
.content-left{
height:100%;
width:23%;
float:left;
background-color: #FFFFFF;
overflow-y: auto;
}
.content-right{
height:100%;
width:76%;
float:right;
padding-left:5px;
background-color: #FFFFFF;
}
.btnDiv{
text-align: right;
}
.btn{
background-color: #1D9ED7;
}
.loading {
width: 160px;
height: 56px;
position: absolute;
top: 50%;
left: 50%;
line-height: 56px;
color: #fff;
padding-left: 60px;
font-size: 15px;
background: #000;
opacity: 0.7;
z-index: 9999;
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
border-radius: 20px;
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=70);
}
</style>
</head>
<body style="scroll:auto" onkeydown="disabledPrint()">
<div id="myModal" class="modal fade" data-keyboard="false"
data-backdrop="static" data-role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div id="loading1" class="loading">加载中。。。</div>
</div>
<input hidden type="hidden" id="patientId" value="${patientId}">
<input type="hidden" id="userName" value="${userName}">
<input type="hidden" id="deptName" value="${deptName}">
<!--初始化及树复选框勾选的文件名称集合-->
<input hidden type="hidden" id="assortIds">
<!--初始化及树复选框勾选的文件来源集合-->
<input hidden type="hidden" id="sources">
<!--树节点点击选中的文件名称-->
<input hidden type="hidden" id="assortIdByClick">
<!--树节点点击选中的文件来源-->
<input hidden type="hidden" id="sourceByClick">
<input hidden type="hidden" id="flag" value="${flag}">
<!--是否有打印权限-->
<input hidden type="hidden" id="print" value="${printFlag}">
<!--文件路径-->
<input hidden type="hidden" id="filePath">
<!--定义iframe1加载完成标识-->
<input hidden type="hidden" id="iframeLoad">
<!--定义打印预览的图片加载完成标识-->
<input hidden type="hidden" id="printPicLoaded">
<!--定义打印预览的图片加载进度-->
<input type="hidden" id="loading">
<div class="content-left">
<div class="form-group">
<div class="btnDiv">
<button type="button" class="btn" onclick="onloadPdf()">加载PDF</button>
</div>
<div id="data" class="demo"></div>
</div>
</div>
<div class="content-right">
<iframe width="100%" height="100%" src="" id="iframe1" frameborder="0" onkeydown="disabledPrint()"></iframe>
</div>
<script type="text/javascript" src="${path}/static/js/font/showRecordIframeSouthFont.js"></script>
<script type="text/javascript" src="${path}/static/js/font/showRecordIframeBloodCommom.js"></script>
</body>
</html>

@ -0,0 +1,163 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<c:set var="path" value="${pageContext.request.contextPath}"/>
<%@ include file="/WEB-INF/jspf/common.jspf" %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>其他管理</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv=X-UA-Compatible IE=EmulateIE7>
<!--[if lt IE 9]>
<script type="text/javascript" src="${path}/static/js/html5shiv.min.js"></script>
<script type="text/javascript" src="${path}/static/js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="${path}/static/js/respond.min.js"></script>
<![endif]-->
<script>
var path = "${path}";
</script>
<style type="text/css">
.mainDiv {
background-color: #fff;
}
/**搜索区*/
.searchDiv {
padding-top: 10px;
width: 100%;
height: 30px;
}
.dateSearchDiv {
width: 29%;
}
.dateSearchInput {
width: 30%;
margin-left: 5px;
}
.dateLabelDiv {
width: 30%;
text-align: right;
}
.searchInput {
width: 21%;
margin-left: 5px;
text-align: right;
}
.searchElement {
width: 40%;
}
.searchInputElement {
width: 60%;
}
.labelDiv {
padding-top: 4%;
margin-left: 2%;
}
/**查询按钮组*/
.btnsDiv {
margin-top: 15px;
height: 35px;
text-align: right;
margin-right: 25px;
}
.btns {
margin-left: 2%;
}
/**表格div*/
.tableDiv {
margin-left: 1%;
margin-top: -15px;
}
</style>
</head>
<body>
<div class="main">
<div class="headDiv">
<div class="headSpanDiv">
<span class="headspan">
接口日志管理
</span>
</div>
</div>
<div class="mainDiv">
<div class="searchDiv">
<div class="searchInput left" style="margin-left: 10px;">
<div class="searchElement left">
<label class="labelDiv">日志主题:</label>
</div>
<div class="searchInputElement left">
<input type="text" class="form-control input-sm" id="logTitle">
</div>
</div>
<div class="searchInput left">
<div class="searchElement left">
<label class="labelDiv">日志内容:</label>
</div>
<div class="searchInputElement left">
<input type="text" class="form-control input-sm" id="logContent">
</div>
</div>
<div class="searchInput left">
<div class="searchElement left">
<label class="labelDiv">操作人:</label>
</div>
<div class="searchInputElement left">
<input type="text" class="form-control input-sm" id="creater">
</div>
</div>
<div class="dateSearchDiv left">
<div class="dateLabelDiv left">
<label class="labelDiv">操作时间:</label>
</div>
<div class="dateSearchInput left">
<input type="text" class="form-control input-sm" id="startTime1" placeholder="开始时间"
autocomplete="off">
</div>
<div class="dateSearchInput left">
<input type="text" class="form-control input-sm" id="endTime1" placeholder="结束时间"
autocomplete="off">
</div>
</div>
<div class="left">
<button type="button" class="btn btn-sm btn-primary" onclick="refreshTable()">查询</button>
</div>
</div>
<div class="btnsDiv">
<shiro:hasPermission name="/otherManage/exportExcel">
<button type="button" class="btn btn-sm btn-primary btns" onclick="exportExcel()"><i
class="fa fa-reply"></i>导出
</button>
</shiro:hasPermission>
<shiro:hasPermission name="/otherManage/deleteLogByIds">
<button type="button" class="btn btn-sm btn-danger btns" onclick="deleteLogByIds()">批量删除</button>
</shiro:hasPermission>
</div>
<!--数据表格-->
<div id="tableDiv" class="tableDiv">
<input type="hidden" id="checks">
<table id="mytab" class="table text-nowrap table-bordered">
</table>
</div>
</div>
<%-- <div class="tab-pane fade" id="tab3">
<p>通知管理</p>
</div>
</div>--%>
</div>
</div>
<script type="text/javascript" src="${path}/static/js/otherManage/interfaceDatabase.js"></script>
<script type="text/javascript" src="${path}/static/js/dateUtil.js"></script>
</body>
</html>

@ -27,39 +27,48 @@
margin-right: -15px; margin-right: -15px;
margin-bottom: -15px; margin-bottom: -15px;
} }
.mainDiv { .mainDiv {
background-color: #fff; background-color: #fff;
} }
.timeShow { .timeShow {
height: 50px; height: 50px;
} }
.colorBack1 { .colorBack1 {
width: 29%; width: 29%;
height: 13%; height: 13%;
float: left; float: left;
border-radius: 60px; border-radius: 60px;
} }
.colorBack2 { .colorBack2 {
width: 30%; width: 30%;
height: 12%; height: 12%;
float: left; float: left;
border-radius: 60px; border-radius: 60px;
} }
.textBack1 { .textBack1 {
margin-top: 17%; margin-top: 17%;
} }
.textBack2 { .textBack2 {
margin-top: 15%; margin-top: 15%;
} }
.textNum { .textNum {
font-size: 18px; font-size: 18px;
} }
.welcomeInfo { .welcomeInfo {
float: left; float: left;
margin-right: 5%; margin-right: 5%;
color: #2aabd2; color: #2aabd2;
font-size: 22px; font-size: 22px;
} }
.companyInfo { .companyInfo {
margin-top: 8px; margin-top: 8px;
color: #2aabd2; color: #2aabd2;
@ -120,15 +129,17 @@
<div class="row" style="margin-top: 40px;"> <div class="row" style="margin-top: 40px;">
<div class="col-md-8 col-md-offset-2"> <div class="col-md-8 col-md-offset-2">
<div class="col-md-4"> <div class="col-md-4">
<div class="colorBack2" style="background: #00a65a;"></div> <a onclick="pdfDownloadClick()" style="cursor: pointer">
<div class="textBack2"> <div class="colorBack2" style="background: #00a65a;"></div>
<div class="textNum" style="color: #00a65a"> <div class="textBack2">
${emrDownloadInfoNum} <div class="textNum" style="color: #00a65a">
</div> ${emrDownloadInfoNum}
<div> </div>
下载量 <div>
下载量
</div>
</div> </div>
</div> </a>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="colorBack2" style="background: #027dc1;"></div> <div class="colorBack2" style="background: #027dc1;"></div>
@ -154,6 +165,32 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row" style="margin-top: 25px;">
<div class="col-md-6 col-md-offset-3">
<div class="col-md-6">
<div class="colorBack1" style="background: #F1D031;"></div>
<div class="textBack1">
<div class="textNum" style="color: #F1D031">
<strong>${phCount}</strong>
</div>
<div class="text">
病案总盘数
</div>
</div>
</div>
<div class="col-md-6">
<div class="colorBack1" style="background: #ff5500;"></div>
<div class="textBack1">
<div class="textNum" style="color: #ff5500">
${pdfCount}
</div>
<div>
病案图像总数
</div>
</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
<script type="text/javascript" src="${path}/static/js/otherManage/monitoringCenter.js"></script> <script type="text/javascript" src="${path}/static/js/otherManage/monitoringCenter.js"></script>

@ -80,9 +80,11 @@
font-family: "Segoe UI", Helvetica, Arial, sans-serif; font-family: "Segoe UI", Helvetica, Arial, sans-serif;
border: 1px solid #ddd; border: 1px solid #ddd;
} }
.TableView { .TableView {
margin-left: 2%; margin-left: 2%;
} }
.form-group { .form-group {
width: 110%; width: 110%;
} }
@ -330,13 +332,17 @@
<label class="control-label">入院日期:</label> <label class="control-label">入院日期:</label>
</div> </div>
<div class="col-sm-4 inputDiv"> <div class="col-sm-4 inputDiv">
<input type="text" class="form-control input-sm inputValue" id="startTime1" style="margin-left: 15px" autocomplete="off"> <input type="text" class="form-control input-sm inputValue" id="startTime1"
style="margin-left: 15px" autocomplete="off">
</div> </div>
<div class="col-sm-1" style="padding-top:2%"> <div class="col-sm-1" style="padding-top:2%">
<div style="margin-left: 50%">
</div>
</div> </div>
<div class="col-sm-4 inputDiv"> <div class="col-sm-4 inputDiv">
<input type="text" class="form-control input-sm inputValue" id="endTime1" autocomplete="off"> <input type="text" class="form-control input-sm inputValue" id="endTime1"
autocomplete="off">
</div> </div>
</div> </div>
</div> </div>
@ -346,13 +352,17 @@
<label class="control-label">出院日期:</label> <label class="control-label">出院日期:</label>
</div> </div>
<div class="col-sm-4 inputDiv"> <div class="col-sm-4 inputDiv">
<input type="text" class="form-control input-sm inputValue" id="startTime2" style="margin-left: 15px" autocomplete="off"> <input type="text" class="form-control input-sm inputValue" id="startTime2"
style="margin-left: 15px" autocomplete="off">
</div> </div>
<div class="col-sm-1" style="padding-top:2%"> <div class="col-sm-1" style="padding-top:2%">
<div style="margin-left: 50%">
</div>
</div> </div>
<div class="col-sm-4 inputDiv"> <div class="col-sm-4 inputDiv">
<input type="text" class="form-control input-sm inputValue" id="endTime2" autocomplete="off"> <input type="text" class="form-control input-sm inputValue" id="endTime2"
autocomplete="off">
</div> </div>
</div> </div>
</div> </div>
@ -399,9 +409,30 @@
<div class="col-sm-4"> <div class="col-sm-4">
<div class="form-group"> <div class="form-group">
<div class="col-sm-3 labelDiv"> <div class="col-sm-3 labelDiv">
<label class="control-label">主诊编码范围:</label>
</div>
<div class="col-sm-4 inputDiv">
<input type="text" class="form-control input-sm inputValue" id="diag_code1"
style="margin-left: 15px">
</div>
<div class="col-sm-1" style="padding-top:2%;">
<div style="margin-left: 50%">
</div>
</div>
<div class="col-sm-4 inputDiv">
<input type="text" class="form-control input-sm inputValue" id="diag_code2">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-4 labelDiv">
<label class="control-label">手术编码:</label> <label class="control-label">手术编码:</label>
</div> </div>
<div class="col-sm-9 inputDiv"> <div class="col-sm-8 inputDiv">
<input type="text" class="form-control input-sm otherTable operTable inputValue" <input type="text" class="form-control input-sm otherTable operTable inputValue"
id="operate_code" onkeyup="getOperateCodeContents('operate_code')" id="operate_code" onkeyup="getOperateCodeContents('operate_code')"
onfocus="getOperateCodeContents('operate_code')" onfocus="getOperateCodeContents('operate_code')"
@ -415,14 +446,12 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<div class="row">
<div class="col-sm-4"> <div class="col-sm-4">
<div class="form-group"> <div class="form-group">
<div class="col-sm-4 labelDiv"> <div class="col-sm-3 labelDiv">
<label class="control-label">手术名称:</label> <label class="control-label">手术名称:</label>
</div> </div>
<div class="col-sm-8 inputDiv"> <div class="col-sm-9 inputDiv">
<input type="text" class="form-control input-sm otherTable operTable inputValue" <input type="text" class="form-control input-sm otherTable operTable inputValue"
id="operate_name" onkeyup="getOperateNameContents('operate_name')" id="operate_name" onkeyup="getOperateNameContents('operate_name')"
onfocus="getOperateNameContents('operate_name')" onfocus="getOperateNameContents('operate_name')"
@ -439,22 +468,19 @@
<div class="col-sm-4"> <div class="col-sm-4">
<div class="form-group"> <div class="form-group">
<div class="col-sm-3 labelDiv"> <div class="col-sm-3 labelDiv">
<label class="control-label">主治医生</label> <label class="control-label">手术编码范围</label>
</div> </div>
<div class="col-sm-9 inputDiv"> <div class="col-sm-4 inputDiv">
<input type="text" class="form-control input-sm diagTable inputValue" <input type="text" class="form-control input-sm inputValue" id="operate_code1"
id="attending" maxlength="6"> style="margin-left: 15px">
</div> </div>
</div> <div class="col-sm-1" style="padding-top:2%">
</div> <div style="margin-left: 50%">
<div class="col-sm-4">
<div class="form-group"> </div>
<div class="col-sm-3 labelDiv">
<label class="control-label">全部诊断:</label>
</div> </div>
<div class="col-sm-9 inputDiv"> <div class="col-sm-4 inputDiv">
<input type="text" class="form-control input-sm diagTable inputValue" <input type="text" class="form-control input-sm inputValue" id="operate_code2">
id="all_diag_name" maxlength="100">
</div> </div>
</div> </div>
</div> </div>
@ -482,6 +508,39 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-3 labelDiv">
<label class="control-label">其他诊断码范围:</label>
</div>
<div class="col-sm-4 inputDiv">
<input type="text" class="form-control input-sm inputValue"
id="other_diag_name1" style="margin-left: 15px">
</div>
<div class="col-sm-1" style="padding-top:2%">
<div style="margin-left: 50%">
</div>
</div>
<div class="col-sm-4 inputDiv">
<input type="text" class="form-control input-sm inputValue"
id="other_diag_name2">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-4 labelDiv">
<label class="control-label">全部诊断:</label>
</div>
<div class="col-sm-8 inputDiv">
<input type="text" class="form-control input-sm diagTable inputValue"
id="all_diag_name" maxlength="100">
</div>
</div>
</div>
<div class="col-sm-4"> <div class="col-sm-4">
<div class="form-group"> <div class="form-group">
<div class="col-sm-3 labelDiv"> <div class="col-sm-3 labelDiv">
@ -493,17 +552,52 @@
</div> </div>
</div> </div>
</div> </div>
<%-- <div class="col-sm-4"> <div class="col-sm-4">
<div class="form-group"> <div class="form-group">
<div class="col-sm-3 labelDiv"> <div class="col-sm-3 labelDiv">
<label class="control-label">院内感染</label> <label class="control-label">主治医生</label>
</div> </div>
<div class="col-sm-9 inputDiv"> <div class="col-sm-9 inputDiv">
<input type="text" class="form-control input-sm inputValue" id="taint_name" <input type="text" class="form-control input-sm diagTable inputValue"
maxlength="16"> id="attending" maxlength="6">
</div> </div>
</div> </div>
</div>--%> </div>
</div>
<div class="row">
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-4 labelDiv">
<label class="control-label">科主任:</label>
</div>
<div class="col-sm-8 inputDiv">
<input type="text" class="form-control input-sm diagTable inputValue"
id="dept_director" maxlength="6">
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-3 labelDiv">
<label class="control-label">主任(副主任)</label>
</div>
<div class="col-sm-9 inputDiv">
<input type="text" class="form-control input-sm diagTable inputValue"
id="director" maxlength="6">
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-3 labelDiv">
<label class="control-label">住院医师:</label>
</div>
<div class="col-sm-9 inputDiv">
<input type="text" class="form-control input-sm diagTable inputValue"
id="admiss_doctor" maxlength="100">
</div>
</div>
</div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-4"> <div class="col-sm-4">
@ -593,7 +687,8 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">有效时间:</label> <label class="col-sm-4 control-label">有效时间:</label>
<div class="col-sm-7"> <div class="col-sm-7">
<input type="text" class="form-control input-sm input" id="effeTime" name="effeTime" maxlength="10" autocomplete="off"> <input type="text" class="form-control input-sm input" id="effeTime" name="effeTime"
maxlength="10" autocomplete="off">
</div> </div>
<div class="col-sm-1"></div> <div class="col-sm-1"></div>
</div> </div>
@ -603,7 +698,7 @@
<label class="col-sm-4 control-label">申请天数:</label> <label class="col-sm-4 control-label">申请天数:</label>
<div class="col-sm-7"> <div class="col-sm-7">
<input type="number" class="form-control input-sm input" id="effeDays" <input type="number" class="form-control input-sm input" id="effeDays"
name="effeDays" oninput="if(value.length>3)value=value.slice(0,3)"> name="effeDays" oninput="if(value.length>3)value=value.slice(0,3)" readonly>
</div> </div>
<div class="col-sm-1"></div> <div class="col-sm-1"></div>
</div> </div>
@ -631,7 +726,8 @@
</form> </form>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-sm btn-default" data-dismiss="modal">关闭 <button type="button" class="btn btn-sm btn-default" data-dismiss="modal">
关闭
</button> </button>
<button type="button" class="btn btn-sm btn-primary" onclick="save()"> <button type="button" class="btn btn-sm btn-primary" onclick="save()">
暂时保存 暂时保存
@ -662,7 +758,8 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">病案号:</label> <label class="col-sm-4 control-label">病案号:</label>
<div class="col-sm-7"> <div class="col-sm-7">
<input type="text" class="form-control input-sm input" id="inpatientNo" readonly name="inpatientNo"> <input type="text" class="form-control input-sm input" id="inpatientNo"
name="inpatientNo">
</div> </div>
<div class="col-sm-1"></div> <div class="col-sm-1"></div>
</div> </div>
@ -690,7 +787,8 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">出院时间:</label> <label class="col-sm-4 control-label">出院时间:</label>
<div class="col-sm-7"> <div class="col-sm-7">
<input type="text" class="form-control input-sm input" name="disDate" id="disDate" maxlength="10" autocomplete="off"> <input type="text" class="form-control input-sm input" name="disDate" id="disDate"
maxlength="10" autocomplete="off">
</div> </div>
<div class="col-sm-1"></div> <div class="col-sm-1"></div>
</div> </div>

@ -3,11 +3,11 @@
<c:set var="path" value="${pageContext.request.contextPath}"/> <c:set var="path" value="${pageContext.request.contextPath}"/>
<%@ include file="/WEB-INF/jspf/common.jspf" %> <%@ include file="/WEB-INF/jspf/common.jspf" %>
<%@ include file="/WEB-INF/jspf/ztreeCommom.jsp" %> <%@ include file="/WEB-INF/jspf/ztreeCommom.jsp" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8"/>
<title>预览pdfIframe页面</title> <title>预览pdfIframe页面</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
@ -21,30 +21,37 @@
var path = "${path}"; var path = "${path}";
</script> </script>
<style type="text/css"> <style type="text/css">
body{ body {
width:100%; width: 100%;
height:100%; height: 100%;
margin:0; margin: 0;
padding:0; padding: 0;
background-color: #F2F2F2; background-color: #F2F2F2;
} }
.content-left{
height:100%; .content-left {
width:23%; height: 100%;
float:left; width: 23%;
float: left;
background-color: #FFFFFF; background-color: #FFFFFF;
} }
.content-right{
height:100%; .content-right {
width:76%; height: 100%;
float:right; width: 76%;
padding-left:1%; float: right;
padding-left: 1%;
background-color: #FFFFFF; background-color: #FFFFFF;
} }
</style> </style>
</head> </head>
<body style="scroll:auto" onkeydown="disabledPrint()"> <body style="scroll:auto" onkeydown="disabledPrint()">
<input type="hidden" id="patientId" value="${patientId}"> <div id="myModal" class="modal fade" data-keyboard="false"
data-backdrop="static" data-role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div id="loading1" class="loading">加载中。。。</div>
</div>
<input type="hidden" id="patientId" value="${patientId}">
<!--初始化及树复选框勾选的文件名称集合--> <!--初始化及树复选框勾选的文件名称集合-->
<input type="hidden" id="assortIds"> <input type="hidden" id="assortIds">
<!--初始化及树复选框勾选的文件来源集合--> <!--初始化及树复选框勾选的文件来源集合-->
@ -64,8 +71,9 @@
<input type="hidden" id="printPicLoaded"> <input type="hidden" id="printPicLoaded">
<!--定义打印预览的图片加载进度--> <!--定义打印预览的图片加载进度-->
<input type="hidden" id="loading"> <input type="hidden" id="loading">
<div class="content-left"> <div class="content-left">
<div class="form-group"> <div class="form-group" style="margin-top: 2%">
<div class="col-sm-5" style="padding-right: 0"> <div class="col-sm-5" style="padding-right: 0">
<c:if test="${fn:length(emrTypes) != 0}"> <c:if test="${fn:length(emrTypes) != 0}">
<select class="form-control input input-sm" id="typeId"> <select class="form-control input input-sm" id="typeId">
@ -75,14 +83,20 @@
</select> </select>
</c:if> </c:if>
</div> </div>
<div class="col-sm-3"> <div class="col-sm-2">
<button type="button" class="btn btn-sm btn-primary" onclick="onloadPdfMethod()">加载PDF</button> <button type="button" class="btn btn-sm btn-primary" onclick="onloadPdfMethod()">加载PDF</button>
</div> </div>
<c:if test="${CURRENT_USER.userEmail == '1' || isDownload == '1'}"> <c:if test="${CURRENT_USER.userEmail == '1' || isDownload == '1'}">
<div class="col-sm-3"> <div class="col-sm-2">
<button type="button" class="btn btn-sm btn-primary" onclick="onloadJpgForPdf()">下载PDF</button> <button type="button" class="btn btn-sm btn-primary" onclick="onloadJpgForPdf()">下载PDF</button>
</div> </div>
</c:if> </c:if>
<c:if test="${moveFlag == '1'}">
<div class="col-sm-2">
<button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#myModal1">移动PDF
</button>
</div>
</c:if>
<div class="zTreeDemo"> <div class="zTreeDemo">
<ul id="ztree" class="ztree"></ul> <ul id="ztree" class="ztree"></ul>
</div> </div>
@ -94,19 +108,156 @@
</shiro:hasPermission> </shiro:hasPermission>
<shiro:hasPermission name="/commom/updateScanAssort"> <shiro:hasPermission name="/commom/updateScanAssort">
<div class="form-group" style="margin-left: 6%"> <div class="form-group" style="margin-left: 6%">
<label class="control-label" style="float:left;margin-top:1%;">重新归页:</label> <label class="control-label" style="float:left;margin-top:1%;">重新归页:</label>
<select class="form-control" style="float:left;width:30%;" id="newAssortId"> <select class="form-control" style="float:left;width:30%;" id="newAssortId">
<option value="">选择重新归页</option> <option value="">选择重新归页</option>
<c:forEach items="${zdAssorts}" var="assort"> <c:forEach items="${zdAssorts}" var="assort">
<option value="${assort.assortId}">${assort.assortName}</option> <option value="${assort.assortId}">${assort.assortName}</option>
</c:forEach> </c:forEach>
</select> </select>
<button type="button" class="btn btn-sm btn-default" style="float:left;margin-left:2%;" onclick="sure()">确定</button> <button type="button" class="btn btn-sm btn-default" style="float:left;margin-left:2%;" onclick="sure()">
确定
</button>
</div> </div>
</shiro:hasPermission> </shiro:hasPermission>
<iframe width="100%" height="100%" src="" id="iframe1" frameborder="0" scrolling="yes"></iframe> <iframe width="100%" height="100%" src="" id="iframe1" name="iframe1" frameborder="0" scrolling="yes"></iframe>
</div>
<!-- 模态框1Modal移动PDFtable信息 -->
<div class="modal fade bs-example-modal-lg" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-lg" style="width:1600px">
<div class="modal-content modal1Content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
&times;
</button>
<h4 class="modal-title">
移动PDF
</h4>
</div>
<div class="modal-body code-body">
<div class="row">
<div></div>
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-4 labelDiv">
<label class="control-label">病案号:</label>
</div>
<div class="col-sm-8 inputDiv">
<input type="text" class="form-control input-sm inputValue" id="inpatientNo"
maxlength="16">
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-4 labelDiv">
<label class="control-label">住院次数:</label>
</div>
<div class="col-sm-8 inputDiv">
<input type="text" class="form-control input-sm inputValue" id="admissTimes"
maxlength="16">
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-4 labelDiv">
<label class="control-label">姓名:</label>
</div>
<div class="col-sm-8 inputDiv">
<input type="text" class="form-control input-sm inputValue" id="name"
maxlength="16">
</div>
</div>
</div>
</div>
<div class="btns">
<div class="btn" style="margin-left: 90%; margin-top: 1%">
<button type="button" class="btn btn-sm btn-primary" onclick="search()">开始搜索</button>
</div>
</div>
<!--数据表格-->
<div id="tableDiv" class="table-responsive tableDiv table-hover" style="overflow:scroll;">
<table id="mytab" class="table text-nowrap table-bordered" data-toggle="table" data-height="200">
</table>
</div>
</div>
</div>
</div>
</div>
<!-- 模态框1Moda2移动PDF分段信息 -->
<div class="modal fade bs-example-modal-lg" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-lg" style="width:400px">
<div class="modal-content modal1Content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
&times;
</button>
<h4 class="modal-title">
选择分段
</h4>
</div>
<div class="modal-body code-body">
<input type="hidden" id="patientIdInfo">
<div class="row" style="margin-top: 2%">
<div class="form-group">
<label class="col-sm-4 control-label">病案号:</label>
<div class="col-sm-7">
<input type="text" class="form-control input" id="inpatientNoInfo" maxlength="16" readonly>
</div>
<div class="col-sm-1"></div>
</div>
</div>
<div class="row" style="margin-top: 2%">
<div class="form-group">
<label class="col-sm-4 control-label">住院次数:</label>
<div class="col-sm-7">
<input type="text" class="form-control input" id="admissTimesInfo" maxlength="16" readonly>
</div>
<div class="col-sm-1"></div>
</div>
</div>
<div class="row" style="margin-top: 2%">
<div class="form-group">
<label class="col-sm-4 control-label">姓名:</label>
<div class="col-sm-7">
<input type="text" class="form-control input" id="nameInfo" maxlength="16" readonly>
</div>
<div class="col-sm-1"></div>
</div>
</div>
<div class="row" style="margin-top: 2%">
<div class="form-group">
<label class="col-sm-4 control-label">重新归页:</label>
<div class="col-sm-7">
<select class="form-control" style="float:left;width:100%;" id="moveAssortId">
<option value="">选择重新归页</option>
<c:forEach items="${zdAssorts}" var="assort">
<option value="${assort.assortId}">${assort.assortName}</option>
</c:forEach>
</select>
</div>
<div class="col-sm-1"></div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>
<button type="button" class="btn btn-primary" onclick="movePdf()">
提交
</button>
</div>
</div>
</div>
</div>
</div> </div>
<script type="text/javascript" src="${path}/static/js/recordManage/commomSearch/showRecordIframeBlood.js"></script> <script type="text/javascript"
<script type="text/javascript" src="${path}/static/js/recordManage/commomSearch/showRecordIframeBloodCommom.js"></script> src="${path}/static/js/recordManage/commomSearch/showRecordIframeBlood.js"></script>
<script type="text/javascript"
src="${path}/static/js/recordManage/commomSearch/showRecordIframeBloodCommom.js"></script>
<script type="text/javascript" src="${path}/static/js/commom.js"></script>
</body> </body>
</html> </html>

@ -0,0 +1,265 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<c:set var="path" value="${pageContext.request.contextPath}"/>
<%@ include file="/WEB-INF/jspf/common.jspf" %>
<%@ include file="/WEB-INF/jspf/ztreeCommom.jsp" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>预览pdfIframe页面</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv=X-UA-Compatible IE=EmulateIE7>
<!--[if lt IE 9]>
<script type="text/javascript" src="${path}/static/js/html5shiv.min.js"></script>
<script type="text/javascript" src="${path}/static/js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="${path}/static/js/respond.min.js"></script>
<![endif]-->
<script>
var path = "${path}";
</script>
<style type="text/css">
body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
background-color: #F2F2F2;
}
.content-left {
height: 100%;
width: 23%;
float: left;
background-color: #FFFFFF;
}
.content-right {
height: 100%;
width: 76%;
float: right;
padding-left: 1%;
background-color: #FFFFFF;
}
</style>
</head>
<body style="scroll:auto" onkeydown="disabledPrint()">
<div id="myModal" class="modal fade" data-keyboard="false"
data-backdrop="static" data-role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div id="loading1" class="loading">加载中。。。</div>
</div>
<input type="hidden" id="patientId" value="${patientId}">
<input type="hidden" id="userName" value="${userName}">
<input type="hidden" id="deptName" value="${deptName}">
<!--初始化及树复选框勾选的文件名称集合-->
<input type="hidden" id="assortIds">
<!--初始化及树复选框勾选的文件来源集合-->
<input type="hidden" id="sources">
<!--树节点点击选中的文件名称-->
<input type="hidden" id="assortIdByClick">
<!--树节点点击选中的文件来源-->
<input type="hidden" id="sourceByClick">
<input type="hidden" id="flag" value="${flag}">
<!--是否有打印权限-->
<input type="hidden" id="print" value="${printFlag}">
<!--文件路径-->
<input type="hidden" id="filePath">
<!--定义iframe1加载完成标识-->
<input type="hidden" id="iframeLoad">
<!--定义打印预览的图片加载完成标识-->
<input type="hidden" id="printPicLoaded">
<!--定义打印预览的图片加载进度-->
<input type="hidden" id="loading">
<div class="content-left">
<div class="form-group" style="margin-top: 2%">
<div class="col-sm-5" style="padding-right: 0">
<c:if test="${fn:length(emrTypes) != 0}">
<select class="form-control input input-sm" id="typeId">
<c:forEach items="${emrTypes}" var="type">
<option value="${type.id}">${type.typeName}</option>
</c:forEach>
</select>
</c:if>
</div>
<div class="col-sm-2">
<button type="button" class="btn btn-sm btn-primary" onclick="onloadPdfMethod()">加载PDF</button>
</div>
<c:if test="${CURRENT_USER.userEmail == '1' || isDownload == '1'}">
<div class="col-sm-2">
<button type="button" class="btn btn-sm btn-primary" onclick="onloadJpgForPdf()">下载PDF</button>
</div>
</c:if>
<c:if test="${moveFlag == '1'}">
<div class="col-sm-2">
<button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#myModal1">移动PDF
</button>
</div>
</c:if>
<div class="zTreeDemo">
<ul id="ztree" class="ztree"></ul>
</div>
</div>
</div>
<div class="content-right">
<shiro:hasPermission name="/commom/delScanAssort">
<button type="button" class="btn btn-sm btn-danger" style="float:left;" onclick="delPic()">删除</button>
</shiro:hasPermission>
<shiro:hasPermission name="/commom/updateScanAssort">
<div class="form-group" style="margin-left: 6%">
<label class="control-label" style="float:left;margin-top:1%;">重新归页:</label>
<select class="form-control" style="float:left;width:30%;" id="newAssortId">
<option value="">选择重新归页</option>
<c:forEach items="${zdAssorts}" var="assort">
<option value="${assort.assortId}">${assort.assortName}</option>
</c:forEach>
</select>
<button type="button" class="btn btn-sm btn-default" style="float:left;margin-left:2%;" onclick="sure()">
确定
</button>
</div>
</shiro:hasPermission>
<iframe width="100%" height="100%" src="" id="iframe1" name="iframe1" frameborder="0" scrolling="yes"></iframe>
</div>
<!-- 模态框1Modal移动PDFtable信息 -->
<div class="modal fade bs-example-modal-lg" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-lg" style="width:1600px">
<div class="modal-content modal1Content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
&times;
</button>
<h4 class="modal-title">
移动PDF
</h4>
</div>
<div class="modal-body code-body">
<div class="row">
<div></div>
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-4 labelDiv">
<label class="control-label">病案号:</label>
</div>
<div class="col-sm-8 inputDiv">
<input type="text" class="form-control input-sm inputValue" id="inpatientNo"
maxlength="16">
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-4 labelDiv">
<label class="control-label">住院次数:</label>
</div>
<div class="col-sm-8 inputDiv">
<input type="text" class="form-control input-sm inputValue" id="admissTimes"
maxlength="16">
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-4 labelDiv">
<label class="control-label">姓名:</label>
</div>
<div class="col-sm-8 inputDiv">
<input type="text" class="form-control input-sm inputValue" id="name"
maxlength="16">
</div>
</div>
</div>
</div>
<div class="btns">
<div class="btn" style="margin-left: 90%; margin-top: 1%">
<button type="button" class="btn btn-sm btn-primary" onclick="search()">开始搜索</button>
</div>
</div>
<!--数据表格-->
<div id="tableDiv" class="table-responsive tableDiv table-hover" style="overflow:scroll;">
<table id="mytab" class="table text-nowrap table-bordered" data-toggle="table" data-height="200">
</table>
</div>
</div>
</div>
</div>
</div>
<!-- 模态框1Moda2移动PDF分段信息 -->
<div class="modal fade bs-example-modal-lg" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-lg" style="width:400px">
<div class="modal-content modal1Content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
&times;
</button>
<h4 class="modal-title">
选择分段
</h4>
</div>
<div class="modal-body code-body">
<input type="hidden" id="patientIdInfo">
<div class="row" style="margin-top: 2%">
<div class="form-group">
<label class="col-sm-4 control-label">病案号:</label>
<div class="col-sm-7">
<input type="text" class="form-control input" id="inpatientNoInfo" maxlength="16" readonly>
</div>
<div class="col-sm-1"></div>
</div>
</div>
<div class="row" style="margin-top: 2%">
<div class="form-group">
<label class="col-sm-4 control-label">住院次数:</label>
<div class="col-sm-7">
<input type="text" class="form-control input" id="admissTimesInfo" maxlength="16" readonly>
</div>
<div class="col-sm-1"></div>
</div>
</div>
<div class="row" style="margin-top: 2%">
<div class="form-group">
<label class="col-sm-4 control-label">姓名:</label>
<div class="col-sm-7">
<input type="text" class="form-control input" id="nameInfo" maxlength="16" readonly>
</div>
<div class="col-sm-1"></div>
</div>
</div>
<div class="row" style="margin-top: 2%">
<div class="form-group">
<label class="col-sm-4 control-label">重新归页:</label>
<div class="col-sm-7">
<select class="form-control" style="float:left;width:100%;" id="moveAssortId">
<option value="">选择重新归页</option>
<c:forEach items="${zdAssorts}" var="assort">
<option value="${assort.assortId}">${assort.assortName}</option>
</c:forEach>
</select>
</div>
<div class="col-sm-1"></div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>
<button type="button" class="btn btn-primary" onclick="movePdf()">
提交
</button>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript"
src="${path}/static/js/recordManage/commomSearch/showRecordIframeSouth.js"></script>
<script type="text/javascript"
src="${path}/static/js/recordManage/commomSearch/showRecordIframeBloodCommom.js"></script>
<script type="text/javascript" src="${path}/static/js/commom.js"></script>
</body>
</html>

@ -250,13 +250,13 @@
</section> </section>
</div> </div>
<!-- 底部版权--> <!-- 底部版权-->
<footer class="main-footer"> <%--<footer class="main-footer">
<div class="pull-right hidden-xs"> <div class="pull-right hidden-xs">
<b>Version</b> 20200211 <b>Version</b> 20200211
</div> </div>
<strong>Copyright &copy; 2019-2090 厦门嘉时软件.</strong> All rights <strong>Copyright &copy; 2019-2090 厦门嘉时软件.</strong> All rights
reserved. reserved.
</footer> </footer>--%>
</div> </div>
<script type="text/javascript" src="${path}/static/js/menu.js?time=2019-12-15"></script> <script type="text/javascript" src="${path}/static/js/menu.js?time=2019-12-15"></script>
<%@ include file="/WEB-INF/jspf/webSocket.jspf" %> <%@ include file="/WEB-INF/jspf/webSocket.jspf" %>

@ -27,7 +27,9 @@ $("#parentId").change(function(){
}) })
} }
}) })
//加载数据表格 /**
* 加载数据表格
*/
$('#mytab').bootstrapTable({ $('#mytab').bootstrapTable({
height:5000, height:5000,
toolbar: '#toolbar', //工具按钮用哪个容器 toolbar: '#toolbar', //工具按钮用哪个容器
@ -153,7 +155,7 @@ $('#mytab').bootstrapTable({
if(row.approveState != '已过期'){ if(row.approveState != '已过期'){
//非已提交,提供申请,编辑,删除 //非已提交,提供申请,编辑,删除
if(addOper == 1){ if(addOper == 1){
editanddrop += '<button type="button" onclick="updateThenAdd('+row.id+')" class="btn btn-sm btn-primary">提交申请</button>'; editanddrop += '<button type="button" onclick="updateThenAdd('+row.id+')" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#myModal3">提交申请</button>';
} }
} }
if(updateOper == 1){ if(updateOper == 1){
@ -232,13 +234,17 @@ $('#mytab').bootstrapTable({
$("#checks").val(""); $("#checks").val("");
} }
}) })
function crtTimeFtt(val) { function crtTimeFtt(val) {
if (val != null) { if (val != null) {
var date = new Date(val); var date = new Date(val);
return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate(); return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
} }
} }
//查询按钮
/**
* 查询按钮
*/
function refreshTable(){ function refreshTable(){
$("#checks").val(""); $("#checks").val("");
$('#mytab').bootstrapTable('refresh',{ $('#mytab').bootstrapTable('refresh',{
@ -246,7 +252,9 @@ function refreshTable(){
}) })
} }
//批量添加按钮 /**
* 批量添加按钮
*/
function addApproves(){ function addApproves(){
pickTime("effeTime5", null); pickTime("effeTime5", null);
form5.reset(); form5.reset();
@ -254,7 +262,9 @@ function addApproves(){
loadSelect(path+ '/approve/loadReasonModle','parentId5',''); loadSelect(path+ '/approve/loadReasonModle','parentId5','');
} }
//添加按钮 /**
* 添加按钮
*/
function addApprove(){ function addApprove(){
pickTime("effeTime", null); pickTime("effeTime", null);
setFormToken(); setFormToken();
@ -266,7 +276,11 @@ function addApprove(){
//加载申请原因模板 //加载申请原因模板
loadSelect(path+ '/approve/loadReasonModle','parentId',''); loadSelect(path+ '/approve/loadReasonModle','parentId','');
} }
//批量申请保存
/**
* 批量申请保存
* @returns {boolean}
*/
function addSimple(){ function addSimple(){
if($("#effeTime5").val() != ''){ if($("#effeTime5").val() != ''){
if($("#applyType5").val() != '') { if($("#applyType5").val() != '') {
@ -333,7 +347,11 @@ function addSimple(){
$("#effeTime5").focus(); $("#effeTime5").focus();
} }
} }
//编辑
/**
* 编辑
* @param id
*/
function updateApprove(id){ function updateApprove(id){
pickTime("effeTime", null); pickTime("effeTime", null);
//加载申请原因模板 //加载申请原因模板
@ -368,13 +386,21 @@ function updateApprove(id){
} }
}) })
} }
//病案預覽
//查看详情 /**
* 病案預覽
* 查看详情
* @param patientId
*/
function showDetail(patientId){ function showDetail(patientId){
//隐藏模板选项 //隐藏模板选项
window.location.href=path+"/commom/showRecord174?patientId="+patientId; window.location.href=path+"/commom/showRecord174?patientId="+patientId;
} }
//显示申请信息详情
/**
* 显示申请信息详情
* @param id
*/
function showApprove(id){ function showApprove(id){
loadSelect(path+ '/approve/loadType',null,'applyType1'); loadSelect(path+ '/approve/loadType',null,'applyType1');
//加载申请原因模板 //加载申请原因模板
@ -400,7 +426,11 @@ function showApprove(id){
} }
}) })
} }
//提交申请按钮功能
/**
* 提交申请按钮功能
* @param id
*/
function updateThenAdd(id){ function updateThenAdd(id){
updateApprove(id); updateApprove(id);
setTimeout(function(){ setTimeout(function(){
@ -408,7 +438,11 @@ function updateThenAdd(id){
},1000) },1000)
$('#mytab').bootstrapTable('selectPage', pageNumber); $('#mytab').bootstrapTable('selectPage', pageNumber);
} }
//删除
/**
* 删除
* @param id
*/
function deleteApprove(id){ function deleteApprove(id){
Common.confirm({ Common.confirm({
title: "提示", title: "提示",
@ -433,7 +467,10 @@ function deleteApprove(id){
} }
}) })
} }
//导出excel功能
/**
* 导出excel功能
*/
function exportExcel(){ function exportExcel(){
var checks = $("#checks").val(); var checks = $("#checks").val();
if(checks != '') { if(checks != '') {

@ -324,7 +324,6 @@ function add(flag){
//封装提交审批方法 //封装提交审批方法
function saveMethod(flag){ function saveMethod(flag){
debugger
if(flag == 'n'){ if(flag == 'n'){
$("#effeTime").val(applyDate); $("#effeTime").val(applyDate);
$("#effeDays").val(applyDay); $("#effeDays").val(applyDay);

@ -98,8 +98,10 @@ function pickTime(info, showDate){
} }
//转换日期 //转换日期
function covertDate(value){ function covertDate(value){
if(value != '' && value.length >= 10){ if (value != undefined){
value = value.substring(0,10); if(value != '' && value.length >= 10){
value = value.substring(0,10);
}
} }
return value; return value;
} }

@ -0,0 +1,939 @@
$(function () {
//百叶窗风格
$('.collapse').collapse({
toggle: false
})
//加载表格
freshTableSouth();
//加载时间控件1
initDateInput(1);
//加载时间控件2
initDateInput(2);
//加载性别
loadSex();
//加载科室
loadDept();
//加载转归情况
loadDiagStatus();
//权限控制按钮
permissionControlButton();
});
//加载性别
function loadSex() {
$.ajax({
type: 'get',
url: path + '/commom/getSex',
dataType: 'json',
success: function (data) {
if (null != data) {
$("#sex").empty();
var html = '';
for (var i = 0; i < data.length; i++) {
if (i > 1) {
html += '<div class="col-sm-3 radioDiv">'
+ '<input type="radio" id="' + data[i].name + '" name="sex" value="' + data[i].name + '" class="sexInput"><label class="checkBoxClass" for="' + data[i].name + '">' + data[i].name + '</label></div>';
} else {
html += '<div class="col-sm-2 radioDiv">'
+ '<input type="radio" id="' + data[i].name + '" name="sex" value="' + data[i].name + '" class="sexInput"><label class="checkBoxClass" for="' + data[i].name + '">' + data[i].name + '</label></div>';
}
}
$("#sex").append(html);
}
}
})
}
//加载科室
function loadDept() {
$.ajax({
type: 'get',
url: path + '/commom/getDept',
dataType: 'json',
success: function (data) {
if (null != data) {
$("#dis_dept").empty();
var html = '<option value=""></option>';
for (var i = 0; i < data.length; i++) {
if (data[i].name != '') {
var name = data[i].name;
var py = makePy(name);
var pingyin = ConvertPinyin(name);
html += '<option data-tokens="' + name + '|' + py[0] + '|' + pingyin + '" value="' + name + '">' + name + '</option>';
}
}
$("#dis_dept").append(html);
$("#dis_dept").selectpicker('refresh');
}
}
})
}
//加载科室
function loadDeptDefault(defaultDeptName){
$.ajax({
type:'get',
url:path+'/commom/getDept',
dataType:'json',
success:function (data) {
if(null != data){
$("#disDept").empty();
var html = '<option value="">请选择</option>';
for (var i = 0; i < data.length; i++) {
if (data[i].name != '' && data[i].name == defaultDeptName) {
var name = data[i].name;
var py = makePy(name);
var pingyin = ConvertPinyin(name);
html += '<option data-tokens="' + name + '|' + py[0] + '|' + pingyin + '" value="' + name + '" selected>' + name + '</option>';
} else {
var name = data[i].name;
var py = makePy(name);
var pingyin = ConvertPinyin(name);
html += '<option data-tokens="' + name + '|' + py[0] + '|' + pingyin + '" value="' + name + '">' + name + '</option>';
}
}
$("#disDept").append(html);
$("#disDept").selectpicker('refresh');
}
}
})
}
//加载转归情况
function loadDiagStatus() {
$.ajax({
type: 'get',
url: path + '/commom/getDiagStatus',
dataType: 'json',
success: function (data) {
if (null != data) {
$("#dis_thing").empty();
var html = '<option value="">全部</option>';
for (var i = 0; i < data.length; i++) {
if (data[i].code != '0') {
html += '<option value="' + data[i].name + '">' + data[i].name + '</option>';
}
}
$("#dis_thing").append(html);
}
}
})
}
//动态控制限手术的值
$("#isOper").change(function () {
var checked = $(this).is(':checked');
if (checked) {
$(this).val(1)
} else {
$(this).val("");
}
})
//时间格式属性名集合
var commomtable = 'commomtable';
var commomtable1 = 'commomtable1';
//拼接sql
function getSql() {
var inputValue = getInputValue();
if (inputValue != '') {
//select语句字符串
var selectNames = 'select ' + commomtable + '.patient_id,CASE WHEN emr_apply_approve.id is null THEN 0 ELSE 1 END isShowDetail,CASE WHEN emr_apply_approve1.id IS NULL THEN 0 ELSE 1 END isDownload,CASE WHEN emr_lock.id is null THEN 0 ELSE 1 END lockStatus,';
selectNames += $("#englishFields").val();
//from语句字符串
var fromTableNames = ' from ';
//where语句字符串
var whereNames = ' where ';
//判断是否多表
var tables = false;
$('.otherTable').each(function () {
if ($(this).val() != '') {
tables = true;
return false;
}
})
//单表
fromTableNames += commomtable;
//拼接where语句
var name = '';
//姓名
var searchName = $("#name").val();
if (searchName != '') {
name = 'name';
//去除前后空格
searchName = searchName.replace(/(^\s*)|(\s*$)/g, "");
var pinyin = /^[a-zA-Z]+$/;
//1.逗号隔开
if (searchName.indexOf(",") != -1 || searchName.indexOf("") != -1) {
if (searchName.indexOf(",") != -1) {
searchName = searchName.split(",");
} else if (searchName.indexOf("") != -1) {
searchName = searchName.split("");
}
for (var i = 0; i < searchName.length; i++) {
if (searchName[i] != '') {
//拼接前括号
if (i == 0) {
whereNames += "(";
}
if (i != searchName.length - 1) {
if (searchName[i].indexOf("*") != -1) {
//2.带*号
searchName = searchName.replace(/\*/g, "_");
whereNames += commomtable + "." + name + " LIKE '" + searchName[i] + "' OR ";
} else if (pinyin.test(searchName[i])) {
//3.拼音缩写
whereNames += commomtable + ".name_cym LIKE '%" + searchName[i] + "%' OR ";
} else {
whereNames += commomtable + "." + name + " LIKE '%" + searchName[i] + "%' OR ";
}
} else {
if (searchName[i].indexOf("*") != -1) {
//2.带*号
searchName = searchName.replace(/\*/g, "_");
whereNames += commomtable + "." + name + " LIKE '" + searchName[i] + "')";
} else if (pinyin.test(searchName[i])) {
//3.拼音缩写
whereNames += commomtable + ".name_cym LIKE '%" + searchName[i] + "%')";
} else {
whereNames += commomtable + "." + name + " LIKE '%" + searchName[i] + "%')";
}
}
}
}
whereNames += " AND ";
} else if (searchName.indexOf("*") != -1) {
//2.带*号
searchName = searchName.replace(/\*/g, "_");
whereNames += commomtable + "." + name + " LIKE '" + searchName + "' AND ";
} else if (pinyin.test(searchName)) {
//3.拼音缩写
whereNames += commomtable + ".name_cym LIKE '%" + searchName + "%' AND ";
} else {
whereNames += commomtable + "." + name + " LIKE '%" + $("#" + name).val() + "%' AND ";
}
}
//年龄
if ($("#age1").val() != '' && $("#age2").val() != '') {
var ageType = $("#ageType").val();
if (ageType == '1') {
name = 'age';
if ($("#age1").val() < $("#age2").val()) {
whereNames += "(" + commomtable + "." + name + " BETWEEN " + $("#age1").val() + " AND " + ($("#age2").val() - 1) + " or (" + commomtable + "." + name + "=" + $("#age2").val() + " and " + commomtable + ".age_month=0 and " + commomtable + ".age_day=0)) AND ";
} else if ($("#age2").val() < $("#age1").val()) {
whereNames += "(" + commomtable + "." + name + " BETWEEN " + $("#age2").val() + " AND " + ($("#age1").val() - 1) + " or (" + commomtable + "." + name + "=" + $("#age1").val() + " and " + commomtable + ".age_month=0 and " + commomtable + ".age_day=0)) AND ";
}
} else if (ageType == '2') {
//周
name = 'age_month';
if ($("#age1").val() < $("#age2").val()) {
whereNames += "(" + 'age = 0 AND ' + commomtable + "." + name + " BETWEEN " + $("#age1").val() + " AND " + ($("#age2").val() - 1) + " OR (" + commomtable + ".age = 0 AND " + commomtable + ".age_month = " + $("#age2").val() + " AND " + commomtable + ".age_day = 0)) AND ";
} else if ($("#age2").val() < $("#age1").val()) {
whereNames += "(" + 'age = 0 AND ' + commomtable + "." + name + " BETWEEN " + $("#age2").val() + " AND " + ($("#age1").val() - 1) + " OR (" + commomtable + ".age = 0 AND " + commomtable + ".age_month = " + $("#age1").val() + " AND " + commomtable + ".age_day = 0)) AND ";
}
} else if (ageType == '3') {
//天
name = 'age_day';
if ($("#age1").val() < $("#age2").val()) {
whereNames += commomtable + "." + name + " BETWEEN " + $("#age1").val() + " AND " + $("#age2").val() + " AND ";
} else if ($("#age2").val() < $("#age1").val()) {
whereNames += commomtable + "." + name + " BETWEEN " + $("#age2").val() + " AND " + $("#age1").val() + " AND ";
}
whereNames += 'age = 0 AND age_month = 0 AND ';
}
}
//性别
var sex = $("input[name='sex']:checked").val();
if (sex != '') {
name = 'sex';
whereNames += commomtable + "." + name + " = '" + sex + "' AND ";
}
//病案号
var inpatientNo = $("#inpatient_no").val();
if (inpatientNo != '') {
name = 'inpatient_no';
inpatientNo = inpatientNo.replace(/(^\s*)|(\s*$)/g, "");
//1.逗号隔开
if (inpatientNo.indexOf(",") != -1 || inpatientNo.indexOf("") != -1) {
if (inpatientNo.indexOf(",") != -1) {
inpatientNo = inpatientNo.split(",");
} else if (inpatientNo.indexOf("") != -1) {
inpatientNo = inpatientNo.split("");
}
for (var i = 0; i < inpatientNo.length; i++) {
if (inpatientNo[i] != '') {
inpatientNo[i] = inpatientNo[i].replace(/(^\s*)|(\s*$)/g, "");
//拼接前括号
if (i == 0) {
whereNames += "(";
}
if (i != inpatientNo.length - 1) {
whereNames += commomtable + "." + name + " LIKE '%" + inpatientNo[i] + "%' OR ";
} else {
whereNames += commomtable + "." + name + " LIKE '%" + inpatientNo[i] + "%')";
}
}
}
whereNames += " AND ";
} else {
whereNames += commomtable + "." + name + " LIKE '%" + $("#" + name).val() + "%' AND ";
}
}
//ID号
if ($("#admiss_id").val() != '') {
name = 'admiss_id';
whereNames += commomtable + "." + name + " LIKE '%" + $("#" + name).val() + "%' AND ";
}
//出院科室
var disDept = $("#dis_dept").val();
if (disDept != '' && disDept != null && disDept != 'null') {
var disDepts = "";
for (var i = 0; i < disDept.length; i++) {
if (disDept[i] != '') {
disDepts += "'" + disDept[i] + "',";
}
}
disDepts = disDepts.substring(0, disDepts.length - 1);
name = 'dis_dept';
whereNames += commomtable + "." + name + " IN (" + disDepts + ") AND ";
}
//病状转归
if ($("#dis_thing").val() != '') {
name = 'main_dis_thing';
whereNames += commomtable + "." + name + " = '" + $("#dis_thing").val() + "' AND ";
}
//入院日期
if ($("#startTime1").val() != '' && $("#endTime1").val() != '') {
name = 'admiss_date';
whereNames += commomtable + "." + name + " BETWEEN '" + $("#startTime1").val() + " 00:00:00' AND '" + $("#endTime1").val() + " 23:59:59' AND ";
}
//出院日期
if ($("#startTime2").val() != '' && $("#endTime2").val() != '') {
name = 'dis_date';
whereNames += commomtable + "." + name + " BETWEEN '" + $("#startTime2").val() + " 00:00:00' AND '" + $("#endTime2").val() + " 23:59:59' AND ";
}
debugger
//诊断名称
if ($("#diag_name").val() != '') {
name = 'main_diag_name';
whereNames += commomtable + "." + name + " LIKE '%" + $("#diag_name").val() + "%' AND ";
}
//诊断表
//诊断码
if ($("#diag_code").val() != '') {
name = 'main_diag_code';
whereNames += commomtable + "." + name + " LIKE '%" + $("#diag_code").val() + "%' AND ";
}
//全部诊断
if($("#all_diag_name").val() != ''){
name = 'diag_name';
whereNames += "t_diag."+name+" LIKE '%"+$("#all_diag_name").val()+"%' AND ";
}
//其他诊断
if($("#other_diag_name").val() != ''){
name = 'other_diag_name';
whereNames += commomtable + "." + name + " LIKE '%" + $("#other_diag_name").val() + "%' AND ";
}
//病理诊断
if($("#pathology_name").val() != ''){
name = 'pathology_name';
whereNames += commomtable + "." + name + " LIKE '%" + $("#pathology_name").val() + "%' AND ";
}
//损伤中毒
if($("#poisoning_name").val() != ''){
name = 'poisoning_name';
whereNames += commomtable + "." + name + " LIKE '%" + $("#poisoning_name").val() + "%' AND ";
}
//手术表
//手术编号
if ($("#operate_code").val() != '') {
name = 'operate_code';
whereNames += "t_operate." + name + " LIKE '%" + $("#" + name).val() + "%' AND ";
}
//手术名称
if ($("#operate_name").val() != '') {
name = 'operate_name';
whereNames += "t_operate." + name + " LIKE '%" + $("#" + name).val() + "%' AND ";
}
//主诊编码范围
if ($("#diag_code1").val() != '' && $("#diag_code2").val() != '') {
name = 'main_diag_code';
whereNames += commomtable + "." + name + " BETWEEN '" + $("#diag_cod下·下·e1").val() + "' AND '" + $("#diag_code2").val() + "' AND ";
}
//手术编码范围
if ($("#operate_code1").val() != '' && $("#operate_code2").val() != '') {
name = 'operate_code';
whereNames += "t_operate." + name + " BETWEEN '" + $("#operate_code1").val() + "' AND '" + $("#operate_code2").val() + "' AND ";
}
//其他诊断编码范围
if ($("#other_diag_name1").val() != '' && $("#other_diag_name2").val() != '') {
name = 'other_diag_name';
whereNames += commomtable + "." + name + " BETWEEN '" + $("#other_diag_name1").val() + "' AND '" + $("#other_diag_name2").val() + "' AND ";
}
//科主任
if ($("#dept_director").val() != '') {
name = 'dept_director';
whereNames += commomtable1 + "." + name + " LIKE '%" + $("#dept_director").val() + "%' AND ";
}
//主任(副主任)
if ($("#director").val() != '') {
name = 'director';
whereNames += commomtable1 + "." + name + " LIKE '%" + $("#director").val() + "%' AND ";
}
//住院医师
if ($("#admiss_doctor").val() != '') {
name = 'admiss_doctor';
whereNames += commomtable1 + "." + name + " LIKE '%" + $("#admiss_doctor").val() + "%' AND ";
}
var userName = "'" + $("#userName").val() + "'";
fromTableNames += ' left join emr_apply_approve on ' + commomtable + '.patient_id = emr_apply_approve.patient_id \n' +
'and emr_apply_approve.approve_state = 1 and emr_apply_approve.effe_time > GETDATE()-1 and emr_apply_approve.applyer = ' + userName + ' and emr_apply_approve.apply_type != 3 ' +
' left join emr_apply_approve emr_apply_approve1 on ' + commomtable + '.patient_id = emr_apply_approve1.patient_id \n' +
'and emr_apply_approve1.approve_state = 1 and emr_apply_approve1.effe_time > GETDATE()-1 and emr_apply_approve1.applyer = ' + userName + ' and emr_apply_approve1.apply_type = 3' +
' left join emr_lock on ' + commomtable + '.patient_id = emr_lock.patient_id and emr_lock.lock_state = 1';
//拼接诊断表
//全部诊断
if($("#all_diag_name").val() != ''){
fromTableNames += ' left join t_diag on '+commomtable+'.patient_id=t_diag.patient_id';
}
if ($("#admiss_doctor").val() != '' || $("#director").val() != '' || $("#dept_director").val() != '') {
fromTableNames += ' left join ' + commomtable1 + ' on ' + commomtable1 + '.patient_id = ' + commomtable + '.patient_id';
}
//拼接手术表
var operFlag = false;
$(".operTable").each(function () {
if ($(this).val() != '' && $(this).val() != 'on') {
operFlag = true;
return false;
}
})
if (operFlag || $("#operate_code1").val() != '' || $("#operate_code2").val() != '') {
otherTable = 't_operate';
fromTableNames += ' left join ' + otherTable + ' on ' + commomtable + '.patient_id = ' + otherTable + '.patient_id';
}
//拼接主治医生
if ($("#attending").val() != '') {
name = 'attending';
whereNames += commomtable + "." + name + " LIKE '%" + $("#" + name).val() + "%' AND ";
}
//限手术
var isOper = $("#isOper").val();
if (isOper != '' && isOper == 1) {
name = 'is_oper';
whereNames += commomtable + "." + name + " = '1' AND ";
}
if (whereNames != ' where ') {
whereNames = whereNames.substring(0, whereNames.length - 4);
var orderBys = " ORDER BY " + commomtable + ".inpatient_no," + commomtable + ".admiss_times";
var sql = selectNames + fromTableNames + whereNames;
$("#sql").val(sql);
$("#orderBys").val(orderBys);
}
if (whereNames == ' where ') {
var orderBys = " ORDER BY " + commomtable + ".inpatient_no," + commomtable + ".admiss_times";
var sql = selectNames + fromTableNames;
$("#sql").val(sql);
$("#orderBys").val(orderBys);
}
console.log(sql);
} else {
$("#sql").val("");
}
}
function freshTableSouth(){
var powerMenus = $("#powerMenus").val();
var powerMenus = $("#powerMenus").val().substring(1,$("#powerMenus").val().length-1);
var powerMenusArr = powerMenus.split(", ");
for (var i = 0; i < powerMenusArr.length; i++){
var strs = powerMenusArr[i];
if (strs == '/commom/updateCommomInfo') {
$("#powerMenu").val("true");
}
}
var str = $("#powerMenu").val();
$("#mytab").bootstrapTable('destroy');
$("#checks").val('');
var columns = [];
columns.push({
title:'全选',
field:'select',
checkbox:true,
width:25,
valign:'middle',
},
{
title:'ID',
field:'patientId',
visible:false
})
var tableThNames = $("#tableThNames").val();
if(tableThNames != ''){
var fieldCns = '';
var fields = $("#fields").val().split(",");
tableThNames = tableThNames.split(",");
for(var i = 0;i<tableThNames.length;i++){
if(tableThNames[i] != ''){
var map = {};
if(fields[i] != ''){
map['title'] = tableThNames[i];
//重新组织选项
//转换RH
if(fields[i] == 'RH'){
map['field'] = 'rh';
fields[i] = 'rh';
}else{
map['field'] = fields[i];
}
fieldCns += fields[i] + ",";
}
if(dateFields.indexOf(fields[i]) != -1){
map['formatter'] = function (value, row, index) {return formatTime(value,'yyyy-MM-dd')};
}
columns.push(map);
}
}
$("#fieldCns").val(fieldCns);
}
var map1 = {};
map1['title'] = '权限';
map1['field'] = 'Button';
map1['align'] = 'center';
map1['formatter'] = 'AddFunctionAltyFont';
columns.push(map1)
var sql = $("#sql").val();
if(sql == ''){
sql = initSql;
}
var orderBys = $("#orderBys").val();
sql += orderBys;
//console.log(sql)
var flag = $("#showPrint").val();
//固定列标识
var mixFlag = false;
if(flag == 1){
flag = true;
}else{
flag = false;
mixFlag = true;
}
//生成用户数据
$('#mytab').bootstrapTable({
method: 'post',
contentType:'application/x-www-form-urlencoded; charset=UTF-8',
toolbar: '#toolbar', //工具按钮用哪个容器
striped: true, //是否显示行间隔色
cache: false, //是否使用缓存默认为true所以一般情况下需要设置一下这个属性*
pagination: true, //是否显示分页(*
sidePagination: "server", //分页方式client客户端分页server服务端分页*
paginationPreText : '上一页',
paginationNextText : '下一页',
paginationFirstText: '<',
paginationLastText: '>',
detailView: flag,
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 5, //每页的记录行数(*
pageList: [5,10,20,50,100,500,1000],//可供选择的每页的行数(*
height: 400,//高度调整 //行高如果没有设置height属性表格自动根据记录条数觉得表格高度
buttonsAlign: "left",//按钮对齐方式
columns:columns,
fixedColumns: mixFlag,//固定列
fixedNumber:5,//固定前七列
locale:'zh-CN',//中文支持,
url:path+'/template/cutomSearchTableSouth',//排序方式
queryParams: function (params) {
return{
sql:sql,
limit : params.limit, // 每页显示数量
offset : params.offset, // SQL语句起始索引
page : (params.offset / params.limit) + 1 //当前页码
}
},
responseHandler:function(res){
//在ajax获取到数据渲染表格之前修改数据源
var nres = [];
nres.push({total:res.total,rows:res.list});
return nres[0];
},
onLoadSuccess:function(res){
$(".clearfix").height(0);
$(".page-list").show();
$(".fixed-table-body").css("overflow","auto");
//赋值总数
$("#rows").val(res.total);
//全选
$('.fixed-table-container').on('click','input[name="btSelectAll"]',function(){
if($(this).is(':checked')){
$('input[name="btSelectItem"]').prop('checked',true);
}else{
$('input[name="btSelectItem"]').prop('checked',false);
}
})
//逐个选择
$('.fixed-table-container').on('click','input[name="btSelectItem"]',function(){
var inputs = $(this).parents('.fixed-table-body-columns').find('input[name="btSelectItem"]')
var num = 0;
inputs.each(function(){
if($(this).is(':checked')){
num++;
}
});
if(num==inputs.length){
$('input[name="btSelectAll"]').prop('checked',true);
}else{
$('input[name="btSelectAll"]').prop('checked',false);
}
var index = $(this).parents('tr').index();
$('#Table1').find('input[name="btSelectItem"]').eq(index).click();
});
},
//监听分页点击事件
onPageChange: function(num, type) {
pageNumber = num;
},
//选中单个复选框
onCheck:function(row){
var checks = $("#checks").val();
$("#checks").val( checks +="'"+row.patientId + "',");
},
//取消单个复选框
onUncheck:function(row){
var checks = $("#checks").val();
checks = checks.replace("'"+row.patientId + "',","");
$("#checks").val(checks);
},
//全选
onCheckAll:function(rows){
$("#checks").val("");
var checks = '';
for(var i=0;i<rows.length;i++)
{
checks += "'"+rows[i].patientId + "',"
}
$("#checks").val(checks);
},
//全不选
onUncheckAll: function (rows) {
$("#checks").val("");
},
//双击事件
onDblClickRow: function (row) {
//是否可查看
var borrowingOper = row.borrowingOper;
if (null != borrowingOper && borrowingOper == 1) {
window.open(returnShowDetailUrl(row.patientId));
}else {
toastr.warning("不可查看,必须申请通过!")
}
},
})
}
//定义查看详情的请求地址url
function returnShowDetailUrl(patientId) {
return path + '/font/showRecordFontSouth?patientId=' + patientId;
}
/**
* 单个借阅申请
* @param patientId
*/
function borrowingFont(patientId){
pickTime("effeTime", null);
$("#typeId").val('approves');
$("#checks").val("'"+patientId+"',");
$("#approveId").val("");
setFormToken();
}
/**
* 借阅申请列表提交
*/
function addApprove() {
if($("#effeTime").val() != ''){
var patientIds = $("#checks").val();
if(patientIds != '' && patientIds != undefined) {
var id = $("#approveId").val();
var effeTime = $("#effeTime").val();
var effeDays = $("#effeDays").val();
var applyType = 4;
var applyState = 2;
var applyReason = $("#applyReason").val();
$.ajax({
type:'post',
url:path+'/font/addApplyApprove',
data:{id:id,applyState:applyState,effeTime:effeTime,effeDays:effeDays,applyType:applyType,applyReason:applyReason,patientIds:patientIds,formToken:$("#formToken").val()},
dataType:'json',
success:function(data){
if(data!=null && data.code == 0){
toastr.success("申请成功,目前审核中,请耐心等待!");
$('#myModal1').modal('hide');
reLoadFontTable();
}else{
toastr.error(data.msg);
}
}
})
}
} else {
toastr.warning("有效时间不能为空!");
$("#effeTime").focus();
}
}
/**
* 列表行操作按钮
* @param value
* @param row
* @param index
* @returns {string}
* @constructor
*/
function AddFunctionAltyFont(value, row, index) {
var borrowingOper = row.borrowingOper;
var str = '';
if (borrowingOper == 1) {
str = '<a type="button" href="' + path + '/font/showRecordFontSouth?patientId=' + row.patientId + '" class="btn btn-danger TableView btn-sm" target="_blank">查看详情</a>';
}
if (borrowingOper == 2) {
str = '<p style="color:grey">正在等待审批</p>';
}
if (borrowingOper == 0) {
var patientId = "'" + row.patientId + "'";
str = '<button type="button" class="btn btn-primary TableView btn-sm" onclick="borrowingFont('+patientId+')" data-toggle="modal" data-target="#myModal1">借阅申请</button>';
}
return str;
}
/**
* 刷新表格
*/
function reLoadFontTable(){
$("#mytab").bootstrapTable('refresh',path+'/template/cutomSearchTableSouth');
$('#mytab').bootstrapTable('selectPage', pageNumber);
$("#checks").val("");
}
//搜索功能
function search() {
var startTime1 = $("#startTime1").val();
var endTime1 = $("#endTime1").val();
var startTime2 = $("#startTime2").val();
var endTime2 = $("#endTime2").val();
var age1 = $("#age1").val();
var age2 = $("#age2").val();
var diag_code1 = $("#diag_code1").val();
var diag_code2 = $("#diag_code2").val();
var operate_code1 = $("#operate_code1").val();
var operate_code2 = $("#operate_code2").val();
var other_diag_name1 = $("#other_diag_name1").val();
var other_diag_name2 = $("#other_diag_name2").val();
if ((age1 != '' && age2 == '') || (age1 == '' && age2 != '')) {
toastr.warning("请输入完整年龄段!");
return false;
}
if ((startTime1 != '' && endTime1 == '') || (startTime1 == '' && endTime1 != '')) {
toastr.warning("请输入完整的入院日期时间段!");
return false;
}
if ((startTime2 != '' && endTime2 == '') || (startTime2 == '' && endTime2 != '')) {
toastr.warning("请输入完整的出院日期时间段!");
return false;
}
if ((diag_code1 != '' && diag_code2 == '') || (diag_code1 == '' && diag_code2 != '')) {
toastr.warning("请输入完整的主诊编码范围!");
return false;
}
if ((operate_code1 != '' && operate_code2 == '') || (operate_code1 == '' && operate_code2 != '')) {
toastr.warning("请输入完整的手术编码范围!");
return false;
}
if ((other_diag_name1 != '' && other_diag_name2 == '') || (other_diag_name1 == '' && other_diag_name2 != '')) {
toastr.warning("请输入完整的其他诊断编码范围!");
return false;
}
getSql();
freshTableSouth();
}
/*****************************************输入框边输入内容边搜索功能方法*************************************************/
//级联病案号且长度超过4个字节才查询
function getInpatientNoContents(id) {
var keyword = document.getElementById(id).value;
if (keyword.length > 4) {
var ajax = new XMLHttpRequest();
var url = path + "/approve/getInpatientNosByName?inpatientNo=" + keyword;
ajax.open("GET", url, true);
ajax.send(null);
ajax.onreadystatechange = function () {
if (ajax.readyState == 4) {
if (ajax.status == 200) {
var result = ajax.responseText;
insertContent(result, id);
}
}
}
} else {
clearContent(id);
return;
}
}
//级联诊断码
function getDiagCodeContents(id) {
var keyword = document.getElementById(id).value;
if (keyword.length > 2) {
var ajax = new XMLHttpRequest();
var url = path + "/commom/getDiagCodeContents?code=" + keyword;
ajax.open("GET", url, true);
ajax.send(null);
ajax.onreadystatechange = function () {
if (ajax.readyState == 4) {
if (ajax.status == 200) {
var result = ajax.responseText;
insertContent(result, id);
}
}
}
} else {
clearContent(id);
return;
}
}
//级联诊断名称
function getDiagNameContents(id) {
var code = "";
var name = document.getElementById(id).value;
if (name.length > 2) {
var ajax = new XMLHttpRequest();
var url = path + "/commom/getDiagCodeContents?code=" + code + "&name=" + name;
ajax.open("GET", url, true);
ajax.send(null);
ajax.onreadystatechange = function () {
if (ajax.readyState == 4) {
if (ajax.status == 200) {
var result = ajax.responseText;
insertContent(result, id);
}
}
}
} else {
return;
}
clearContent('main_diag_name')
}
//级联手术编码
function getOperateCodeContents(id) {
var keyword = document.getElementById(id).value;
if (keyword.length > 2) {
var ajax = new XMLHttpRequest();
var url = path + "/commom/getOperateCodeContents?code=" + keyword;
ajax.open("GET", url, true);
ajax.send(null);
ajax.onreadystatechange = function () {
if (ajax.readyState == 4) {
if (ajax.status == 200) {
var result = ajax.responseText;
insertContent(result, id);
}
}
}
} else {
clearContent(id);
return;
}
}
//级联手术名称
function getOperateNameContents(id) {
var name = document.getElementById(id).value;
var code = "";
if (name.length > 2) {
var ajax = new XMLHttpRequest();
var url = path + "/commom/getOperateCodeContents?code=" + code + "&name=" + name;
ajax.open("GET", url, true);
ajax.send(null);
ajax.onreadystatechange = function () {
if (ajax.readyState == 4) {
if (ajax.status == 200) {
var result = ajax.responseText;
insertContent(result, id);
}
}
}
} else {
clearContent(id);
return;
}
}
//添加内容tr td
function insertContent(content, id) {
clearContent(id);
setLocation(id);
var json = JSON.parse(content);
for (key in json) {
var tr = document.createElement("tr");
var td1 = document.createElement("td");
var td2 = document.createElement("td");
var td4 = document.createElement("td");
tr.setAttribute("bgcolor", "#FFFAFA");
tr.setAttribute("border", "0");
if (id == 'main_diag_name'){
td1.innerHTML = json[key];
tr.appendChild(td1);
} else {
if (id == 'inpatient_no' || id == 'diag_code' || id == 'operate_code') {
td2.innerHTML = key;
} else {
td2.innerHTML = json[key];
td4.innerHTML = key;
}
tr.appendChild(td2);
tr.appendChild(td4);
}
document.getElementById(id + "Content").appendChild(tr);
tr.onmouseover = function () {
this.className = 'mouseOver';
document.getElementById(id).value = $(this).children("td").eq(0).html();
};
tr.onmouseout = function () {
this.className = 'mouseOut';
};
tr.onclick = function () {
clearContent(id);
}
}
}
//清楚内容方法
function clearContent(id) {
var popNode = document.getElementById(id + "Div");
popNode.style.border = "none";
var contentNode = document.getElementById(id + "Content");
var len = contentNode.childNodes.length;
for (var i = len - 1; i >= 0; i--) {
contentNode.removeChild(contentNode.childNodes[i]);
}
}
//设置样式
function setLocation(id) {
var inputNode = document.getElementById(id);
var width = inputNode.offsetWidth;
var left = inputNode["offsetLeft"];
var top = inputNode.offsetHeight + inputNode["offsetTop"];
var popNode = document.getElementById(id + "Div");
popNode.style.border = "gray 0.5px solid";
popNode.style.width = width + "px";
popNode.style.top = top + "px";
popNode.style.left = left + "px";
document.getElementById(id + "Content_table").style.width = width + "px";
}

@ -0,0 +1,165 @@
//加载数据表格
$('#mytab').bootstrapTable({
height: 7000,
toolbar: '#toolbar', //工具按钮用哪个容器
striped: true, //是否显示行间隔色
cache: false, //是否使用缓存默认为true所以一般情况下需要设置一下这个属性*
pagination: true, //是否显示分页(*
sidePagination: "server", //分页方式client客户端分页server服务端分页*
paginationPreText: '上一页',
paginationNextText: '下一页',
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 10, //每页的记录行数(*
pageList: [10, 15, 20, 30, 50],//可供选择的每页的行数(*
height: 320, //行高如果没有设置height属性表格自动根据记录条数觉得表格高度
columns: [
{
title: '全选',
field: 'select',
checkbox: true,
width: 25,
align: 'center',
valign: 'middle'
},
{
field: 'no',
title: '序号',
sortable: true,
formatter: function (value, row, index) {
//获取每页显示的数量
var pageSize = $('#mytab').bootstrapTable('getOptions').pageSize;
//获取当前是第几页
var pageNumber = $('#mytab').bootstrapTable('getOptions').pageNumber;
//返回序号注意index是从0开始的所以要加上1
return pageSize * (pageNumber - 1) + index + 1;
}
},
{
title: '病案号',
field: 'inpatientNo',
},
{
title: '姓名',
field: 'name',
},
{
title: '住院次数',
field: 'admissTimes',
},
{
title: '出院日期',
field: 'disDate',
formatter: function (value) {
if (value != '' && value.length == 21) {
return value.substring(0, value.length - 2);
}
}
},
{
title: '出院科室',
field: 'disDept',
},
{
title: '扫描状态',
formatter: function () {
return '已扫描'
}
},
{
title: '操作',
formatter: function (value, row) {
return '<a type="button" href="' + path + '/font/showRecordFontSouth?patientId=' + row.patientId + '" class="btn btn-danger TableView btn-sm" target="_blank">查看详情</a>';
}
}
],
locale: 'zh-CN',//中文支持,
url: path + '/font/getRecordListByInpatientNoSouth',//排序方式
queryParams: function (params) {
return {
limit: params.limit, // 每页显示数量
offset: params.offset, // SQL语句起始索引
page: (params.offset / params.limit) + 1, //当前页码,
inpatientNo: $("#inpatientNo").val(),
}
},
responseHandler: function (res) {
//在ajax获取到数据渲染表格之前修改数据源
var nres = [];
nres.push({total: res.total, rows: res.list});
return nres[0];
},
onLoadSuccess: function () {
$(".page-list").show();
$(".fixed-table-body").css("overflow", "auto");
},
//双击事件
onDblClickRow: function (row) {
var isShowDetail = row.isShowDetail;
if (isShowDetail == 2) {
window.open(returnShowDetailUrl(row.patientId));
}
},
})
/**
* 单个申请借阅
* @param patientId
*/
function borrowingFont(patientId){
pickTime("effeTime", null);
$("#typeId").val('approves');
$("#check").val("'"+patientId+"'");
$("#approveId").val("");
setFormToken();
}
function addApprove() {
if($("#effeTime").val() != ''){
var patientIds = $("#check").val();
if(patientIds != '' && patientIds != undefined) {
var id = $("#approveId").val();
var effeTime = $("#effeTime").val();
var effeDays = $("#effeDays").val();
var applyType = 4;
var applyState = 2;
var applyReason = $("#applyReason").val();
$.ajax({
type:'post',
url:path+'/font/addApplyApprove',
data:{id:id,applyState:applyState,effeTime:effeTime,effeDays:effeDays,applyType:applyType,applyReason:applyReason,patientIds:patientIds,formToken:$("#formToken").val()},
dataType:'json',
success:function(data){
if(data!=null && data.code == 0){
toastr.success("申请成功,目前审核中,请耐心等待!");
$('#myModal1').modal('hide');
reLoadFontTable();
}else{
toastr.error(data.msg);
}
}
})
}
} else {
toastr.warning("有效时间不能为空!");
$("#effeTime").focus();
}
}
function reLoadFontTable(){
$("#mytab").bootstrapTable('refresh',path+'/font/getRecordListByInpatientNoSouth');
$('#mytab').bootstrapTable('selectPage', pageNumber);
$("#check").val("");
}
//定义查看详情的请求地址url
function returnShowDetailUrl(patientId) {
return path + '/font/showRecordFontSouth?patientId=' + patientId;
}
//病案預覽
//查看详情
function showDetail(patientId) {
//隐藏模板选项
window.location.href = returnShowDetailUrl(patientId);
}

@ -7,11 +7,6 @@ var isIE = function(ver) {
//初始化函数 //初始化函数
$(function(){ $(function(){
$('.contentDiv').css('height', '100%').css('height', '-=140px'); $('.contentDiv').css('height', '100%').css('height', '-=140px');
//加载iframe
//谷歌
//$("#iframe").prop("src",path+"/commom/showRecordIframeBlood?patientId="+$("#patientId").val()+"&flag=file_path"+"&rootPaths="+$("#rootPaths").val());
//ie8加载iframe
//$("#iframe").prop("src",path+"/font/showRecordIframeBloodFont?patientId="+$("#patientId").val()+"&flag=file_path");
var ie = isIE(8); var ie = isIE(8);
if(ie) { if(ie) {
//ie8加载iframe //ie8加载iframe
@ -91,29 +86,3 @@ function loadAdmissTimes(){
} }
}) })
} }
/*//住院次数变更事件
$("#admissTimes").change(function () {
var val = $(this).val();
$(".admissTimes").val(val);
var inpatientNo = $("#inpatientNo").val();
var name = $("#name").val();
//变更基本信息,出院时间,出院科室,主要诊断,其他诊断
$.ajax({
type:'post',
url:path+"/commom/getOtherDiagNameByAdmissTimesAndInpatientNo",
data:{name:$("#name").val(),admissTimes:val,inpatientNo:$("#inpatientNo").val(),startTime2:$("#disDate").val()},
dataType:'json',
success:function(d){
if(d != null){
$("#patientId").val(d.patientId);
$("#iframe").prop("src",path+"/commom/showRecordIframe?patientId="+d.patientId);
$("#disDate").val(d.disDate);
$("#disDeptName").val(d.disDept);
$("#diagName").val(d.mainDiagName);
$("#otherDiagName").val(d.otherDiagName);
//重新加载其他诊断名称鼠标滑过显示全部文本
loadQtip('.otherDiagName');
}
}
})
})*/

@ -0,0 +1,91 @@
//判断是否是ie8
var isIE = function(ver) {
var b = document.createElement('b')
b.innerHTML = '<!--[if IE ' + ver + ']><i></i><![endif]-->'
return b.getElementsByTagName('i').length === 1
}
//初始化函数
$(function(){
$('.contentDiv').css('height', '100%').css('height', '-=140px');
var ie = isIE(8);
debugger
if(ie) {
//ie8加载iframe
console.log("ssd");
$("#iframe").prop("src",path+"/font/showRecordIframeFontSouth?patientId="+$("#patientId").val()+"&flag=file_path");
}else{
//谷歌
$("#iframe").prop("src",path+"/commom/showRecordIframeSouth?patientId="+$("#patientId").val()+"&flag=file_path"+"&rootPaths="+$("#rootPaths").val());
}
//加载其他诊断名称鼠标滑过显示全部文本
//loadQtip('.otherDiagName');
//加载病案信息
loadRecord();
//加载住院次数
loadAdmissTimes();
})
//加载病案信息
function loadRecord(){
$.ajax({
type:'get',
url:path+'/commom/getRecord',
data:{patientId:$("#patientId").val(),flag:$("#flag").val()},
async:false,
dataType:'json',
success:function (data) {
if(null != data && data != ''){
$("#inpatientNo").val(data.inpatientNo);
$("#name").val(data.name);
$("#admissTimes1").val(data.admissTimes);
$("#inpatientNo1").val(data.inpatientNo);
$("#name1").val(data.name);
$("#admissTimesValue").val(data.admissTimes);
$("#disDate").val(data.disDate);
$("#disDeptName").val(data.disDept);
$("#diagName").val(data.mainDiagName);
$("#otherDiagName").val(data.otherDiagName);
//判断哪家医院赋值扫描图片和新上传图片的根目录集合
var flag = $("#flag").val();
var rootPaths = "";
if(flag != '' && flag == 'home_addr'){
//脐血库
rootPaths = data.homeAddr + ",";
}else if(flag != '' && flag == 'file_path'){
//祈福医院
rootPaths = data.filePath + ",";
}
//拼接新上传图片根目录
if(data.newFile != null && data.newFile != ''){
rootPaths += data.newFile;
}
$("#rootPaths").val(rootPaths);
}
}
})
}
//加载住院次数
function loadAdmissTimes(){
$.ajax({
type:'get',
url:path+'/commom/getAdmissTimes',
data:{name:$("#name").val(),inpatientNo:$("#inpatientNo").val()},
dataType:'json',
success:function (data) {
if(null != data && data != ''){
$("#admissTimes").empty();
var html = '';
for (var i = 0; i < data.length; i++) {
if($("#admissTimesValue").val() == (data[i].admissTimes)){
html += '<option value="'+data[i].admissTimes+'" selected>'+data[i].admissTimesName+'</option>';
}else{
html += '<option value="'+data[i].admissTimes+'">'+data[i].admissTimesName+'</option>';
}
}
$("#admissTimes").append(html);
}
}
})
}

@ -32,6 +32,7 @@ var tree = $('#data').data('jstree', false).empty().jstree({
var assortList = data[0].children; var assortList = data[0].children;
var assortIds = ''; var assortIds = '';
var sources = ''; var sources = '';
var scanPages = '';
if(assortList != '') { if(assortList != '') {
for (var i = 0; i < assortList.length; i++) { for (var i = 0; i < assortList.length; i++) {
var picList = assortList[i].children; var picList = assortList[i].children;
@ -149,12 +150,13 @@ tree.on('uncheck_node.jstree', function(node, data, event) {
selectAssortIds(); selectAssortIds();
}); });
//加载pdf按钮功能 //加载pdf按钮功能
function onloadPdf(){ function onloadPdf(scanPages){
$("#loading1").css("background","url("+path+"/static/img/load.gif) no-repeat 10px 50%"); $("#loading1").css("background","url("+path+"/static/img/load.gif) no-repeat 10px 50%");
var patientId = $("#patientId").val(); var patientId = $("#patientId").val();
var assortIds = $("#assortIds").val(); var assortIds = $("#assortIds").val();
var sources = $("#sources").val(); var sources = $("#sources").val();
var flag = $("#flag").val(); var flag = $("#flag").val();
var rootPaths = parent.$("#rootPaths").val();
var url = path+"/font/showRecordContentBloodFont?flag="+flag+"&patientId="+patientId+"&scanPages="+assortIds+"&sources="+sources; var url = path+"/font/showRecordContentBloodFont?flag="+flag+"&patientId="+patientId+"&scanPages="+assortIds+"&sources="+sources;
$("#iframe1").prop("src",url); $("#iframe1").prop("src",url);
} }
@ -170,3 +172,4 @@ function printInfoBlood(){
var flag = $("#flag").val(); var flag = $("#flag").val();
post(path+'/template/printInfoBlood',{"patientIds":patientId,"assortIds":assortIds,"typeId":typeId,"flag":flag}); post(path+'/template/printInfoBlood',{"patientIds":patientId,"assortIds":assortIds,"typeId":typeId,"flag":flag});
} }

@ -0,0 +1,159 @@
//下载adobe地址
//http://ardownload.adobe.com/pub/adobe/reader/win/9.x/9.3/chs/AdbeRdr930_zh_CN.exe
window.onload = function () {
var checkAdobeReader = Check_AdobeReader();
if(checkAdobeReader != 'Acrobat Version: 6.0'){
alert("对不起,您还没有安装PDF阅读器软件呢,为了方便预览PDF文档,请选择安装!");
location = path + "/static/js/font/AdbeRdr60_chs_full.exe";
}
}
var tree = $('#data').data('jstree', false).empty().jstree({
'core': {
"data" : function (obj, callback){
$.ajax({
type : "post",
url : path+'/font/getFontBloodRecordTree?patientId='+$("#patientId").val(),
dataType : "json",
success : function(data) {
var assortList = data[0].children;
var assortIds = '';
var sources = '';
if(assortList != '') {
for (var i = 0; i < assortList.length; i++) {
var picList = assortList[i].children;
for (var j = 0; j < picList.length; j++) {
assortIds += picList[j].newName + ",";
sources += picList[j].source + ",";
}
}
if(assortIds != ''){
assortIds = assortIds.substring(0,assortIds.length-1);
}
if(sources != ''){
sources = sources.substring(0,sources.length-1);
}
$("#assortIds").val(assortIds);
$("#sources").val(sources);
onloadPdf();
}else{
$("#jstree").html("暂无数据!");
}
if(data){
callback.call(this, data);
}
}
});
},
"check_callback": true
},
plugins: ["checkbox"],
"checkbox": {
"keep_selected_style": false,//是否默认选中
"three_state": true,//父子级别级联选择
"tie_selection": false
},
});
function Check_AdobeReader() {
var displayString;
var acrobat = new Object();
acrobat.installed = false;
acrobat.version = "0.0";
if (navigator.plugins && navigator.plugins.length) {
for (x = 0; x < navigator.plugins.length; x++) {
if (navigator.plugins[x].description.indexOf("Adobe Acrobat") != -1) {
acrobat.version = parseFloat(navigator.plugins[x].description.split("Version ")[1]);
if (acrobat.version.toString().length == 1) acrobat.version += ".0";
acrobat.installed = true;
displayString = "Acrobat Version: " + acrobat.version;
break;
} else if (navigator.plugins[x].description.indexOf("Adobe PDF Plug-In") != -1) {
acrobat.installed = true;
acrobat.version = "8+";
displayString = "Acrobat Version 8 or Above";
}
}
} else if (window.ActiveXObject) {
for (x = 2; x < 10; x++) {
try {
oAcro = eval("new ActiveXObject('PDF.PdfCtrl." + x + "');");
if (oAcro) {
acrobat.installed = true;
acrobat.version = x + ".0";
displayString = "Acrobat Version: " + acrobat.version;
}
}
catch (e) { }
}
try {
oAcro4 = new ActiveXObject("PDF.PdfCtrl.1");
if (oAcro4) {
acrobat.installed = true;
acrobat.version = '4.0';
displayString = 'Acrobat Version: ' + acrobat.version;
}
}
catch (e) { }
try {
oAcro7 = new ActiveXObject('AcroPDF.PDF.1');
if (oAcro7) {
acrobat.installed = true;
acrobat.version = '7.0';
displayString = 'Acrobat Version: ' + acrobat.version;
}
}
catch (e) { }
}
return displayString;
}
//checkBox选中、取消选中逻辑
function selectAssortIds(){
var instance = $('#data').jstree(true);//获取jstree对象
var nodes = instance.get_checked(true);
var assortIds = '';
var sources = '';
for(var i = 0;i < nodes.length;i++){
if(nodes[i].children == ''){
assortIds += nodes[i].original.newName + ",";
sources += nodes[i].original.source + ",";
}
}
if(assortIds != ''){
assortIds = assortIds.substring(0,assortIds.length - 1);
}
if(sources != ''){
sources = sources.substring(0,sources.length - 1);
}
$("#assortIds").val(assortIds);
$("#sources").val(sources);
}
//checkbox 选中事件
$('#data').on("check_node.jstree", function (node, data, event) {
selectAssortIds();
});
tree.on('uncheck_node.jstree', function(node, data, event) {
selectAssortIds();
});
//加载pdf按钮功能
function onloadPdf(){
$("#loading1").css("background","url("+path+"/static/img/load.gif) no-repeat 10px 50%");
var patientId = $("#patientId").val();
var assortIds = $("#assortIds").val();
var sources = $("#sources").val();
var flag = $("#flag").val();
var url = path+"/font/showRecordContentSouthFont?flag="+flag+"&patientId="+patientId+"&scanPages="+assortIds+"&sources="+sources;
$("#iframe1").prop("src",url);
}
//记录打印记录
function printInfoBlood(){
var patientId = "'"+$("#patientId").val()+"'";
var assortIds = $("#assortIds").val();
var typeId = $("#typeId").val();
if(typeId == undefined){
typeId = '';
}
var flag = $("#flag").val();
post(path+'/template/printInfoBlood',{"patientIds":patientId,"assortIds":assortIds,"typeId":typeId,"flag":flag});
}

@ -203,7 +203,6 @@ function deleteById(id){
url: path + '/funGroupDistribution/deleteById/' + id, url: path + '/funGroupDistribution/deleteById/' + id,
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {
debugger
if (data.code == 100) { if (data.code == 100) {
toastr.success("删除成功!"); toastr.success("删除成功!");
refreshTable(); refreshTable();

@ -0,0 +1,213 @@
var pageNumber;
$('#mytab').bootstrapTable({
toolbar: '#toolbar', //工具按钮用哪个容器
striped: true, //是否显示行间隔色
cache: false, //是否使用缓存默认为true所以一般情况下需要设置一下这个属性*
pagination: true, //是否显示分页(*
sidePagination: "server", //分页方式client客户端分页server服务端分页*
paginationPreText : '上一页',
paginationNextText : '下一页',
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 10, //每页的记录行数(*
pageList: [5,10,15,20,50,1000],//可供选择的每页的行数(*
height: $(window).height()-109, //行高如果没有设置height属性表格自动根据记录条数觉得表格高度
columns:[
{
title:'全选',
field:'select',
checkbox:true,
width:25,
align:'center',
valign:'middle'
},
{
field: 'no',
title: '序号',
sortable: true,
formatter: function (value, row, index) {
//获取每页显示的数量
var pageSize=$('#mytab').bootstrapTable('getOptions').pageSize;
//获取当前是第几页
var pageNumber=$('#mytab').bootstrapTable('getOptions').pageNumber;
//返回序号注意index是从0开始的所以要加上1
return pageSize * (pageNumber - 1) + index + 1;
}
},
{
title:'访问用户',
field:'creater',
},
{
title:'日志主题',
field:'logTitle',
},
{
title:'日志内容',
field:'logContent',
},
{
title:'备注',
field:'remark',
},
{
title:'操作时间',
field:'createDate',
},
{
title:'ip地址',
field:'ip',
},
{
title:'操作',
field:'id',
formatter: function(value,row,index){
var deleteOper = row.deleteOper;
if(deleteOper == 1){
var editanddrop = '<button type="button" onclick="deleteLogById('+row.logId+')" class="btn btn-sm btn-danger">删除</button>';
return editanddrop;
}
}
}
],
locale:'zh-CN',//中文支持,
url:path+'/otherManage/getLogListIf',//排序方式
queryParams: function (params) {
return{
limit : params.limit, // 每页显示数量
offset : params.offset, // SQL语句起始索引
page : (params.offset / params.limit) + 1, //当前页码,
startTime:$("#startTime1").val(),
endTime:$("#endTime1").val(),
creater:$("#creater").val(),
logTitle:$("#logTitle").val(),
logContent:$("#logContent").val()
}
},
//选中单个复选框
onCheck:function(row){
var checks = $("#checks").val();
$("#checks").val(checks+=row.logId + ",");
},
//取消单个复选框
onUncheck:function(row){
var checks = $("#checks").val();
checks = checks.replace(row.logId + ",");
$("#checks").val(checks);
},
//全选
onCheckAll:function(rows){
$("#checks").val("");
var checks = '';
for(var i=0;i<rows.length;i++)
{
checks += rows[i].logId + ","
}
$("#checks").val(checks);
},
//全不选
onUncheckAll: function (rows) {
$("#checks").val("");
},
responseHandler:function(res){
//在ajax获取到数据渲染表格之前修改数据源
var nres = [];
nres.push({total:res.total,rows:res.list});
return nres[0];
},
onLoadSuccess:function(){
$(".page-list").show();
$(".fixed-table-body").css("overflow","auto");
},
//监听分页点击事件
onPageChange: function(num, type) {
pageNumber = num;
}
})
//查询按钮
function refreshTable(){
$("#checks").val("");
$('#mytab').bootstrapTable('refresh',{
url : path+'/otherManage/getLogListIf'
})
$('#mytab').bootstrapTable('selectPage', pageNumber);
}
//删除
function deleteLogById(logId){
Common.confirm({
title: "提示",
message: '确定删除这条数据吗?',
operate: function (reselt) {
if (reselt) {
$.ajax({
type: 'post',
url: path + '/otherManage/deleteLogById/' + logId,
dataType: 'json',
success: function (data) {
if (data.code == 0) {
toastr.success("删除成功!");
refreshTable();
} else {
toastr.warning(data.msg);
}
}
})
}
}
})
}
//批量删除
function deleteLogByIds(){
var ids = $("#checks").val();
if(ids != ''){
var idStr = ids.split(",");
Common.confirm({
title: "提示",
message: '确定删除选中的'+ (idStr.length-1)+ '条数据吗?',
operate: function (reselt) {
if (reselt) {
$.ajax({
type: 'post',
url: path + '/otherManage/deleteLogByIds/' + ids,
dataType: 'json',
success: function (data) {
if (data.code == 0) {
toastr.success("删除成功!");
$("#checks").val("");
refreshTable();
} else {
toastr.warning(data.msg);
}
}
})
}
}
})
}else{
toastr.warning("请至少选中一个!");
}
}
//导出excel功能
function exportExcel(){
var checks = $("#checks").val();
if(checks != '') {
checks = checks.substring(0, checks.length - 1);
var url = path+"/otherManage/exportExcel?startTime="+$("#startTime1").val()+"&endTime="+$("#endTime1").val()+"&creater="+$("#creater").val()+"&logTitle=接口查看&logContent="+$("#logContent").val()
+"&checks="+checks;
window.location.href = url;
}else{
Common.confirm({
title: "提示",
message: "没有选中,您确定要按搜索栏条件导出?",
operate: function (reselt) {
if (reselt) {
var url = path+"/otherManage/exportExcel?startTime="+$("#startTime1").val()+"&endTime="+$("#endTime1").val()+"&creater="+$("#creater").val()+"&logTitle=接口查看&logContent="+$("#logContent").val();
window.open(url);
}
}
})
}
}
$(function () {
initDateInput(1);
})

@ -2,6 +2,9 @@ $(function () {
getTime(); getTime();
}); });
/**
* 获取当前年月日
*/
function getTime() { function getTime() {
var date = new Date(); var date = new Date();
var year = date.getFullYear(); var year = date.getFullYear();
@ -11,7 +14,16 @@ function getTime() {
$("#timeShow").html(time); $("#timeShow").html(time);
} }
//待审批图片点击事件 /**
* 待审批图片点击事件
*/
function notApproveClick(){ function notApproveClick(){
location.href = path + '/approve/approveManageList174'; location.href = path + '/approve/approveManageList174';
} }
/**
* 下载数量点击事件
*/
function pdfDownloadClick() {
location.href = path + '/downloadInfoList/pageUI174';
}

@ -243,6 +243,7 @@ $("#isOper").change(function () {
//时间格式属性名集合 //时间格式属性名集合
var commomtable = 'commomtable'; var commomtable = 'commomtable';
var commomtable1 = 'commomtable1';
//拼接sql //拼接sql
function getSql() { function getSql() {
@ -423,6 +424,7 @@ function getSql() {
name = 'dis_date'; name = 'dis_date';
whereNames += commomtable + "." + name + " BETWEEN '" + $("#startTime2").val() + " 00:00:00' AND '" + $("#endTime2").val() + " 23:59:59' AND "; whereNames += commomtable + "." + name + " BETWEEN '" + $("#startTime2").val() + " 00:00:00' AND '" + $("#endTime2").val() + " 23:59:59' AND ";
} }
debugger
//诊断名称 //诊断名称
if ($("#diag_name").val() != '') { if ($("#diag_name").val() != '') {
name = 'main_diag_name'; name = 'main_diag_name';
@ -465,7 +467,37 @@ function getSql() {
name = 'operate_name'; name = 'operate_name';
whereNames += "t_operate." + name + " LIKE '%" + $("#" + name).val() + "%' AND "; whereNames += "t_operate." + name + " LIKE '%" + $("#" + name).val() + "%' AND ";
} }
var userName = "'" + $("#userId").val() + "'"; //主诊编码范围
if ($("#diag_code1").val() != '' && $("#diag_code2").val() != '') {
name = 'main_diag_code';
whereNames += commomtable + "." + name + " BETWEEN '" + $("#diag_cod下·下·e1").val() + "' AND '" + $("#diag_code2").val() + "' AND ";
}
//手术编码范围
if ($("#operate_code1").val() != '' && $("#operate_code2").val() != '') {
name = 'operate_code';
whereNames += "t_operate." + name + " BETWEEN '" + $("#operate_code1").val() + "' AND '" + $("#operate_code2").val() + "' AND ";
}
//其他诊断编码范围
if ($("#other_diag_name1").val() != '' && $("#other_diag_name2").val() != '') {
name = 'other_diag_name';
whereNames += commomtable + "." + name + " BETWEEN '" + $("#other_diag_name1").val() + "' AND '" + $("#other_diag_name2").val() + "' AND ";
}
//科主任
if ($("#dept_director").val() != '') {
name = 'dept_director';
whereNames += commomtable1 + "." + name + " LIKE '%" + $("#dept_director").val() + "%' AND ";
}
//主任(副主任)
if ($("#director").val() != '') {
name = 'director';
whereNames += commomtable1 + "." + name + " LIKE '%" + $("#director").val() + "%' AND ";
}
//住院医师
if ($("#admiss_doctor").val() != '') {
name = 'admiss_doctor';
whereNames += commomtable1 + "." + name + " LIKE '%" + $("#admiss_doctor").val() + "%' AND ";
}
var userName = "'" + $("#userName").val() + "'";
fromTableNames += ' left join emr_apply_approve on ' + commomtable + '.patient_id = emr_apply_approve.patient_id \n' + fromTableNames += ' left join emr_apply_approve on ' + commomtable + '.patient_id = emr_apply_approve.patient_id \n' +
'and emr_apply_approve.approve_state = 1 and emr_apply_approve.effe_time > GETDATE()-1 and emr_apply_approve.applyer = ' + userName + ' and emr_apply_approve.apply_type != 3 ' + 'and emr_apply_approve.approve_state = 1 and emr_apply_approve.effe_time > GETDATE()-1 and emr_apply_approve.applyer = ' + userName + ' and emr_apply_approve.apply_type != 3 ' +
' left join emr_apply_approve emr_apply_approve1 on ' + commomtable + '.patient_id = emr_apply_approve1.patient_id \n' + ' left join emr_apply_approve emr_apply_approve1 on ' + commomtable + '.patient_id = emr_apply_approve1.patient_id \n' +
@ -476,6 +508,9 @@ function getSql() {
if($("#all_diag_name").val() != ''){ if($("#all_diag_name").val() != ''){
fromTableNames += ' left join t_diag on '+commomtable+'.patient_id=t_diag.patient_id'; fromTableNames += ' left join t_diag on '+commomtable+'.patient_id=t_diag.patient_id';
} }
if ($("#admiss_doctor").val() != '' || $("#director").val() != '' || $("#dept_director").val() != '') {
fromTableNames += ' left join ' + commomtable1 + ' on ' + commomtable1 + '.patient_id = ' + commomtable + '.patient_id';
}
//拼接手术表 //拼接手术表
var operFlag = false; var operFlag = false;
$(".operTable").each(function () { $(".operTable").each(function () {
@ -484,9 +519,9 @@ function getSql() {
return false; return false;
} }
}) })
if (operFlag) { if (operFlag || $("#operate_code1").val() != '' || $("#operate_code2").val() != '') {
otherTable = 't_operate'; otherTable = 't_operate';
fromTableNames += ' left join ' + otherTable + ' on ' + commomtable + '.patient_id=' + otherTable + '.patient_id'; fromTableNames += ' left join ' + otherTable + ' on ' + commomtable + '.patient_id = ' + otherTable + '.patient_id';
} }
//拼接主治医生 //拼接主治医生
if ($("#attending").val() != '') { if ($("#attending").val() != '') {
@ -497,16 +532,8 @@ function getSql() {
var isOper = $("#isOper").val(); var isOper = $("#isOper").val();
if (isOper != '' && isOper == 1) { if (isOper != '' && isOper == 1) {
name = 'is_oper'; name = 'is_oper';
whereNames += commomtable + "." + name + " = '有' AND "; whereNames += commomtable + "." + name + " = '1' AND ";
} }
//拼接院内感染表
/*var taint_name = $("#taint_name").val();
if(taint_name != ''){
otherTable = 't_taint';
fromTableNames += ' left join '+otherTable+' on '+commomtable+'.patient_id='+otherTable+'.patient_id';
name = 'taint_name';
whereNames += otherTable+".taint_type='1' AND "+otherTable+"."+name+" LIKE '%"+$("#"+name).val()+"%' AND ";
}*/
if (whereNames != ' where ') { if (whereNames != ' where ') {
whereNames = whereNames.substring(0, whereNames.length - 4); whereNames = whereNames.substring(0, whereNames.length - 4);
var orderBys = " ORDER BY " + commomtable + ".inpatient_no," + commomtable + ".admiss_times"; var orderBys = " ORDER BY " + commomtable + ".inpatient_no," + commomtable + ".admiss_times";
@ -514,7 +541,13 @@ function getSql() {
$("#sql").val(sql); $("#sql").val(sql);
$("#orderBys").val(orderBys); $("#orderBys").val(orderBys);
} }
//console.log(sql); if (whereNames == ' where ') {
var orderBys = " ORDER BY " + commomtable + ".inpatient_no," + commomtable + ".admiss_times";
var sql = selectNames + fromTableNames;
$("#sql").val(sql);
$("#orderBys").val(orderBys);
}
console.log(sql);
} else { } else {
$("#sql").val(""); $("#sql").val("");
} }
@ -528,6 +561,12 @@ function search() {
var endTime2 = $("#endTime2").val(); var endTime2 = $("#endTime2").val();
var age1 = $("#age1").val(); var age1 = $("#age1").val();
var age2 = $("#age2").val(); var age2 = $("#age2").val();
var diag_code1 = $("#diag_code1").val();
var diag_code2 = $("#diag_code2").val();
var operate_code1 = $("#operate_code1").val();
var operate_code2 = $("#operate_code2").val();
var other_diag_name1 = $("#other_diag_name1").val();
var other_diag_name2 = $("#other_diag_name2").val();
if ((age1 != '' && age2 == '') || (age1 == '' && age2 != '')) { if ((age1 != '' && age2 == '') || (age1 == '' && age2 != '')) {
toastr.warning("请输入完整年龄段!"); toastr.warning("请输入完整年龄段!");
return false; return false;
@ -540,6 +579,18 @@ function search() {
toastr.warning("请输入完整的出院日期时间段!"); toastr.warning("请输入完整的出院日期时间段!");
return false; return false;
} }
if ((diag_code1 != '' && diag_code2 == '') || (diag_code1 == '' && diag_code2 != '')) {
toastr.warning("请输入完整的主诊编码范围!");
return false;
}
if ((operate_code1 != '' && operate_code2 == '') || (operate_code1 == '' && operate_code2 != '')) {
toastr.warning("请输入完整的手术编码范围!");
return false;
}
if ((other_diag_name1 != '' && other_diag_name2 == '') || (other_diag_name1 == '' && other_diag_name2 != '')) {
toastr.warning("请输入完整的其他诊断编码范围!");
return false;
}
getSql(); getSql();
freshTable(); freshTable();
} }
@ -550,15 +601,12 @@ function showDetail(patientId) {
//window.location.href=path+"/commom/showRecord?patientId="+patientId; //window.location.href=path+"/commom/showRecord?patientId="+patientId;
} }
//导出excel功能 //导出excel功能
function exportExcel() { function exportExcel() {
getChecked(); getChecked();
//var isInputValue = getInputValue();
var checks = $("#checks").val(); var checks = $("#checks").val();
/*if(isInputValue == '' && checks == ''){
toastr.warning("请至少选择一个!")
}else{
*/
if ($("#rows").val() > 5000 && checks == '') { if ($("#rows").val() > 5000 && checks == '') {
toastr.warning("数据量大,暂提供5000条以内数据导出!"); toastr.warning("数据量大,暂提供5000条以内数据导出!");
} else { } else {

@ -43,10 +43,8 @@ function loadRecord(){
$("#name1").val(data.name); $("#name1").val(data.name);
$("#admissTimesValue").val(data.admissTimes); $("#admissTimesValue").val(data.admissTimes);
var disDate = data.disDate; var disDate = data.disDate;
if(disDate != null && disDate != ''){ disDate = covertDate(disDate);
disDate = covertDate(disDate); $("#disDate").val(disDate);
$("#disDate").val(disDate);
}
$("#disDeptName").val(data.disDept); $("#disDeptName").val(data.disDept);
$("#diagName").val(data.mainDiagName); $("#diagName").val(data.mainDiagName);
var delCount = data.delCount; var delCount = data.delCount;
@ -65,8 +63,8 @@ function loadRecord(){
rootPaths = data.filePath + ","; rootPaths = data.filePath + ",";
} }
//拼接新上传图片根目录 //拼接新上传图片根目录
if(data.newFile != null && data.newFile != ''){ if(data.newPath != null && data.newPath != ''){
rootPaths += data.newFile; rootPaths += data.newPath;
} }
$("#rootPaths").val(rootPaths); $("#rootPaths").val(rootPaths);
$("#otherDiagName").val(data.otherDiagName); $("#otherDiagName").val(data.otherDiagName);
@ -299,6 +297,7 @@ function save(){
var assortId = $("#assortId").val(); var assortId = $("#assortId").val();
if(assortId != ''){ if(assortId != ''){
if(file1.length > 0){ if(file1.length > 0){
debugger
for (var i = 0; i < file1.length; i++) { for (var i = 0; i < file1.length; i++) {
formData.append('files', file1[i]); formData.append('files', file1[i]);
} }
@ -316,6 +315,7 @@ function save(){
success : function(data){ success : function(data){
if(data.code == 0){ if(data.code == 0){
toastr.success("上传成功"); toastr.success("上传成功");
$('#myModal3').modal('hide');
}else{ }else{
toastr.error(data.msg); toastr.error(data.msg);
} }

@ -1,331 +1,525 @@
//树操作 //树操作
var menu = { var menu = {
setting: { setting: {
view:{ view: {
fontCss : {"font-family": "微软雅黑","color":"blue"} fontCss: {"font-family": "微软雅黑", "color": "blue"}
}, },
data:{ data: {
key:{ key: {
name:"newName" name: "newName"
}, },
simpleData: { simpleData: {
chkStyle: "checkbox", chkStyle: "checkbox",
enable: true, enable: true,
idKey: "id", idKey: "id",
pIdKey: "parentId", pIdKey: "parentId",
}, },
}, },
check:{ check: {
enable:true enable: true
}, },
callback: { //回调函数 callback: { //回调函数
onCheck: onCheck, onCheck: onCheck,
onClick:onClick} onClick: onClick
}, }
loadMenuTree:function(){ },
$.ajax({ loadMenuTree: function () {
type: "post", $.ajax({
url:path+"/commom/getBloodRecordTree", type: "post",
data:{patientId:$("#patientId").val(),typeId:$("#typeId").val()}, url: path + "/commom/getBloodRecordTree",
dataType:"json", data: {patientId: $("#patientId").val(), typeId: $("#typeId").val()},
success:function(data){ dataType: "json",
$("#assortIds").val(""); success: function (data) {
if(data != null){ $("#assortIds").val("");
//图片相对路径集合 if (data != null) {
var scanPages = ''; //图片相对路径集合
//图片来源集合 var scanPages = '';
var sources = ''; //图片来源集合
for (var i = 0; i < data.length; i++) { var sources = '';
if(data[i].parentId != null && data[i].parentId != 1 && data[i].checked == 'true'){ for (var i = 0; i < data.length; i++) {
scanPages += data[i].assortName+","; if (data[i].parentId != null && data[i].parentId != 1 && data[i].checked == 'true') {
sources += data[i].source + ","; scanPages += data[i].assortName + ",";
} sources += data[i].source + ",";
} }
//去掉后面逗号 }
if(scanPages != ''){ //去掉后面逗号
scanPages = scanPages.substring(0,scanPages.length-1); if (scanPages != '') {
$("#assortIds").val(scanPages); scanPages = scanPages.substring(0, scanPages.length - 1);
sources = sources.substring(0,sources.length-1); $("#assortIds").val(scanPages);
$("#sources").val(sources); sources = sources.substring(0, sources.length - 1);
} $("#sources").val(sources);
$.fn.zTree.init($("#ztree"), menu.setting, data); }
zTree = $.fn.zTree.getZTreeObj("ztree"); $.fn.zTree.init($("#ztree"), menu.setting, data);
var nodes = zTree.getNodes(); zTree = $.fn.zTree.getZTreeObj("ztree");
for (var i = 0; i < nodes.length; i++) { //设置节点展开 var nodes = zTree.getNodes();
zTree.expandNode(nodes[i], true, false, true); for (var i = 0; i < nodes.length; i++) { //设置节点展开
} zTree.expandNode(nodes[i], true, false, true);
//加载pdf }
onloadPdf(scanPages,sources); //加载pdf
} onloadPdf(scanPages, sources);
} }
}) }
} })
}
}; };
//加载树 //加载树
$().ready(function(data){ $().ready(function (data) {
menu.loadMenuTree(); menu.loadMenuTree();
}); });
//树选中事件 //树选中事件
function onCheck(e, treeId, treeNode) { function onCheck(e, treeId, treeNode) {
var treeObj=$.fn.zTree.getZTreeObj("ztree"); var treeObj = $.fn.zTree.getZTreeObj("ztree");
nodes=treeObj.getCheckedNodes(true); nodes = treeObj.getCheckedNodes(true);
var assortIds = ''; var assortIds = '';
var sources = ''; var sources = '';
for (var i = 0; i < nodes.length; i++) { for (var i = 0; i < nodes.length; i++) {
if(nodes[i].level == 2){ if (nodes[i].level == 2) {
if(i != (nodes.length-1)){ if (i != (nodes.length - 1)) {
assortIds += nodes[i].assortName+","; assortIds += nodes[i].assortName + ",";
sources += + nodes[i].source+","; sources += +nodes[i].source + ",";
}else{ } else {
assortIds += nodes[i].assortName + ""; assortIds += nodes[i].assortName + "";
sources += nodes[i].source; sources += nodes[i].source;
} }
} }
} }
$("#assortIds").val(assortIds); $("#assortIds").val(assortIds);
$("#sources").val(sources); $("#sources").val(sources);
}; };
//树点击事件 //树点击事件
function onClick(e, treeId, treeNode) { function onClick(e, treeId, treeNode) {
var treeLevel = treeNode.level; var treeLevel = treeNode.level;
//选中图片节点时 //选中图片节点时
if(treeLevel == 2){ if (treeLevel == 2) {
//图片集合 //图片集合
var scanPages = treeNode.assortName; var scanPages = treeNode.assortName;
//来源集合 //来源集合
var sources = treeNode.source; var sources = treeNode.source;
$("#assortIdByClick").val(scanPages); $("#assortIdByClick").val(scanPages);
$("#sourceByClick").val(sources); $("#sourceByClick").val(sources);
onloadPdf(scanPages,sources); onloadPdf(scanPages, sources);
} }
}; };
//打印分类变更事件 //打印分类变更事件
$("#typeId").change(function(){ $("#typeId").change(function () {
menu.loadMenuTree(); menu.loadMenuTree();
}) })
//树复选框选中后加载pdf按钮 //树复选框选中后加载pdf按钮
function onloadPdfMethod(){ function onloadPdfMethod() {
var scanPages = $("#assortIds").val(); var scanPages = $("#assortIds").val();
//来源集合 //来源集合
var sources = $("#sources").val(); var sources = $("#sources").val();
$("#assortIdByClick").val(""); $("#assortIdByClick").val("");
$("#sourceByClick").val(""); $("#sourceByClick").val("");
onloadPdf(scanPages,sources); onloadPdf(scanPages, sources);
} }
//加载pdf按钮功能 //加载pdf按钮功能
function onloadPdf(scanPages,sources){ function onloadPdf(scanPages, sources) {
$("#iframeLoad").val(""); $("#iframeLoad").val("");
$("#printPicLoaded").val(""); $("#printPicLoaded").val("");
var patientId = $("#patientId").val(); var patientId = $("#patientId").val();
//根目录字段识别名称 //根目录字段识别名称
var flag = parent.$("#flag").val(); var flag = parent.$("#flag").val();
var str= path+"/commom/showRecordContentBlood?patientId="+patientId+"&scanPages="+scanPages+"&sources="+sources+"&flag="+flag; var str = path + "/commom/showRecordContentBlood?patientId=" + patientId + "&scanPages=" + scanPages + "&sources=" + sources + "&flag=" + flag;
$("#iframe1").attr("src",path+"/static/pdfjs/web/viewer1.html?file="+encodeURIComponent(str)); $("#iframe1").attr("src", path + "/static/pdfjs/web/viewer1.html?file=" + encodeURIComponent(str));
var rootPaths = parent.$("#rootPaths").val(); var rootPaths = parent.$("#rootPaths").val();
//加载的图片 //加载的图片
var print = $("#print").val(); var print = $("#print").val();
if(scanPages != '' && print == 1){ if (scanPages != '' && print == 1) {
selectPrintPic(patientId,rootPaths,scanPages,sources); selectPrintPic(patientId, rootPaths, scanPages, sources);
} }
} }
var iframe = document.getElementById("iframe1"); var iframe = document.getElementById("iframe1");
/** /**
* 加载打印预览所需图片 * 加载打印预览所需图片
*/ */
//定义打印预览加载图片进度 //定义打印预览加载图片进度
function selectPrintPic(patientId,rootPaths,scanPages,sources){ function selectPrintPic(patientId, rootPaths, scanPages, sources) {
$.ajax({ $.ajax({
type:'post', type: 'post',
url:path+"/commom/selectPrintPic", url: path + "/commom/selectPrintPic",
data:{ data: {
patientId:patientId, patientId: patientId,
rootPaths:rootPaths, rootPaths: rootPaths,
names:scanPages, names: scanPages,
sources:sources sources: sources
}, },
datType:'json', datType: 'json',
success:function(data){ success: function (data) {
if(data.code == 0){ if (data.code == 0) {
var resultList = data.data; var resultList = data.data;
if(null != resultList){ if (null != resultList) {
var img = ''; var img = '';
for (var i = 0; i < resultList.length; i++) { for (var i = 0; i < resultList.length; i++) {
img += "<img src='"+resultList[i]+"' width='850' height='1190'>"; img += "<img src='" + resultList[i] + "' width='850' height='1190'>";
} }
var interval = setInterval(function () { var interval = setInterval(function () {
if($("#iframeLoad").val() == 1) { if ($("#iframeLoad").val() == 1) {
iframe.contentDocument.getElementById("printContainer1").innerHTML = img; iframe.contentDocument.getElementById("printContainer1").innerHTML = img;
$("#printPicLoaded").val(1); $("#printPicLoaded").val(1);
iframe.contentDocument.getElementById("printLoading").style.display = 'none'; iframe.contentDocument.getElementById("printLoading").style.display = 'none';
iframe.contentDocument.getElementById("print").style.display = 'block'; iframe.contentDocument.getElementById("print").style.display = 'block';
clearInterval(interval); clearInterval(interval);
} }
},200); }, 200);
} }
}else{ } else {
toastr.error(data.msg); toastr.error(data.msg);
} }
} }
}) })
//查询进度定时器 //查询进度定时器
var interval1 = setInterval(function () { var interval1 = setInterval(function () {
$.ajax({ $.ajax({
type:'get', type: 'get',
url:path+"/commom/getPrintPicLoading", url: path + "/commom/getPrintPicLoading",
data:{patientId:$("#patientId").val()}, data: {patientId: $("#patientId").val()},
dataType:'json', dataType: 'json',
success:function(data){ success: function (data) {
if(data.code == 0){ if (data.code == 0) {
var value = data.data; var value = data.data;
$("#loading").val(value+"%"); $("#loading").val(value + "%");
if(value == 100){ if (value == 100) {
//杀死进度定时器 //杀死进度定时器
clearInterval(interval1); clearInterval(interval1);
} }
}else{ } else {
toastr.error(data.msg); toastr.error(data.msg);
} }
} }
}) })
},100); }, 100);
} }
if(iframe.attachEvent){
iframe.attachEvent("onreadystatechange", function() { if (iframe.attachEvent) {
//此事件在内容没有被载入时候也会被触发,所以我们要判断状态 iframe.attachEvent("onreadystatechange", function () {
//有时候会比较怪异 readyState状态会跳过 complete 所以我们loaded状态也要判断 //此事件在内容没有被载入时候也会被触发,所以我们要判断状态
if (iframe.readyState === "complete" || iframe.readyState == "loaded") { //有时候会比较怪异 readyState状态会跳过 complete 所以我们loaded状态也要判断
//代码能执行到这里说明已经载入成功完毕了 if (iframe.readyState === "complete" || iframe.readyState == "loaded") {
//要清除掉事件 //代码能执行到这里说明已经载入成功完毕了
iframe.detachEvent("onreadystatechange", arguments.callee); //要清除掉事件
//这里是回调函数 iframe.detachEvent("onreadystatechange", arguments.callee);
} //这里是回调函数
}); }
}else{ });
iframe.addEventListener("load", function() { } else {
$("#iframeLoad").val(1); iframe.addEventListener("load", function () {
//代码能执行到这里说明已经载入成功完毕了 $("#iframeLoad").val(1);
this.removeEventListener("load", arguments.call, false); //代码能执行到这里说明已经载入成功完毕了
}, false); this.removeEventListener("load", arguments.call, false);
}, false);
} }
//下载pdf按钮功能 //下载pdf按钮功能
function onloadJpgForPdf(){ function onloadJpgForPdf() {
var typeId = $("#typeId").val(); var typeId = $("#typeId").val();
if(typeId == undefined){ if (typeId == undefined) {
typeId = ''; typeId = '';
} }
Common.confirm({ Common.confirm({
title: "提示", title: "提示",
message: "确认将左侧树选中的图片下载pdf?", message: "确认将左侧树选中的图片下载pdf?",
operate: function (reselt) { operate: function (reselt) {
if (reselt) { if (reselt) {
var patientId = "'" + $("#patientId").val() + "'"; var patientId = "'" + $("#patientId").val() + "'";
var assortIds = $("#assortIds").val(); var assortIds = $("#assortIds").val();
var flag = parent.$("#flag").val(); var flag = parent.$("#flag").val();
post(path + '/template/downloadPdfBlood', { post(path + '/template/downloadPdfBlood', {
"patientIds": patientId, "patientIds": patientId,
"assortIds": assortIds, "assortIds": assortIds,
"typeId": typeId, "typeId": typeId,
"flag": flag "flag": flag
}); });
} }
} }
}) })
} }
//重新归页确定按钮功能 //重新归页确定按钮功能
function sure(){ function sure() {
Common.confirm({ Common.confirm({
title: "提示", title: "提示",
message: "确认将左侧树选中的图片是否重新归页?", message: "确认将左侧树选中的图片是否重新归页?",
operate: function (reselt) { operate: function (reselt) {
if (reselt) { if (reselt) {
//pdf页数 //pdf页数
var newAssortId = $("#newAssortId").val(); var newAssortId = $("#newAssortId").val();
if (newAssortId != '') { if (newAssortId != '') {
var patientId = $("#patientId").val(); var patientId = $("#patientId").val();
var assortIds = $("#assortIds").val(); var assortIds = $("#assortIds").val();
if(assortIds != ''){ if (assortIds != '') {
$.ajax({ $.ajax({
type: 'post', type: 'post',
url: path + '/commom/updateScanAssortByBlood', url: path + '/commom/updateScanAssortByBlood',
data: {patientId: patientId, name:parent.$("#name").val(),assortIds: assortIds,newAssortId: newAssortId}, data: {
dataType: 'json', patientId: patientId,
success: function (data) { name: parent.$("#name").val(),
if (data.code == 0) { assortIds: assortIds,
toastr.success("重新归页成功!"); newAssortId: newAssortId
} },
//重新加载 dataType: 'json',
menu.loadMenuTree(); success: function (data) {
} if (data.code == 0) {
}) toastr.success("重新归页成功!");
}else{ }
toastr.warning("左侧树至少选中一张图片!") //重新加载
} menu.loadMenuTree();
} else { }
toastr.warning("要重新分页,需选中其中下拉框其中一项!") })
} } else {
} toastr.warning("左侧树至少选中一张图片!")
} }
}) } else {
toastr.warning("要重新分页,需选中其中下拉框其中一项!")
}
}
}
})
} }
//删除图片 //删除图片
function delPic(){ function delPic() {
Common.confirm({ Common.confirm({
title: "提示", title: "提示",
message: "确认将左侧树选中的图片删除?", message: "确认将左侧树选中的图片删除?",
operate: function (reselt) { operate: function (reselt) {
if (reselt) { if (reselt) {
var patientId = $("#patientId").val(); var patientId = $("#patientId").val();
var assortIds = $("#assortIds").val(); var assortIds = $("#assortIds").val();
if(assortIds != '') { if (assortIds != '') {
$.ajax({ $.ajax({
type: 'post', type: 'post',
url: path + '/commom/delScanAssortByBlood', url: path + '/commom/delScanAssortByBlood',
data: {patientId: patientId, name:parent.$("#name").val(),assortIds: assortIds}, data: {patientId: patientId, name: parent.$("#name").val(), assortIds: assortIds},
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {
if (data.code == 0) { if (data.code == 0) {
toastr.success("删除成功!"); toastr.success("删除成功!");
} }
//重新加载 //重新加载
menu.loadMenuTree(); menu.loadMenuTree();
} }
}) })
} }
} }
} }
}) })
} }
//记录打印记录 //记录打印记录
function printInfoBlood(){ function printInfoBlood() {
var patientId = "'"+$("#patientId").val()+"'"; var patientId = "'" + $("#patientId").val() + "'";
var typeId = $("#typeId").val(); var typeId = $("#typeId").val();
if(typeId == undefined){ if (typeId == undefined) {
typeId = ''; typeId = '';
} }
var assortIds = ''; var assortIds = '';
//判断树点击选中赋值的框是否有值有则属于取点击选中的值否则去加载pdf的值 //判断树点击选中赋值的框是否有值有则属于取点击选中的值否则去加载pdf的值
var assortIdByClick = $("#assortIdByClick").val(); var assortIdByClick = $("#assortIdByClick").val();
if(assortIdByClick != ''){ if (assortIdByClick != '') {
assortIds = $("#assortIdByClick").val(); assortIds = $("#assortIdByClick").val();
}else{ } else {
assortIds = $("#assortIds").val(); assortIds = $("#assortIds").val();
} }
var flag = $("#flag").val(); var flag = $("#flag").val();
$.ajax({ $.ajax({
type:'post', type: 'post',
url:path+'/template/printInfoBlood', url: path + '/template/printInfoBlood',
data:{"patientIds":patientId,"assortIds":assortIds,"typeId":typeId,"flag":flag}, data: {"patientIds": patientId, "assortIds": assortIds, "typeId": typeId, "flag": flag},
dataType:'json', dataType: 'json',
success:function(data){ success: function (data) {
if(data.code == 0){ if (data.code == 0) {
toastr.success("打印成功") toastr.success("打印成功")
}else{ } else {
toastr.success(data.msg) toastr.success(data.msg)
} }
} }
}) })
}
/**
* 病案查询
*/
function search() {
var inpatientNo = $("#inpatientNo").val();
var admissTimes = $("#admissTimes").val();
var name = $("#name").val();
if (inpatientNo == "" && admissTimes == "" && name == "") {
toastr.warning("请输入搜索信息在进行查询");
} else {
var sql = "select patient_id,inpatient_no,name,admiss_times,admiss_date,dis_date,dis_dept from commomtable where 1 = 1";
if (null != inpatientNo && "" != inpatientNo) {
sql += " and inpatient_no like '%" + inpatientNo + "%'";
}
if (null != admissTimes && "" != admissTimes) {
sql += " and admiss_times like '%" + admissTimes + "%'";
}
if (null != name && "" != name) {4
sql += " and name like '%" + name + "%'";
}
$("#mytab").bootstrapTable('destroy');
//生成用户数据
$('#mytab').bootstrapTable({
method: 'post',
contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
toolbar: '#toolbar', //工具按钮用哪个容器
striped: true, //是否显示行间隔色
cache: false, //是否使用缓存默认为true所以一般情况下需要设置一下这个属性*
pagination: true, //是否显示分页(*
sidePagination: "server", //分页方式client客户端分页server服务端分页*
paginationPreText: '上一页',
paginationNextText: '下一页',
paginationFirstText: '<',
paginationLastText: '>',
detailView: flag,
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 5, //每页的记录行数(*
pageList: [5, 10, 20, 50, 100],//可供选择的每页的行数(*
height: 400,//高度调整 //行高如果没有设置height属性表格自动根据记录条数觉得表格高度
buttonsAlign: "left",//按钮对齐方式
columns: [
{
title: '病案号',
field: 'inpatientNo',
},
{
title: '姓名',
field: 'name',
},
{
title: '住院次数',
field: 'admissTimes',
},
{
title: '入院日期',
field: 'admissDate',
},
{
title: '出院时间',
field: 'disDate',
},
{
title: '出院科室',
field: 'disDept',
},
{
title: '操作',
formatter: function (value, row, index) {
var patientId = row.patientId;
var inpatientNo = row.inpatientNo.replace(/\s+/g, "");
var name = row.name;
var admissTimes = row.admissTimes;
var info = "'" + patientId+ "," + inpatientNo + "," + name + "," + admissTimes + "'";
var editanddrop = '<button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#myModal2" onclick="showInfo(' + info + ')">选择分段</button>';
return editanddrop;
}
}
],
locale: 'zh-CN',//中文支持,
url: path + '/template/cutomSearchTable',//排序方式
queryParams: function (params) {
return {
sql: sql,
limit: params.limit, // 每页显示数量
offset: params.offset, // SQL语句起始索引
page: (params.offset / params.limit) + 1 //当前页码
}
},
responseHandler: function (res) {
//在ajax获取到数据渲染表格之前修改数据源
var nres = [];
nres.push({total: res.total, rows: res.list});
return nres[0];
},
onLoadSuccess: function (res) {
$(".clearfix").height(0);
$(".page-list").show();
$(".fixed-table-body").css("overflow", "auto");
//赋值总数
$("#rows").val(res.total);
//全选
$('.fixed-table-container').on('click', 'input[name="btSelectAll"]', function () {
if ($(this).is(':checked')) {
$('input[name="btSelectItem"]').prop('checked', true);
} else {
$('input[name="btSelectItem"]').prop('checked', false);
}
})
//逐个选择
$('.fixed-table-container').on('click', 'input[name="btSelectItem"]', function () {
var inputs = $(this).parents('.fixed-table-body-columns').find('input[name="btSelectItem"]')
var num = 0;
inputs.each(function () {
if ($(this).is(':checked')) {
num++;
}
});
if (num == inputs.length) {
$('input[name="btSelectAll"]').prop('checked', true);
} else {
$('input[name="btSelectAll"]').prop('checked', false);
}
var index = $(this).parents('tr').index();
$('#Table1').find('input[name="btSelectItem"]').eq(index).click();
});
}
})
}
}
/**
* 显示需要移动的病案信息
* @param patientId
*/
function showInfo(info) {
var infoList = info.split(",");
$("#patientIdInfo").val(infoList[0]);
$("#inpatientNoInfo").val(infoList[1]);
$("#nameInfo").val(infoList[2]);
$("#admissTimesInfo").val(infoList[3]);
}
/**
* 修改PDF存放地址
*/
function movePdf() {
//需要移动PDF的病案id
var oldPatientId = $("#patientId").val();
//目标病案id
var newPatientId = $("#patientIdInfo").val();
//选中图片名称
var assortIds = $("#assortIds").val();
//选中分段
var newAssortId = $("#moveAssortId").val();
if (oldPatientId == '' || newPatientId == '' || assortIds == '' || newAssortId == '') {
toastr.warning("程序出现错误,请联系管理员!");
} else {
$.ajax({
type: 'post',
url: path + '/template/movePdfBlood',
data: {
oldPatientId: oldPatientId,
newPatientId: newPatientId,
assortIds: assortIds,
newAssortId: newAssortId,
flag: parent.$("#flag").val()
},
dataType: 'json',
success: function (data) {
if (data.code == 0) {
window.location.reload();
toastr.success("转移成功!");
}
}
})
}
} }

@ -0,0 +1,525 @@
//树操作
var menu = {
setting: {
view: {
fontCss: {"font-family": "微软雅黑", "color": "blue"}
},
data: {
key: {
name: "newName"
},
simpleData: {
chkStyle: "checkbox",
enable: true,
idKey: "id",
pIdKey: "parentId",
},
},
check: {
enable: true
},
callback: { //回调函数
onCheck: onCheck,
onClick: onClick
}
},
loadMenuTree: function () {
$.ajax({
type: "post",
url: path + "/commom/getBloodRecordTree",
data: {patientId: $("#patientId").val(), typeId: $("#typeId").val()},
dataType: "json",
success: function (data) {
$("#assortIds").val("");
if (data != null) {
//图片相对路径集合
var scanPages = '';
//图片来源集合
var sources = '';
for (var i = 0; i < data.length; i++) {
if (data[i].parentId != null && data[i].parentId != 1 && data[i].checked == 'true') {
scanPages += data[i].assortName + ",";
sources += data[i].source + ",";
}
}
//去掉后面逗号
if (scanPages != '') {
scanPages = scanPages.substring(0, scanPages.length - 1);
$("#assortIds").val(scanPages);
sources = sources.substring(0, sources.length - 1);
$("#sources").val(sources);
}
$.fn.zTree.init($("#ztree"), menu.setting, data);
zTree = $.fn.zTree.getZTreeObj("ztree");
var nodes = zTree.getNodes();
for (var i = 0; i < nodes.length; i++) { //设置节点展开
zTree.expandNode(nodes[i], true, false, true);
}
//加载pdf
onloadPdf(scanPages, sources);
}
}
})
}
};
//加载树
$().ready(function (data) {
menu.loadMenuTree();
});
//树选中事件
function onCheck(e, treeId, treeNode) {
var treeObj = $.fn.zTree.getZTreeObj("ztree");
nodes = treeObj.getCheckedNodes(true);
var assortIds = '';
var sources = '';
for (var i = 0; i < nodes.length; i++) {
if (nodes[i].level == 2) {
if (i != (nodes.length - 1)) {
assortIds += nodes[i].assortName + ",";
sources += +nodes[i].source + ",";
} else {
assortIds += nodes[i].assortName + "";
sources += nodes[i].source;
}
}
}
$("#assortIds").val(assortIds);
$("#sources").val(sources);
};
//树点击事件
function onClick(e, treeId, treeNode) {
var treeLevel = treeNode.level;
//选中图片节点时
if (treeLevel == 2) {
//图片集合
var scanPages = treeNode.assortName;
//来源集合
var sources = treeNode.source;
$("#assortIdByClick").val(scanPages);
$("#sourceByClick").val(sources);
onloadPdf(scanPages, sources);
}
};
//打印分类变更事件
$("#typeId").change(function () {
menu.loadMenuTree();
})
//树复选框选中后加载pdf按钮
function onloadPdfMethod() {
var scanPages = $("#assortIds").val();
//来源集合
var sources = $("#sources").val();
$("#assortIdByClick").val("");
$("#sourceByClick").val("");
onloadPdf(scanPages, sources);
}
//加载pdf按钮功能
function onloadPdf(scanPages, sources) {
$("#iframeLoad").val("");
$("#printPicLoaded").val("");
var patientId = $("#patientId").val();
//根目录字段识别名称
var flag = parent.$("#flag").val();
var str = path + "/commom/showRecordContentSouth?patientId=" + patientId + "&scanPages=" + scanPages + "&sources=" + sources + "&flag=" + flag;
$("#iframe1").attr("src", path + "/static/pdfjs/web/viewer1.html?file=" + encodeURIComponent(str));
var rootPaths = parent.$("#rootPaths").val();
//加载的图片
var print = $("#print").val();
if (scanPages != '' && print == 1) {
selectPrintPic(patientId, rootPaths, scanPages, sources);
}
}
var iframe = document.getElementById("iframe1");
/**
* 加载打印预览所需图片
*/
//定义打印预览加载图片进度
function selectPrintPic(patientId, rootPaths, scanPages, sources) {
$.ajax({
type: 'post',
url: path + "/commom/selectPrintPic",
data: {
patientId: patientId,
rootPaths: rootPaths,
names: scanPages,
sources: sources
},
datType: 'json',
success: function (data) {
if (data.code == 0) {
var resultList = data.data;
if (null != resultList) {
var img = '';
for (var i = 0; i < resultList.length; i++) {
img += "<img src='" + resultList[i] + "' width='850' height='1190'>";
}
var interval = setInterval(function () {
if ($("#iframeLoad").val() == 1) {
iframe.contentDocument.getElementById("printContainer1").innerHTML = img;
$("#printPicLoaded").val(1);
iframe.contentDocument.getElementById("printLoading").style.display = 'none';
iframe.contentDocument.getElementById("print").style.display = 'block';
clearInterval(interval);
}
}, 200);
}
} else {
toastr.error(data.msg);
}
}
})
//查询进度定时器
var interval1 = setInterval(function () {
$.ajax({
type: 'get',
url: path + "/commom/getPrintPicLoading",
data: {patientId: $("#patientId").val()},
dataType: 'json',
success: function (data) {
if (data.code == 0) {
var value = data.data;
$("#loading").val(value + "%");
if (value == 100) {
//杀死进度定时器
clearInterval(interval1);
}
} else {
toastr.error(data.msg);
}
}
})
}, 100);
}
if (iframe.attachEvent) {
iframe.attachEvent("onreadystatechange", function () {
//此事件在内容没有被载入时候也会被触发,所以我们要判断状态
//有时候会比较怪异 readyState状态会跳过 complete 所以我们loaded状态也要判断
if (iframe.readyState === "complete" || iframe.readyState == "loaded") {
//代码能执行到这里说明已经载入成功完毕了
//要清除掉事件
iframe.detachEvent("onreadystatechange", arguments.callee);
//这里是回调函数
}
});
} else {
iframe.addEventListener("load", function () {
$("#iframeLoad").val(1);
//代码能执行到这里说明已经载入成功完毕了
this.removeEventListener("load", arguments.call, false);
}, false);
}
//下载pdf按钮功能
function onloadJpgForPdf() {
var typeId = $("#typeId").val();
if (typeId == undefined) {
typeId = '';
}
Common.confirm({
title: "提示",
message: "确认将左侧树选中的图片下载pdf?",
operate: function (reselt) {
if (reselt) {
var patientId = "'" + $("#patientId").val() + "'";
var assortIds = $("#assortIds").val();
var flag = parent.$("#flag").val();
post(path + '/template/downloadPdfBlood', {
"patientIds": patientId,
"assortIds": assortIds,
"typeId": typeId,
"flag": flag
});
}
}
})
}
//重新归页确定按钮功能
function sure() {
Common.confirm({
title: "提示",
message: "确认将左侧树选中的图片是否重新归页?",
operate: function (reselt) {
if (reselt) {
//pdf页数
var newAssortId = $("#newAssortId").val();
if (newAssortId != '') {
var patientId = $("#patientId").val();
var assortIds = $("#assortIds").val();
if (assortIds != '') {
$.ajax({
type: 'post',
url: path + '/commom/updateScanAssortByBlood',
data: {
patientId: patientId,
name: parent.$("#name").val(),
assortIds: assortIds,
newAssortId: newAssortId
},
dataType: 'json',
success: function (data) {
if (data.code == 0) {
toastr.success("重新归页成功!");
}
//重新加载
menu.loadMenuTree();
}
})
} else {
toastr.warning("左侧树至少选中一张图片!")
}
} else {
toastr.warning("要重新分页,需选中其中下拉框其中一项!")
}
}
}
})
}
//删除图片
function delPic() {
Common.confirm({
title: "提示",
message: "确认将左侧树选中的图片删除?",
operate: function (reselt) {
if (reselt) {
var patientId = $("#patientId").val();
var assortIds = $("#assortIds").val();
if (assortIds != '') {
$.ajax({
type: 'post',
url: path + '/commom/delScanAssortByBlood',
data: {patientId: patientId, name: parent.$("#name").val(), assortIds: assortIds},
dataType: 'json',
success: function (data) {
if (data.code == 0) {
toastr.success("删除成功!");
}
//重新加载
menu.loadMenuTree();
}
})
}
}
}
})
}
//记录打印记录
function printInfoBlood() {
var patientId = "'" + $("#patientId").val() + "'";
var typeId = $("#typeId").val();
if (typeId == undefined) {
typeId = '';
}
var assortIds = '';
//判断树点击选中赋值的框是否有值有则属于取点击选中的值否则去加载pdf的值
var assortIdByClick = $("#assortIdByClick").val();
if (assortIdByClick != '') {
assortIds = $("#assortIdByClick").val();
} else {
assortIds = $("#assortIds").val();
}
var flag = $("#flag").val();
$.ajax({
type: 'post',
url: path + '/template/printInfoBlood',
data: {"patientIds": patientId, "assortIds": assortIds, "typeId": typeId, "flag": flag},
dataType: 'json',
success: function (data) {
if (data.code == 0) {
toastr.success("打印成功")
} else {
toastr.success(data.msg)
}
}
})
}
/**
* 病案查询
*/
function search() {
var inpatientNo = $("#inpatientNo").val();
var admissTimes = $("#admissTimes").val();
var name = $("#name").val();
if (inpatientNo == "" && admissTimes == "" && name == "") {
toastr.warning("请输入搜索信息在进行查询");
} else {
var sql = "select patient_id,inpatient_no,name,admiss_times,admiss_date,dis_date,dis_dept from commomtable where 1 = 1";
if (null != inpatientNo && "" != inpatientNo) {
sql += " and inpatient_no like '%" + inpatientNo + "%'";
}
if (null != admissTimes && "" != admissTimes) {
sql += " and admiss_times like '%" + admissTimes + "%'";
}
if (null != name && "" != name) {
4
sql += " and name like '%" + name + "%'";
}
$("#mytab").bootstrapTable('destroy');
//生成用户数据
$('#mytab').bootstrapTable({
method: 'post',
contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
toolbar: '#toolbar', //工具按钮用哪个容器
striped: true, //是否显示行间隔色
cache: false, //是否使用缓存默认为true所以一般情况下需要设置一下这个属性*
pagination: true, //是否显示分页(*
sidePagination: "server", //分页方式client客户端分页server服务端分页*
paginationPreText: '上一页',
paginationNextText: '下一页',
paginationFirstText: '<',
paginationLastText: '>',
detailView: flag,
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 5, //每页的记录行数(*
pageList: [5, 10, 20, 50, 100],//可供选择的每页的行数(*
height: 400,//高度调整 //行高如果没有设置height属性表格自动根据记录条数觉得表格高度
buttonsAlign: "left",//按钮对齐方式
columns: [
{
title: '病案号',
field: 'inpatientNo',
},
{
title: '姓名',
field: 'name',
},
{
title: '住院次数',
field: 'admissTimes',
},
{
title: '入院日期',
field: 'admissDate',
},
{
title: '出院时间',
field: 'disDate',
},
{
title: '出院科室',
field: 'disDept',
},
{
title: '操作',
formatter: function (value, row, index) {
var patientId = row.patientId;
var inpatientNo = row.inpatientNo.replace(/\s+/g, "");
var name = row.name;
var admissTimes = row.admissTimes;
var info = "'" + patientId + "," + inpatientNo + "," + name + "," + admissTimes + "'";
var editanddrop = '<button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#myModal2" onclick="showInfo(' + info + ')">选择分段</button>';
return editanddrop;
}
}
],
locale: 'zh-CN',//中文支持,
url: path + '/template/cutomSearchTable',//排序方式
queryParams: function (params) {
return {
sql: sql,
limit: params.limit, // 每页显示数量
offset: params.offset, // SQL语句起始索引
page: (params.offset / params.limit) + 1 //当前页码
}
},
responseHandler: function (res) {
//在ajax获取到数据渲染表格之前修改数据源
var nres = [];
nres.push({total: res.total, rows: res.list});
return nres[0];
},
onLoadSuccess: function (res) {
$(".clearfix").height(0);
$(".page-list").show();
$(".fixed-table-body").css("overflow", "auto");
//赋值总数
$("#rows").val(res.total);
//全选
$('.fixed-table-container').on('click', 'input[name="btSelectAll"]', function () {
if ($(this).is(':checked')) {
$('input[name="btSelectItem"]').prop('checked', true);
} else {
$('input[name="btSelectItem"]').prop('checked', false);
}
})
//逐个选择
$('.fixed-table-container').on('click', 'input[name="btSelectItem"]', function () {
var inputs = $(this).parents('.fixed-table-body-columns').find('input[name="btSelectItem"]')
var num = 0;
inputs.each(function () {
if ($(this).is(':checked')) {
num++;
}
});
if (num == inputs.length) {
$('input[name="btSelectAll"]').prop('checked', true);
} else {
$('input[name="btSelectAll"]').prop('checked', false);
}
var index = $(this).parents('tr').index();
$('#Table1').find('input[name="btSelectItem"]').eq(index).click();
});
}
})
}
}
/**
* 显示需要移动的病案信息
* @param patientId
*/
function showInfo(info) {
var infoList = info.split(",");
$("#patientIdInfo").val(infoList[0]);
$("#inpatientNoInfo").val(infoList[1]);
$("#nameInfo").val(infoList[2]);
$("#admissTimesInfo").val(infoList[3]);
}
/**
* 修改PDF存放地址
*/
function movePdf() {
//需要移动PDF的病案id
var oldPatientId = $("#patientId").val();
//目标病案id
var newPatientId = $("#patientIdInfo").val();
//选中图片名称
var assortIds = $("#assortIds").val();
//选中分段
var newAssortId = $("#moveAssortId").val();
if (oldPatientId == '' || newPatientId == '' || assortIds == '' || newAssortId == '') {
toastr.warning("程序出现错误,请联系管理员!");
} else {
$.ajax({
type: 'post',
url: path + '/template/movePdfBlood',
data: {
oldPatientId: oldPatientId,
newPatientId: newPatientId,
assortIds: assortIds,
newAssortId: newAssortId,
flag: parent.$("#flag").val()
},
dataType: 'json',
success: function (data) {
if (data.code == 0) {
window.location.reload();
toastr.success("转移成功!");
}
}
})
}
}

@ -92,11 +92,11 @@ function getSql() {
val = 't_dictionary_4.NAME AS anaesthesia_type'; val = 't_dictionary_4.NAME AS anaesthesia_type';
dictionaryConvertStr += " LEFT JOIN dbo.emr_dictionary AS t_dictionary_4 ON t_operate.anaesthesia_type = t_dictionary_4.CODE AND t_dictionary_4.parent_id = 'anaesthesia'"; dictionaryConvertStr += " LEFT JOIN dbo.emr_dictionary AS t_dictionary_4 ON t_operate.anaesthesia_type = t_dictionary_4.CODE AND t_dictionary_4.parent_id = 'anaesthesia'";
} }
if (val == 't_operate.ChosSurg') { /*if (val == 't_operate.ChosSurg') {
//是否择期手术 //是否择期手术
val = 't_dictionary_5.NAME AS chossurg'; val = 't_dictionary_5.NAME AS chossurg';
dictionaryConvertStr += " LEFT JOIN dbo.emr_dictionary AS t_dictionary_5 ON t_operate.ChosSurg = t_dictionary_5.CODE AND t_dictionary_5.parent_id = 'whether'"; dictionaryConvertStr += " LEFT JOIN dbo.emr_dictionary AS t_dictionary_5 ON t_operate.ChosSurg = t_dictionary_5.CODE AND t_dictionary_5.parent_id = 'whether'";
} }*/
if (val == 't_baby.babySex') { if (val == 't_baby.babySex') {
//婴儿性别 //婴儿性别
val = 't_dictionary_6.NAME AS babySex'; val = 't_dictionary_6.NAME AS babySex';
@ -267,9 +267,9 @@ function getSql() {
if (fields[i] == 'RH') { if (fields[i] == 'RH') {
fields[i] = 'rh'; fields[i] = 'rh';
} }
if (fields[i] == 'ChosSurg') { /*if (fields[i] == 'ChosSurg') {
fields[i] = 'chossurg'; fields[i] = 'chossurg';
} }*/
fieldCns += fields[i] + ","; fieldCns += fields[i] + ",";
} }
} }
@ -424,7 +424,7 @@ $('.check').on('click', function () {
success:function(data){ success:function(data){
if(data!= null){ if(data!= null){
for (var i = 0;i < data.length;i++){ for (var i = 0;i < data.length;i++){
if(column == 'babySex' || column == 'childbirth_mothed' || column == 'diag_type' || column == 'breathing' || column == 'dis_thing' || column == 'ChosSurg' || column == 'operate_class' || column == 'anaesthesia_type'){ if(column == 'babySex' || column == 'childbirth_mothed' || column == 'diag_type' || column == 'breathing' || column == 'dis_thing' || column == 'operate_class' || column == 'anaesthesia_type'){
selectOptions += '<option value='+data[i].code+'>'+data[i].name+'</option>'; selectOptions += '<option value='+data[i].code+'>'+data[i].name+'</option>';
}else{ }else{
selectOptions += '<option value='+data[i].name+'>'+data[i].name+'</option>'; selectOptions += '<option value='+data[i].name+'>'+data[i].name+'</option>';

@ -1,66 +1,66 @@
/***********************************************表格操作*****************************************************************/ /***********************************************表格操作*****************************************************************/
var userName = "'" + $("#userName").val() + "'"; var userName = "'" + $("#userName").val() + "'";
var initSql = "select commomtable.patient_id,CASE WHEN emr_apply_approve.id is null THEN 0 ELSE 1 END isShowDetail,CASE\n" + var initSql = "select commomtable.patient_id,CASE WHEN emr_apply_approve.id is null THEN 0 ELSE 1 END isShowDetail,CASE\n" +
"WHEN emr_apply_approve1.id IS NULL THEN\n" + "WHEN emr_apply_approve1.id IS NULL THEN\n" +
"\t0\n" + "\t0\n" +
"ELSE\n" + "ELSE\n" +
"\t1\n" + "\t1\n" +
"END isDownload,CASE WHEN emr_lock.id is null THEN 0 ELSE 1 END lockStatus,commomtable.inpatient_no,commomtable.admiss_id,commomtable.admiss_times,commomtable.name,commomtable.sex,commomtable.age,commomtable.age_month,commomtable.home_addr,commomtable.admiss_date,commomtable.dis_date,commomtable.dis_dept,commomtable.main_diag_code,commomtable.main_diag_name,commomtable.main_dis_thing,commomtable.admiss_days,commomtable.attending,commomtable.other_diag_name,commomtable.pathology_name,commomtable.poisoning_name,commomtable.is_oper from commomtable left join emr_apply_approve on commomtable.patient_id = emr_apply_approve.patient_id and emr_apply_approve.approve_state = 1 and emr_apply_approve.effe_time > GETDATE()-1 and emr_apply_approve.applyer = " +userName+ " and emr_apply_approve.apply_type != 3 left join emr_apply_approve emr_apply_approve1 on commomtable.patient_id = emr_apply_approve1.patient_id and emr_apply_approve1.approve_state = 1 and emr_apply_approve1.effe_time > GETDATE()-1 and emr_apply_approve1.applyer = " +userName+ " and emr_apply_approve1.apply_type = 3 left join emr_lock on commomtable.patient_id = emr_lock.patient_id and emr_lock.lock_state = 1 "; "END isDownload,CASE WHEN emr_lock.id is null THEN 0 ELSE 1 END lockStatus,commomtable.inpatient_no,commomtable.admiss_id,commomtable.admiss_times,commomtable.name,commomtable.sex,commomtable.age,commomtable.age_month,commomtable.home_addr,commomtable.admiss_date,commomtable.dis_date,commomtable.dis_dept,commomtable.main_diag_code,commomtable.main_diag_name,commomtable.main_dis_thing,commomtable.admiss_days,commomtable.attending,commomtable.other_diag_name,commomtable.pathology_name,commomtable.poisoning_name,commomtable.is_oper from commomtable left join emr_apply_approve on commomtable.patient_id = emr_apply_approve.patient_id and emr_apply_approve.approve_state = 1 and emr_apply_approve.effe_time > GETDATE()-1 and emr_apply_approve.applyer = " +userName+ " and emr_apply_approve.apply_type != 3 left join emr_apply_approve emr_apply_approve1 on commomtable.patient_id = emr_apply_approve1.patient_id and emr_apply_approve1.approve_state = 1 and emr_apply_approve1.effe_time > GETDATE()-1 and emr_apply_approve1.applyer = " +userName+ " and emr_apply_approve1.apply_type = 3 left join emr_lock on commomtable.patient_id = emr_lock.patient_id and emr_lock.lock_state = 1 ";
//定义查看详情的请求地址url //定义查看详情的请求地址url
function returnShowDetailUrl(patientId){ function returnShowDetailUrl(patientId){
return path + '/commom/showRecord174?patientId=' + patientId; return path + '/commom/showRecord174?patientId=' + patientId;
} }
//TODO 添加需要格式化日期格式的字段 //TODO 添加需要格式化日期格式的字段
var dateFields = 'disDate,admissDate,birthday,affirmDate'; var dateFields = 'disDate,admissDate,birthday,affirmDate';
var pageNumber; var pageNumber;
$(function(){ $(function(){
//根据窗口调整表格高度 //根据窗口调整表格高度
/*$(window).resize(function() { /*$(window).resize(function() {
$('#mytab').bootstrapTable('resetView', { $('#mytab').bootstrapTable('resetView', {
height: tableHeight() height: tableHeight()
}) })
})*/ })*/
//加载通过审批且未过期的patientId集合 //加载通过审批且未过期的patientId集合
getApproves(1); getApproves(1);
//加载通过审批且可下载的patientId集合 //加载通过审批且可下载的patientId集合
getApproves(3); getApproves(3);
//查询已锁定的集合 //查询已锁定的集合
getLocks(); getLocks();
//可预览信息 //可预览信息
showRecord = $("#showRecord").val(); showRecord = $("#showRecord").val();
//可下载信息 //可下载信息
downloadRecord = $("#downloadRecord").val(); downloadRecord = $("#downloadRecord").val();
}) })
//加载通过审批且未过期的patientId集合:type1借阅申请type:2下载申请 //加载通过审批且未过期的patientId集合:type1借阅申请type:2下载申请
function getApproves(type){ function getApproves(type){
$.ajax({ $.ajax({
type:'get', type:'get',
url:path+'/template/getApproves', url:path+'/template/getApproves',
data:{type:type}, data:{type:type},
dataType:'json', dataType:'json',
success:function (data) { success:function (data) {
if(null != data && data != ''){ if(null != data && data != ''){
if(type == 1){ if(type == 1){
$("#approves").val(data); $("#approves").val(data);
}else{ }else{
$("#loads").val(data); $("#loads").val(data);
} }
} }
} }
}) })
} }
//查询已锁定的集合 //查询已锁定的集合
function getLocks(){ function getLocks(){
$.ajax({ $.ajax({
type:'get', type:'get',
url:path+'/template/getLocks', url:path+'/template/getLocks',
dataType:'json', dataType:'json',
success:function (data) { success:function (data) {
if(null != data && data != ''){ if(null != data && data != ''){
$("#locks").val(data); $("#locks").val(data);
} }
} }
}) })
} }
function tableHeight() { function tableHeight() {
return $(window).height() - 50; return $(window).height() - 50;
@ -73,7 +73,7 @@ $(document).keydown(function (event) {
}); });
function freshTable(){ function freshTable(){
var powerMenus = $("#powerMenus").val(); var powerMenus = $("#powerMenus").val();
var powerMenus = powerMenus.substring(1,powerMenus.length-1); var powerMenus = $("#powerMenus").val().substring(1,$("#powerMenus").val().length-1);
var powerMenusArr = powerMenus.split(", "); var powerMenusArr = powerMenus.split(", ");
for (var i = 0; i < powerMenusArr.length; i++){ for (var i = 0; i < powerMenusArr.length; i++){
var strs = powerMenusArr[i]; var strs = powerMenusArr[i];
@ -112,10 +112,10 @@ function freshTable(){
if(fields[i] == 'RH'){ if(fields[i] == 'RH'){
map['field'] = 'rh'; map['field'] = 'rh';
fields[i] = 'rh'; fields[i] = 'rh';
}if(fields[i] == 'ChosSurg'){ }/*if(fields[i] == 'ChosSurg'){
map['field'] = 'chossurg'; map['field'] = 'chossurg';
fields[i] = 'chossurg'; fields[i] = 'chossurg';
}else{ }*/else{
map['field'] = fields[i]; map['field'] = fields[i];
} }
fieldCns += fields[i] + ","; fieldCns += fields[i] + ",";
@ -161,8 +161,8 @@ function freshTable(){
sidePagination: "server", //分页方式client客户端分页server服务端分页* sidePagination: "server", //分页方式client客户端分页server服务端分页*
paginationPreText : '上一页', paginationPreText : '上一页',
paginationNextText : '下一页', paginationNextText : '下一页',
paginationFirstText: '<', paginationFirstText: '<',
paginationLastText: '>', paginationLastText: '>',
detailView: flag, detailView: flag,
pageNumber: 1, //初始化加载第一页,默认第一页 pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 5, //每页的记录行数(* pageSize: 5, //每页的记录行数(*
@ -302,7 +302,12 @@ function btn(){
var url = path + "/printInfoList/pageUI174"; var url = path + "/printInfoList/pageUI174";
window.location.href = url; window.location.href = url;
} }
//判断是否有使用固定列获取选中多行数据
/**
* 判断是否有使用固定列获取选中多行数据
* @param tableId
* @returns {*}
*/
function getSelectedRow_st(tableId) { function getSelectedRow_st(tableId) {
//解決固定列导致选择复选框选不中的问题 //解決固定列导致选择复选框选不中的问题
//首先判断表格是否为固定列表格使用bootstrapTable('getOptions')获取表格的所有配置项fixedColumns字段判断是否为固定列 //首先判断表格是否为固定列表格使用bootstrapTable('getOptions')获取表格的所有配置项fixedColumns字段判断是否为固定列
@ -320,7 +325,10 @@ function getSelectedRow_st(tableId) {
return $("#"+tableId).bootstrapTable('getSelections'); return $("#"+tableId).bootstrapTable('getSelections');
} }
} }
//获取选中行
/**
* 获取选中行
*/
function getChecked(){ function getChecked(){
var idlist = getSelectedRow_st("mytab"); var idlist = getSelectedRow_st("mytab");
if(idlist.length > 0){ if(idlist.length > 0){
@ -341,7 +349,14 @@ function reLoadTable(){
$("#check").val(""); $("#check").val("");
} }
//列表行‘操作’按钮 /**
* 列表行操作按钮
* @param value
* @param row
* @param index
* @returns {string}
* @constructor
*/
function AddFunctionAlty(value, row, index) { function AddFunctionAlty(value, row, index) {
var patientId = "'" + row.patientId + "'"; var patientId = "'" + row.patientId + "'";
var updatePower = $("#powerMenu").val(); var updatePower = $("#powerMenu").val();
@ -358,8 +373,8 @@ function AddFunctionAlty(value, row, index) {
if(lockStatus != '' && lockStatus == 1 && unlockOper == 1){ if(lockStatus != '' && lockStatus == 1 && unlockOper == 1){
str += '<button type="button" class="btn btn-sm btn-success" onclick="unlock('+patientId+')">解锁</button>'; str += '<button type="button" class="btn btn-sm btn-success" onclick="unlock('+patientId+')">解锁</button>';
}else{ }else{
if (userId == 1 || updatePower == 'true'){ if (userId == 1 || updatePower == 'true'){
str += '<button type="button" class="btn btn-sm btn-info TableView btn-sm" data-toggle="modal" data-target="#myModal2" onclick="getUpdateCommomInfo('+patientId+')">修改</button>'; str += '<button type="button" class="btn btn-sm btn-info TableView btn-sm" data-toggle="modal" data-target="#myModal2" onclick="getUpdateCommomInfo('+patientId+')">修改</button>';
} }
if((null != isShowDetail && isShowDetail == 1) || showRecord == "1"){ if((null != isShowDetail && isShowDetail == 1) || showRecord == "1"){
str += '<a type="button" href="'+returnShowDetailUrl(row.patientId)+'" class="btn btn-danger TableView btn-sm" target="_blank">查看详情</a>'; str += '<a type="button" href="'+returnShowDetailUrl(row.patientId)+'" class="btn btn-danger TableView btn-sm" target="_blank">查看详情</a>';
@ -383,10 +398,7 @@ function AddFunctionAlty(value, row, index) {
return str; return str;
} }
/*//查看详情
function showDetail(patientId){
window.location.href=path+"/commom/showRecord?patientId="+patientId;
}*/
/***********************************************按钮功能*****************************************************************/ /***********************************************按钮功能*****************************************************************/
//清空功能 //清空功能
function clearForm(){ function clearForm(){
@ -399,24 +411,24 @@ function clearForm(){
* @param patientId * @param patientId
*/ */
function getUpdateCommomInfo(patientId) { function getUpdateCommomInfo(patientId) {
$.ajax({ $.ajax({
type:'get', type:'get',
url:path+'/commom/getCommomInfoById', url:path+'/commom/getCommomInfoById',
data:{patientId:patientId}, data:{patientId:patientId},
dataType:'json', dataType:'json',
success:function(data){ success:function(data){
console.log("data == " +data); console.log("data == " +data);
if(null != data){ if(null != data){
$("#patientId").val(data.patientId); $("#patientId").val(data.patientId);
$("#inpatientNo").val(data.inpatientNo); $("#inpatientNo").val(data.inpatientNo);
$("#updateName").val(data.name); $("#updateName").val(data.name);
$("#admissTimes").val(data.admissTimes); $("#admissTimes").val(data.admissTimes);
$("#disDate").val(data.disDate); $("#disDate").val(data.disDate);
loadDeptDefault(data.disDept); loadDeptDefault(data.disDept);
$("#main_diag_name").val(data.mainDiagName); $("#main_diag_name").val(data.mainDiagName);
} }
} }
}) })
} }
/** /**
@ -424,24 +436,27 @@ function getUpdateCommomInfo(patientId) {
* @param patientId * @param patientId
*/ */
function updateCommomInfo() { function updateCommomInfo() {
$.ajax({ $.ajax({
type:'post', type:'post',
url:path+'/commom/updateCommomInfo', url:path+'/commom/updateCommomInfo',
data:$("#form").serialize(), data:$("#form").serialize(),
dataType:'json', dataType:'json',
success:function(data){ success:function(data){
if(data!=null && data.code == 0){ if(data!=null && data.code == 0){
toastr.success("修改成功!"); toastr.success("修改成功!");
freshTable(); freshTable();
$('#myModal2').modal('hide'); $('#myModal2').modal('hide');
}else{ }else{
toastr.warning(data.msg); toastr.warning(data.msg);
} }
} }
}) })
} }
//批量下载功能 /**
* 批量下载功能
* @param typeId
*/
function downloadZip(typeId){ function downloadZip(typeId){
var patientIds = ""; var patientIds = "";
getChecked(); getChecked();
@ -503,7 +518,10 @@ function downloadZip(typeId){
} }
} }
//下载pdf功能 /**
* 下载pdf功能
* @param patientId
*/
function downloadPdf(patientId){ function downloadPdf(patientId){
patientId = "'"+patientId+"'"; patientId = "'"+patientId+"'";
//查询是否有图片 //查询是否有图片
@ -514,72 +532,15 @@ function downloadPdf(patientId){
success:function(data){ success:function(data){
if(data == 1){ if(data == 1){
post(path + '/template/downloadPdfBlood', {"patientIds": patientId, post(path + '/template/downloadPdfBlood', {"patientIds": patientId,
"flag":$("#flag").val()}); "flag":$("#flag").val()});
}else{ }else{
toastr.warning("找不到影像资料!"); toastr.warning("找不到影像资料!");
} }
} }
}) })
} }
//批量下载功能
/*function downloadZip(typeId){
var patientIds = "";
getChecked();
var checks = $("#checks").val();
if(checks != ''){
patientIds = powerPotient(checks, true,typeId);
if(patientIds != ''){
patientIds = patientIds.substring(0,patientIds.length-1);
post(path+'/template/downloadZip',{"patientIds":patientIds});
}else{
toastr.warning("必须申请通过!")
}
}else{
var sql = $("#sql").val();
if(sql != '') {
var rows = $("#rows").val();
if(rows != '' && rows <= 1000){
Common.confirm({
title: "提示",
message: "没有选中,您确定要按搜索栏条件下载?",
operate: function (reselt) {
if (reselt) {
getSql();
var sql = $("#sql").val();
if (sql != '') {
$.ajax({
type: 'post',
url: path + '/template/getPatientIdsBySql',
data: {sql: sql},
dataType: 'json',
success: function (data) {
if (data != null) {
patientIds = powerPotient(data, true,typeId);
if (patientIds != '') {
patientIds = patientIds.substring(0, patientIds.length - 1);
post(path+'/template/downloadZip',{"patientIds":patientIds});
}else {
toastr.warning("必须申请通过!")
}
} else {
toastr.warning("没有可下载的内容!")
}
}
})
}
} else {
toastr.warning("没有可下载的内容!")
}
}
})
}else{
toastr.warning("为了用户体验限制批量操作不超过1000条数据!");
}
}else{
toastr.warning("搜索条件不可为空!");
}
}
}*/
function post(url, params) { function post(url, params) {
// 创建form元素 // 创建form元素
var temp_form = document.createElement("form"); var temp_form = document.createElement("form");
@ -600,7 +561,10 @@ function post(url, params) {
temp_form .submit(); temp_form .submit();
} }
//定义空的inputValue方法 /**
* 定义空的inputValue方法
* @returns {boolean}
*/
function getInputValue(){ function getInputValue(){
//判断是否有搜索条件 //判断是否有搜索条件
//所有input //所有input
@ -630,7 +594,10 @@ function getInputValue(){
return isInputValue; return isInputValue;
} }
//加载申请借阅类型 /**
* 加载申请借阅类型
* @param type
*/
function loadApplyType(type){ function loadApplyType(type){
$.ajax({ $.ajax({
type:'get', type:'get',
@ -648,6 +615,9 @@ function loadApplyType(type){
if(type == 2 && data[i].code == 3){ if(type == 2 && data[i].code == 3){
html += '<option value="'+data[i].code+'">'+data[i].name+'</option>'; html += '<option value="'+data[i].code+'">'+data[i].name+'</option>';
} }
if(type == 4 && data[i].code == 4){
html += '<option value="'+data[i].code+'">'+data[i].name+'</option>';
}
} }
} }
$("#applyType").append(html); $("#applyType").append(html);
@ -656,7 +626,10 @@ function loadApplyType(type){
}) })
} }
//单个申请借阅 /**
* 单个申请借阅
* @param patientId
*/
function borrowing(patientId){ function borrowing(patientId){
pickTime("effeTime", null); pickTime("effeTime", null);
$("#typeId").val('approves'); $("#typeId").val('approves');
@ -683,9 +656,11 @@ function borrowing(patientId){
}) })
} }
//批量申请借阅 /**
* 批量申请借阅
*/
function borrowings(){ function borrowings(){
pickTime("effeTime", null); pickTime("effeTime", null);
$("#typeId").val('approves'); $("#typeId").val('approves');
//加载申请借阅类型 //加载申请借阅类型
loadApplyType(1); loadApplyType(1);
@ -745,8 +720,12 @@ function borrowings(){
} }
} }
//单个下载申请 /**
* 单个下载申请
* @param patientId
*/
function downBorrowing(patientId){ function downBorrowing(patientId){
pickTime("effeTime", null);
$("#typeId").val('loads'); $("#typeId").val('loads');
//加载申请借阅类型 //加载申请借阅类型
loadApplyType(2); loadApplyType(2);
@ -771,8 +750,11 @@ function downBorrowing(patientId){
}) })
} }
//批量下载借阅 /**
* 批量下载借阅
*/
function downBorrowings(){ function downBorrowings(){
pickTime("effeTime", null);
$("#typeId").val('loads'); $("#typeId").val('loads');
//加载申请借阅类型 //加载申请借阅类型
loadApplyType(2); loadApplyType(2);
@ -832,13 +814,17 @@ function downBorrowings(){
} }
} }
//模态框保存操作 /**
* 模态框保存操作
*/
function save(){ function save(){
var typeId = $("#typeId").val(); var typeId = $("#typeId").val();
saveMethod(1,"保存",typeId); saveMethod(1,"保存",typeId);
} }
//模态框提交操作 /**
* 模态框提交操作
*/
function add(){ function add(){
var typeId = $("#typeId").val(); var typeId = $("#typeId").val();
saveMethod(2,"提交",typeId); saveMethod(2,"提交",typeId);
@ -848,13 +834,13 @@ function add(){
function saveMethod(applyState,msg,typeId){ function saveMethod(applyState,msg,typeId){
if($("#effeTime").val() != ''){ if($("#effeTime").val() != ''){
var patientIds = $("#check").val(); var patientIds = $("#check").val();
if(patientIds == '') { if(patientIds == '' || patientIds == undefined) {
patientIds = $("#checks").val(); patientIds = $("#checks").val();
} }
if(patientIds == ''){ if(patientIds == '' || patientIds == undefined){
patientIds = $("#patientIds").val(); patientIds = $("#patientIds").val();
} }
if (patientIds != '') { if (patientIds != '' || patientIds == undefined) {
//过滤已可查阅的patientId集合; //过滤已可查阅的patientId集合;
patientIds = powerPotient(patientIds,false,typeId); patientIds = powerPotient(patientIds,false,typeId);
if(patientIds != ''){ if(patientIds != ''){

@ -7,12 +7,13 @@ $(function(){
}; };
/*点击图片的文本框*/ /*点击图片的文本框*/
$(".file").change(function(){ $(".file").change(function(){
debugger
var idFile = $(this).attr("id"); var idFile = $(this).attr("id");
var file = document.getElementById(idFile); var file = document.getElementById(idFile);
var imgContainer = $(this).parents(".z_photo"); //存放图片的父亲元素 var imgContainer = $(this).parents(".z_photo"); //存放图片的父亲元素
var fileList = file.files; //获取的图片文件 var fileList = file.files; //获取的图片文件
var imgArr = []; var imgArr = [];
//遍历得到的图片文件 //遍历得到的图片文件q
fileList = validateUp(fileList); fileList = validateUp(fileList);
for(var i = 0;i<fileList.length;i++){ for(var i = 0;i<fileList.length;i++){
var imgUrl = window.URL.createObjectURL(fileList[i]); var imgUrl = window.URL.createObjectURL(fileList[i]);

@ -533,6 +533,7 @@ http://sourceforge.net/adobe/cmap/wiki/License/
$(function () { $(function () {
//获取父页面打印权限显示打印按钮 //获取父页面打印权限显示打印按钮
var print = parent.$("#print").val(); var print = parent.$("#print").val();
$("#printLoading").show();
if (print == 1) { if (print == 1) {
$("#printLoading").show(); $("#printLoading").show();
} }

Loading…
Cancel
Save