儿童医院第三方跳转接口

master
linjj 3 years ago
parent 318bd420fe
commit d33e007779

@ -3,21 +3,28 @@ package com.emr.controller;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.emr.annotation.OptionalLog; import com.emr.annotation.OptionalLog;
import com.emr.dao.Archive_DetailMapper;
import com.emr.dao.CommomMapper; import com.emr.dao.CommomMapper;
import com.emr.dao.Emr_DictionaryMapper; import com.emr.dao.Emr_DictionaryMapper;
import com.emr.dao.approve.Emr_Apply_ApproveMapper; import com.emr.dao.approve.Emr_Apply_ApproveMapper;
import com.emr.dao.emrPdfWaterSet.EmrPdfWaterSetMapper;
import com.emr.entity.Emr_Dictionary; 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.Zd_Assort;
import com.emr.entity.approve.Emr_Apply_Approve; import com.emr.entity.approve.Emr_Apply_Approve;
import com.emr.entity.emrLog.Emr_Log; import com.emr.entity.emrLog.Emr_Log;
import com.emr.entity.emrPdfWaterSet.EmrPdfWaterSet;
import com.emr.entity.recordType.Emr_Type;
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.approve.ApplyApproveService; import com.emr.service.approve.ApplyApproveService;
import com.emr.service.emrLog.LogService; 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.service.recordType.EmrTypeRelatedService;
import com.emr.util.ExceptionPrintUtil; import com.emr.service.recordType.EmrTypeService;
import com.emr.util.HttpClientUtils; import com.emr.util.*;
import com.emr.vo.EmrPrintOrDownLoadInfo.EmrPrintOrDownLoadInfoVo; import com.emr.vo.EmrPrintOrDownLoadInfo.EmrPrintOrDownLoadInfoVo;
import com.emr.vo.User; import com.emr.vo.User;
import com.emr.vo.commomSearch.CommomTree; import com.emr.vo.commomSearch.CommomTree;
@ -40,6 +47,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File; import java.io.File;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
@ -47,10 +55,16 @@ import java.util.*;
@Controller @Controller
@RequestMapping("font/") @RequestMapping("font/")
public class FontShowRecordController { public class FontShowRecordController {
@Autowired
private Archive_DetailMapper archiveDetailMapper;
@Autowired
private EmrPdfWaterSetMapper pdfWaterSetMapper;
@Value("${waterPicPath}") @Value("${waterPicPath}")
private String WATERPICPATH; private String WATERPICPATH;
@Value("${EMR_RECORD_JSP}") @Value("${EMR_RECORD_JSP}")
private String EMRRECORDJSP; private String EMRRECORDJSP;
@Autowired
private EmrTypeRelatedService typeRelatedService;
@Value("${POWER_URLHEAD}") @Value("${POWER_URLHEAD}")
private String POWER_URLHEAD; private String POWER_URLHEAD;
@Autowired @Autowired
@ -386,6 +400,304 @@ public class FontShowRecordController {
return "font/showRecordFontSouth"; return "font/showRecordFontSouth";
} }
@RequestMapping(value = "getBloodRecordTree", produces = {"text/json;charset=UTF-8"})
@ResponseBody
public String getBloodRecordTree(String patientId, Integer typeId, HttpServletRequest request) {
List<CommomTree> treeList = new ArrayList<>();
//查询该有的权限分类
try {
List<CommomTree> commomVos = commomMapper.selectScanPathByPatientId(patientId, null, null);
//按打印分类id查询归属分类集合
List<Emr_Type_Related> typeRelateds = new ArrayList<>();
if (typeId != null) {
typeRelateds = typeRelatedService.selectAssortIdsByTypeId(typeId);
}
if (commomVos.size() > 0) {
//第一级:全部影像资料
CommomTree tree1 = new CommomTree();
Integer id = 1;
tree1.setId(id);
tree1.setNewName("全部影像资料");
if (null != commomVos && !commomVos.isEmpty()) {
//去重,取出不重复的分类集合
Map<String, CommomTree> assortMap = new LinkedHashMap<>();
for (CommomTree commomVo1 : commomVos) {
assortMap.put(commomVo1.getAssortId(), commomVo1);
}
//判断分类是否全选,全选,父类跟着全选
if (null != typeRelateds && !typeRelateds.isEmpty()) {
boolean checkedFlag = true;
for (Map.Entry<String, CommomTree> map : assortMap.entrySet()) {
//定义是否存在
boolean flag = false;
for (Emr_Type_Related typeRelated : typeRelateds) {
if (typeRelated.getAssortId().equals(map.getKey())) {
flag = true;
break;
}
}
if (!flag) {
checkedFlag = false;
break;
}
}
if (checkedFlag) {
tree1.setChecked("true");
}
} else {
tree1.setChecked("true");
}
treeList.add(tree1);
int oneId = 0;
for (Map.Entry<String, CommomTree> map : assortMap.entrySet()) {
id++;
oneId = id;
String assortId = map.getValue().getAssortId();
CommomTree tree2 = new CommomTree();
tree2.setId(id);
tree2.setParentId(1);
tree2.setAssortId(map.getValue().getAssortId());
//判断选中
boolean checkFlag = false;
if (null != typeRelateds && !typeRelateds.isEmpty()) {
for (Emr_Type_Related typeRelated : typeRelateds) {
if (StringUtils.isNotBlank(assortId) && assortId.equals(typeRelated.getAssortId())) {
tree2.setChecked("true");
checkFlag = true;
break;
}
}
} else {
checkFlag = true;
tree2.setChecked("true");
}
//定义该类影像图片数量
int scanPathCount = 0;
//第二层 图片
for (CommomTree commomVo : commomVos) {
if (StringUtils.isNotBlank(assortId) && StringUtils.isNotBlank(commomVo.getAssortId()) &&
assortId.equals(commomVo.getAssortId())) {
id++;
CommomTree tree3 = new CommomTree();
tree3.setId(id);
tree3.setParentId(oneId);
tree3.setAssortId(assortId);
if (checkFlag) {
tree3.setChecked("true");
}
scanPathCount++;
//图片名称
String name = commomVo.getScanPage();
tree3.setAssortName(name);
//设置树图片节点的名称
tree3.setNewName("(第" + scanPathCount + "页)" + name);
tree3.setSource(commomVo.getSource());
//存储水印图片
treeList.add(tree3);
}
}
tree2.setNewName(map.getValue().getAssortName() + "(" + scanPathCount + ")");
treeList.add(tree2);
}
}
}
if (commomVos.size() == 0) {
List<CommomTree> archiveDetail = archiveDetailMapper.selectPdfPathByPatient2(patientId);
//第一级:全部影像资料
CommomTree tree1 = new CommomTree();
Integer id = 1;
tree1.setId(id);
tree1.setNewName("全部影像资料");
if (null != archiveDetail && !archiveDetail.isEmpty()) {
//去重,取出不重复的分类集合
Map<String, CommomTree> assortMap = new LinkedHashMap<>();
for (CommomTree commomVo1 : archiveDetail) {
assortMap.put(commomVo1.getAssortId(), commomVo1);
}
//判断分类是否全选,全选,父类跟着全选
if (null != typeRelateds && !typeRelateds.isEmpty()) {
boolean checkedFlag = true;
for (Map.Entry<String, CommomTree> map : assortMap.entrySet()) {
//定义是否存在
boolean flag = false;
for (Emr_Type_Related typeRelated : typeRelateds) {
if (typeRelated.getAssortId().equals(map.getKey())) {
flag = true;
break;
}
}
if (!flag) {
checkedFlag = false;
break;
}
}
if (checkedFlag) {
tree1.setChecked("true");
}
} else {
tree1.setChecked("true");
}
treeList.add(tree1);
int oneId = 0;
for (Map.Entry<String, CommomTree> map : assortMap.entrySet()) {
id++;
oneId = id;
String assortId = map.getValue().getAssortId();
CommomTree tree2 = new CommomTree();
tree2.setId(id);
tree2.setParentId(1);
tree2.setAssortId(map.getValue().getAssortId());
//判断选中
boolean checkFlag = false;
if (null != typeRelateds && !typeRelateds.isEmpty()) {
for (Emr_Type_Related typeRelated : typeRelateds) {
if (StringUtils.isNotBlank(assortId) && assortId.equals(typeRelated.getAssortId())) {
tree2.setChecked("true");
checkFlag = true;
break;
}
}
} else {
checkFlag = true;
tree2.setChecked("true");
}
//定义该类影像图片数量
int scanPathCount = 0;
//第二层 图片
int scanPathCountNum = 0;
for (CommomTree commomVo : archiveDetail) {
if (StringUtils.isNotBlank(assortId) && StringUtils.isNotBlank(commomVo.getAssortId()) &&
assortId.equals(commomVo.getAssortId())) {
id++;
CommomTree tree3 = new CommomTree();
tree3.setId(id);
tree3.setParentId(oneId);
tree3.setAssortId(assortId);
if (checkFlag) {
tree3.setChecked("true");
}
scanPathCount++;
//图片名称
String name = commomVo.getScanPage();
tree3.setAssortName(name);
//设置树图片节点的名称
tree3.setNewName(commomVo.getTitle());
tree3.setSource(commomVo.getSource());
//存储水印图片
treeList.add(tree3);
scanPathCountNum = commomVo.getPageCount();
}
}
tree2.setNewName(map.getValue().getAssortName() + "(" + scanPathCountNum + ")");
treeList.add(tree2);
}
}
}
return JSON.toJSONString(treeList);
} catch (Exception e) {
ExceptionPrintUtil.printException(e);
e.printStackTrace();
return null;
}
}
@RequestMapping(value = "showRecordContentBlood")
@ResponseBody
public ResultUtil showRecordContentBlood(String patientId, String scanPages, String sources, String flag, HttpServletResponse response, HttpServletRequest request) {
try {
commomService.showRecordContentBloodFont(patientId, scanPages, sources, flag, response, request);
return ResultUtil.ok();
} catch (Exception e) {
ExceptionPrintUtil.printException(e);
e.printStackTrace();
return ResultUtil.error("showRecordContentBlood查询文件出错了");
}
}
@RequestMapping("getPrintPicLoading")
@ResponseBody
public ResultUtil getPrintPicLoading(String patientId, HttpServletRequest request) throws Exception {
Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
String mapKey = "admin" + "_" + patientId;
Integer loadingInteger = commomService.getPrintPicLoading(mapKey);
return ResultUtil.ok(loadingInteger);
}
@RequestMapping(value = "selectPrintPic", method = RequestMethod.POST)
@ResponseBody
public ResultUtil selectPrintPic(HttpServletResponse response, String patientId, String rootPaths, String names, String sources, HttpServletRequest request) throws Exception {
//生成加载进度mapKey
String mapKey = "admin" + "_" + patientId;
List<String> outs = commomService.selectPrintPic(response, patientId, rootPaths, names, sources, mapKey);
return ResultUtil.ok(outs);
}
@RequestMapping(value = "getRecordContentBlood")
@ResponseBody
public void getRecordContentBlood(String patientId, HttpServletRequest request, HttpServletResponse response) {
List<CommomTree> commomTrees = archiveDetailMapper.selectPdfPathByPatient2(patientId);
if (commomTrees.size() == 0) {
try {
List<String> scanPages = commomMapper.selectPathLIst(patientId);
if (!CollectionUtils.isEmpty(scanPages)) {
String pdfName = "档案管理PDF";
//根据图片路径转换pdf
EmrPdfWaterSet emrPdfWaterSet = pdfWaterSetMapper.selectByPrimaryKey(1);
//UserEffective为1是开启用户信息水印
Short userEffective = emrPdfWaterSet.getUserEffective();
if (userEffective==1) {
img2PdfUtil.imageToPdfUserEffective(response, scanPages, pdfName, emrPdfWaterSet);
}
}
} catch (Exception e) {
ExceptionPrintUtil.printException(e);
e.printStackTrace();
}
} else {
String pdfWater = "";
String mapKey = "admin" + "_" + patientId;
List<String> filePaths = (List<String>) request.getSession().getAttribute(mapKey);
if (!CollectionUtils.isEmpty(filePaths)) {
//根据图片路径转换pdf
EmrPdfWaterSet emrPdfWaterSet = pdfWaterSetMapper.selectByPrimaryKey(1);
//定义第二文本水印 姓名 + 科室 + ip
EmrPdfWaterSet emrPdfWaterSet1 = commomService.getEmrPdfWaterSet(emrPdfWaterSet);
Jpg2PdfUtil.mulFile2One2(response, filePaths, pdfWater,emrPdfWaterSet);
//移除缓存
request.removeAttribute(mapKey);
}
}
}
@RequestMapping("showRecordIframeBloodNewFont")
public String showRecordIframeBlood(String patientId, String flag, Model model, HttpServletRequest request) {
model.addAttribute("patientId", patientId);
//打印分类集合
List<Emr_Type> emrTypes = null;
List<Zd_Assort> zdAssorts = null;
int isDownload = 0;
model.addAttribute("emrTypes", emrTypes);
model.addAttribute("zdAssorts", zdAssorts);
model.addAttribute("isDownload", isDownload);
//查询是否有打印权限
int printFlag = 0;
int moveFlag = 0;
model.addAttribute("moveFlag", moveFlag);
model.addAttribute("printFlag", printFlag);
model.addAttribute("flag", flag);
return "recordManage/commomSearch/showRecordIframeBloodFont";
}
/** /**
* pdfiframe * pdfiframe
* @param patientId * @param patientId

@ -124,4 +124,12 @@ public interface CommomMapper {
* *
* */ * */
List<CommomVo> selectAllAndPatientId(@Param("patientId")String patientId); List<CommomVo> selectAllAndPatientId(@Param("patientId")String patientId);
/**
* @description:
* @params: patientId
* @author linjj
* @date: 2023/7/5 17:42
*/
List<String> selectPathLIst(@Param("patientId")String patientId);
} }

@ -208,6 +208,58 @@ public class CommomService {
return ipAddress; return ipAddress;
} }
//脐血库显示pdf
public void showRecordContentBloodFont(String patientId, String scanPages, String sources, String flag, HttpServletResponse response, HttpServletRequest request) throws Exception {
if (StringUtils.isNotBlank(patientId)) {
patientId = patientId.replace("\'", "");
//查询
if (StringUtils.isNotBlank(flag)) {
CommomVo commomVo = commomMapper.selectByPrimaryKey(patientId);
if (StringUtils.isNotBlank(commomVo.getFilePath())) {
//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])) {
srcStr = root1 + File.separator + 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()) {
String mapKey = "admin" + "_" + patientId;
request.getSession().setAttribute(mapKey, filePaths);
}
} else {
List<String> commomTrees = archiveDetailMapper.selectPDFRATH(patientId);
if (!commomTrees.isEmpty()) {
String mapKey = "admin" + "_" + patientId;
request.getSession().setAttribute(mapKey, commomTrees);
}
}
}
}
}
//脐血库显示pdf //脐血库显示pdf
public void showRecordContentBlood(String patientId, String scanPages, String sources, String flag, HttpServletResponse response, HttpServletRequest request) throws Exception { public void showRecordContentBlood(String patientId, String scanPages, String sources, String flag, HttpServletResponse response, HttpServletRequest request) throws Exception {
if (StringUtils.isNotBlank(patientId)) { if (StringUtils.isNotBlank(patientId)) {

@ -1316,6 +1316,14 @@
parameterType="java.lang.String"> parameterType="java.lang.String">
SELECT * from commomtable where patient_id=#{patientId} SELECT * from commomtable where patient_id=#{patientId}
</select> </select>
<select id="selectPathLIst" resultType="java.lang.String">
SELECT
c.file_path+'\'+t.scan_page as fliePath
FROM
commomtable c
LEFT JOIN t_scan_assort t on c.patient_id=t.patient_id
where t.is_del!=1 and c.patient_id=#{patientId}
</select>
<!--修改病案备注--> <!--修改病案备注-->
<update id="updateRecordReMark" parameterType="com.emr.vo.commomSearch.CommomVo"> <update id="updateRecordReMark" parameterType="com.emr.vo.commomSearch.CommomVo">
update commomtable update commomtable

@ -0,0 +1,263 @@
<%@ 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="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" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true" oallowfullscreen="true" msallowfullscreen="true"></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/showRecordIframeBloodFont.js?t=2021-08-24"></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>

@ -13,7 +13,7 @@ $(function(){
$("#iframe").prop("src",path+"/font/showRecordIframeBloodFont?patientId="+$("#patientId").val()+"&flag=file_path"); $("#iframe").prop("src",path+"/font/showRecordIframeBloodFont?patientId="+$("#patientId").val()+"&flag=file_path");
}else{ }else{
//谷歌 //谷歌
$("#iframe").prop("src",path+"/commom/showRecordIframeBlood?patientId="+$("#patientId").val()+"&flag=file_path"+"&rootPaths="+$("#rootPaths").val()); $("#iframe").prop("src",path+"/font/showRecordIframeBloodNewFont?patientId="+$("#patientId").val()+"&flag=file_path"+"&rootPaths="+$("#rootPaths").val());
} }
//加载其他诊断名称鼠标滑过显示全部文本 //加载其他诊断名称鼠标滑过显示全部文本
//loadQtip('.otherDiagName'); //loadQtip('.otherDiagName');

@ -0,0 +1,606 @@
//树操作
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 + "/font/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();
$.ajax({
type: 'post',
url: path + "/font/showRecordContentBlood",
data: {
patientId: patientId,
scanPages: scanPages,
flag: flag,
sources: sources
},
datType: 'json',
success: function (data) {
if (data.code == 0) {
var str = path + "/font/getRecordContentBlood?patientId=" + patientId;
$("#iframe1").attr("src", path + "/static/pdfjs/web/viewer.html?file=" + encodeURIComponent(str))
}
}
})
}
/*function onloadPdf(scanPages, sources) {
$("#iframeLoad").val("");
$("#printPicLoaded").val("");
var patientId = $("#patientId").val();
//根目录字段识别名称
var flag = parent.$("#flag").val();
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));
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 + "/font/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);
}
}
})
}, 100000);
}
function selectPrintPic2(patientId, scanPages, sources) {
$.ajax({
type: 'post',
url: path + "/commom/selectPrintPic2",
data: {
patientId: patientId,
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 + "/font/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);
}
}
})
}, 1000000);
}
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("转移成功!");
}
}
})
}
}
Loading…
Cancel
Save