master
zengwh 6 years ago
parent a76ee93ced
commit c15ad8a99a

@ -5,14 +5,13 @@ import com.emr.entity.OffsetLimitPage;
import com.emr.service.ipml.StatisticsService;
import com.emr.util.ExceptionPrintUtil;
import com.emr.util.ExportExcelUtil1;
import com.emr.vo.FinalAndFirstStatistics;
import com.emr.vo.TUuInfoVo;
import com.emr.vo.TUuPrintSearch;
import com.emr.vo.TUuPrintVo;
import com.emr.vo.*;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@ -400,4 +399,54 @@ public class StatisticsController {
e.printStackTrace();
}
}
//病案统计报表
@RequestMapping("recordStatistics/{level}")
public String recordStatistics(@PathVariable("level")String level,RecordStatistics record,Model model){
model.addAttribute("level",level);
model.addAttribute("record",record);
return "statistics/recordStatistics";
}
//病案统计报表
@RequestMapping("getRecordStatistics")
@ResponseBody
public OffsetLimitPage getRecordStatistics(RecordStatistics recordStatistics){
try {
List<RecordStatistics> list = statisticsService.getRecordStatistics(recordStatistics);
return new OffsetLimitPage((Page)list);
} catch (Exception e) {
ExceptionPrintUtil.printException(e);
e.printStackTrace();
return null;
}
}
//按科室分组查
@RequestMapping("getRecordStatisticsGroupDept")
@ResponseBody
public OffsetLimitPage getRecordStatisticsGroupDept(Integer offset, Integer limit,RecordStatistics recordStatistics){
try {
List<RecordStatistics> list = statisticsService.getRecordStatisticsGroupDept(offset, limit, recordStatistics);
return new OffsetLimitPage((Page)list);
} catch (Exception e) {
ExceptionPrintUtil.printException(e);
e.printStackTrace();
return null;
}
}
//按根据科室查
@RequestMapping("getRecordStatisticsByDeptName")
@ResponseBody
public OffsetLimitPage getRecordStatisticsByDeptName(Integer offset, Integer limit,RecordStatistics recordStatistics){
try {
List<RecordStatistics> list = statisticsService.getRecordStatisticsByDeptName(offset, limit, recordStatistics);
return new OffsetLimitPage((Page)list);
} catch (Exception e) {
ExceptionPrintUtil.printException(e);
e.printStackTrace();
return null;
}
}
}

@ -23,20 +23,22 @@ public class WebServiceLoad {
@PostConstruct
public void contextInitialized() {
new Thread(() -> {
String token = "11";
String POWER_URLHEAD = PropertiesUtils.getProperty("POWER_JSP");
//创建连接工厂
JAXDynamicClientFactory dcf = JAXDynamicClientFactory.newInstance();
//创建客户端
Client client = dcf.createClient(POWER_URLHEAD + "/WebService/PowerWebService?wsdl");
try {
//动态调用getInfosByUserId方法
client.invoke("getInfosByUserId", token, "emr_medical_record");
} catch (Exception e) {
e.printStackTrace();
}finally {
if(null != client) {
client.destroy();
for (int i = 0; i < 2; i++) {
String token = "ORsaVDUBE1RFRFRETE5BR05ERVQ3JyBURkRGRA==";
String POWER_URLHEAD = PropertiesUtils.getProperty("POWER_JSP");
//创建连接工厂
JAXDynamicClientFactory dcf = JAXDynamicClientFactory.newInstance();
//创建客户端
Client client = dcf.createClient(POWER_URLHEAD + "/WebService/PowerWebService?wsdl");
try {
//动态调用getInfosByUserId方法
client.invoke("getInfosByUserId", token, "emr_medical_record");
} catch (Exception e) {
e.printStackTrace();
}finally {
if(null != client) {
client.destroy();
}
}
}
}).start();

@ -47,18 +47,23 @@ public class lastVerifyController {
@ResponseBody
@RequestMapping(value = "/lastVerifyList")
public OffsetLimitPage lastVerifyList(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit,Integer isSearch) {
long start = System.currentTimeMillis();
//判断是否是初始化查询,是初始化查询把开始结束时间置空
if(isSearch == 0){
archiveMasterVo.setStartDateTo(null);
archiveMasterVo.setEndDateTo(null);
}
try {
return archiveMasterService.selectByLast(archiveMasterVo, offset, limit);
OffsetLimitPage offsetLimitPage = archiveMasterService.selectByLast(archiveMasterVo, offset, limit);
long end = System.currentTimeMillis();
System.out.println("用时:"+(end-start)/1000.0+"s");
return offsetLimitPage;
} catch (Exception e) {
ExceptionPrintUtil.printException(e);
e.printStackTrace();
return null;
}
}
@ResponseBody

@ -34,4 +34,11 @@ public interface Archive_DetailMapper {
List<Archive_Detail> selectTypeTreeByPatientIdAndAssortIds(@Param("patientId")String patientId,@Param("assortIds")String assortIds);
List<Archive_Detail> selectPdfPathByIds(@Param("masterId")String masterId,@Param("detailIds")String detailIds);
/**
* masterIdassortId
* @param masterIds
* @return
*/
List<Archive_Detail> selectAssortIdsByMasterIds(@Param("masterIds") String masterIds);
}

@ -39,4 +39,12 @@ public interface Archive_MasterMapper {
*
* */
List<Archive_Master_Vo> selectFiled(Archive_Master_Vo master);
/**
* masterIdsLockInfo
* @param masterIds
* @param lockinfo
* @return
*/
int updateLockInfoByMasterId(@Param("masterIds")String masterIds,@Param("lockinfo")String lockinfo);
}

@ -0,0 +1,22 @@
package com.emr.dao;
import com.emr.vo.RecordStatistics;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PathVariable;
import java.util.List;
public interface RecordStatisticsMapper {
//统计总病历数
int getRecordCount(RecordStatistics record);
//统计总文件数
List<RecordStatistics> getFileCount(RecordStatistics record);
//按科室分组统计病案
List<RecordStatistics> getRecordStatisticsGroupDept(RecordStatistics recordStatistics);
//按科室和来源分组统计文件
List<RecordStatistics> getFileStatisticsGroupDept(RecordStatistics recordStatistics);
List<RecordStatistics> getRecordStatisticsByDeptName(RecordStatistics recordStatistics);
List<RecordStatistics> getFileCountByMasterIds(@Param("masterIds") String masterIds);
}

@ -39,6 +39,8 @@ public class Archive_Master_Vo extends Archive_Master{
private Integer role;//操作角色1,2,4
private Integer infoId;//流转流程的id
private Integer isSuccess = 0;//是否完整1完整0不完整
}

@ -9,6 +9,8 @@ public class Zd_Assort {
private String printFlag;
private Integer isCheck;
public String getAssortId() {
return assortId;
}
@ -40,4 +42,12 @@ public class Zd_Assort {
public void setPrintFlag(String printFlag) {
this.printFlag = printFlag == null ? null : printFlag.trim();
}
public Integer getIsCheck() {
return isCheck;
}
public void setIsCheck(Integer isCheck) {
this.isCheck = isCheck;
}
}

@ -2,6 +2,7 @@ package com.emr.service.ipml;
import com.emr.dao.ArchiveCallbackInfoMapper;
import com.emr.entity.ArchiveCallbackInfo;
import com.emr.entity.ArchiveFlowRole;
import com.emr.entity.Archive_Master;
import com.emr.entity.OffsetLimitPage;
import com.emr.service.Archive_MasterService;
@ -72,7 +73,9 @@ public class ArchiveCallbackInfoService {
String currentCode = EnumVerify.DocState.CallBacked.getCode() + "";
String remark = callbackInfo.getCallbackReason();
Integer targetCode = EnumVerify.DocState.CallBacked.getCode();
archiveFlowInfoService.insertFlowInfo(masterId,currentCode,remark,targetCode,new Date());
//获取当前节点和下个节点对象集合
List<ArchiveFlowRole> currentRoleAndNextRole = archiveFlowInfoService.getCurrentRoleAndNextRole(currentCode,targetCode);
archiveFlowInfoService.insertFlowInfo(masterId,remark,currentRoleAndNextRole.get(0),currentRoleAndNextRole.get(1),new Date());
//TODO 删除病案资料
callbackInfoMapper.deleteRecordByRecall(masterId);
}
@ -123,20 +126,20 @@ public class ArchiveCallbackInfoService {
//转换状态
//计算属于哪种审核角色
List<User> userList = statisticsService.getUserList();
for (int i = 0; i < list.size(); i++) {
String archivestate = list.get(i).getArchivestate();
for (ArchiveCallbackInfoVo callbackInfoVo1 : list) {
String archivestate = callbackInfoVo1.getArchivestate();
if (StringUtils.isNotBlank(archivestate)) {
//转换中文状态
Integer status = Integer.valueOf(archivestate);
archivestate = EnumVerify.DocState.GetStepName(status, EnumVerify.Checker.Generate.getCode());
list.get(i).setArchivestate(archivestate);
callbackInfoVo1.setArchivestate(archivestate);
}
if(!CollectionUtils.isEmpty(userList)) {
if (!CollectionUtils.isEmpty(userList)) {
//转换姓名
String userName = list.get(i).getCallbackUserName();
String userName = callbackInfoVo1.getCallbackUserName();
for (User user : userList) {
if (StringUtils.isNotBlank(userName) && userName.equals(user.getUserName())) {
list.get(i).setCallbackUserName(user.getName());
callbackInfoVo1.setCallbackUserName(user.getName());
break;
}
}

@ -15,8 +15,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
/**
@ -49,148 +51,213 @@ public class ArchiveFlowInfoService {
/**
*
* @param masterId
* @param currentStatus code
* @param remark
* @param appointNextCode code使
* @param currentRole
* @param nextRole 使
* @param sumbitDate
* @throws Exception
*/
public Integer insertFlowInfo(String masterId,String currentStatus,String remark,Integer appointNextCode,Date sumbitDate)throws Exception{
if(StringUtils.isNotBlank(currentStatus)) {
//添加退回流程
ArchiveFlowInfo flowInfo = new ArchiveFlowInfo();
//masterId;
flowInfo.setMasterId(masterId);
//查询审核角色集合根据有效进行计算状态code
List<ArchiveFlowRole> archiveFlowRoles = flowRoleMapper.selectAll();
//stepIndex:当前步骤
ArchiveFlowRole currentRole = new ArchiveFlowRole();
for (ArchiveFlowRole archiveFlowRole : archiveFlowRoles) {
if (archiveFlowRole.getCode().equals(currentStatus)) {
currentRole = archiveFlowRole;
break;
}
}
//当前stepIndex
flowInfo.setStepIndex(currentRole.getStepIndex());
//当前节点id
flowInfo.setStartStepId(currentRole.getId());
//startStep:当前步骤name
flowInfo.setStartStep(currentRole.getName());
//定义操作角色operRole
Short operRole = currentRole.getRole();
//sumbitName
public Integer insertFlowInfo(String masterId,String remark,ArchiveFlowRole currentRole,ArchiveFlowRole nextRole,Date sumbitDate)throws Exception{
//添加退回流程
ArchiveFlowInfo flowInfo = new ArchiveFlowInfo();
//masterId;
flowInfo.setMasterId(masterId);
//useSeconds:距离上次提交用时s数
long millis = getMillis(masterId, currentRole, nextRole);
if(millis != 0){
flowInfo.setUseSeconds(millis / 1000);
}
//如果下节点role不为空取下节点operRole
if(null != nextRole.getRole()){
flowInfo.setOperRole(nextRole.getRole());
}else{
flowInfo.setOperRole(currentRole.getRole());
}
//如果下节点的sumBitName不为空取下节点的sumbitName
if(StringUtils.isNotBlank(nextRole.getSumbitName())){
flowInfo.setSumbitName(nextRole.getSumbitName());
}else{
flowInfo.setSumbitName(currentRole.getSumbitName());
//targetStep:下一步骤name
ArchiveFlowRole nextRole = new ArchiveFlowRole();
for (ArchiveFlowRole archiveFlowRole : archiveFlowRoles) {
//判断相同审核角色,比当前步骤还大且有效的角色
if (null != archiveFlowRole.getRole() && archiveFlowRole.getEffective() == 1) {
if(null == appointNextCode){
if(null != currentRole.getRole() && null != archiveFlowRole.getStepIndex()){
if (currentRole.getRole().equals(archiveFlowRole.getRole()) && archiveFlowRole.getStepIndex() > currentRole.getStepIndex()) {
nextRole = archiveFlowRole;
break;
}
}
//当前stepIndex
flowInfo.setStepIndex(currentRole.getStepIndex());
//当前节点id
flowInfo.setStartStepId(currentRole.getId());
//startStep:当前步骤name
flowInfo.setStartStep(currentRole.getName());
//targetStep
flowInfo.setTargetStep(nextRole.getName());
//下个节点的id
flowInfo.setTargetStepId(nextRole.getId());
//remark:提交内容
flowInfo.setRemark(remark);
//userName:提交人用户名
// 从session获取用户名
String username = (String) SecurityUtils.getSubject().getSession().getAttribute("userSession");
flowInfo.setUserName(username);
//submit:提交时间
flowInfo.setSumbitTime(sumbitDate);
//createtime:创建时间
flowInfo.setCreatetime(new Date());
flowInfoMapper.insertSelective(flowInfo);
return flowInfo.getId();
}
/**
* (list.get(0))(list.get(1))
* @param currentStatus
* @param appointNextCode
* @return
*/
public List<ArchiveFlowRole> getCurrentRoleAndNextRole(String currentStatus,Integer appointNextCode){
List<ArchiveFlowRole> currentRoleAndNextRoleList = new LinkedList<>();
//查询审核角色集合根据有效进行计算状态code
List<ArchiveFlowRole> archiveFlowRoles = flowRoleMapper.selectAll();
//stepIndex:当前步骤
ArchiveFlowRole currentRole = getCurrentRoleByCurrentStatus(currentStatus, archiveFlowRoles);
currentRoleAndNextRoleList.add(currentRole);
if(null != appointNextCode){
//targetStep:下一步骤节点信息
ArchiveFlowRole nextRole = getNextRoleByCurrentStatus(appointNextCode, archiveFlowRoles, currentRole);
currentRoleAndNextRoleList.add(nextRole);
}
return currentRoleAndNextRoleList;
}
/***
*
* @param masterId
* @param currentRole
* @param nextRole
* @return
* @throws ParseException
*/
private long getMillis(String masterId, ArchiveFlowRole currentRole, ArchiveFlowRole nextRole) throws ParseException {
long millis = 0;
Date preDate = new Date();
//查询上次节点的时间
//查询上次节点的时间方法参数当前节点的名称,当下个节点为病案室终审不带当前审核名称查询该病案最后审核时间
String currentName = "";
if(!nextRole.getName().equals(EnumVerify.DocState.MedicalRoomCheck.getName())){
currentName = currentRole.getName();
}
List<ArchiveFlowInfo> archiveFlowInfos = flowInfoMapper.selectPreInfo(masterId,currentName);
if (null != archiveFlowInfos && !archiveFlowInfos.isEmpty()) {
//存在取最后一次提交时间
preDate = archiveFlowInfos.get(0).getCreatetime();
} else {
//取出院时间
Archive_Master archiveMaster1 = archiveMasterMapper.selectByPrimaryKey(masterId);
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dischargeDateTime = archiveMaster1.getDischargeDateTime();
if (StringUtils.isNotBlank(dischargeDateTime)) {
preDate = fmt.parse(dischargeDateTime);
}
}
if (null != preDate) {
millis = System.currentTimeMillis() - preDate.getTime();
//查询是否这个时间段是否有假日
int holidayDays = holidaySetMapper.selectHolidayByDate(preDate);
if(holidayDays != 0){
int holidayMilTime = holidayDays * 24 * 3600 * 1000;
millis -= holidayMilTime;
}
}
return millis;
}
/**
*
* @param appointNextCode
* @param archiveFlowRoles
* @param currentRole
* @return
*/
private ArchiveFlowRole getNextRoleByCurrentStatus(Integer appointNextCode, List<ArchiveFlowRole> archiveFlowRoles, ArchiveFlowRole currentRole) {
ArchiveFlowRole nextRole = new ArchiveFlowRole();
for (ArchiveFlowRole archiveFlowRole : archiveFlowRoles) {
//判断相同审核角色,比当前步骤还大且有效的角色
if (null != archiveFlowRole.getRole() && archiveFlowRole.getEffective() == 1) {
if(null == appointNextCode){
if(null != currentRole.getRole() && null != archiveFlowRole.getStepIndex()){
if (currentRole.getRole().equals(archiveFlowRole.getRole()) && archiveFlowRole.getStepIndex() > currentRole.getStepIndex()) {
nextRole = archiveFlowRole;
nextRole.setRole(null);
nextRole.setSumbitName(null);
break;
}
}else{
//指定的下个节点code用于退回
if (archiveFlowRole.getCode().equals(appointNextCode+"")) {
//医生退回下个节点为医生
if(appointNextCode.equals(EnumVerify.DocState.DortorBack.getCode())){
//sumbitName
flowInfo.setSumbitName(EnumVerify.DocState.DortorBack.getName());
nextRole.setName(EnumVerify.DocState.DortorSubmit.getName());
nextRole.setId(archiveFlowRole.getId());
operRole = 1;
break;
//护士退回下个节点为护士
}else if(appointNextCode.equals(EnumVerify.DocState.NurseBack.getCode())){
flowInfo.setSumbitName(EnumVerify.DocState.NurseBack.getName());
nextRole.setName(EnumVerify.DocState.NurseSubmit.getName());
nextRole.setId(archiveFlowRole.getId());
operRole = 2;
break;
//下个节点是病案室审核,属于召回
}else if(appointNextCode.equals(EnumVerify.DocState.CallBacked.getCode())){
flowInfo.setSumbitName(archiveFlowRole.getSumbitName());
nextRole.setName(EnumVerify.DocState.MedicalRoomCheck.getName());
//查询病案室终审id
for (ArchiveFlowRole archiveFlowRole1 : archiveFlowRoles) {
if (archiveFlowRole1.getCode().equals(EnumVerify.DocState.MedicalRoomCheck.getCode()+"")) {
nextRole.setId(archiveFlowRole1.getId());
break;
}
}
}else{
//指定的下个节点code用于退回
if (archiveFlowRole.getCode().equals(appointNextCode+"")) {
//医生退回下个节点为医生
if(appointNextCode.equals(EnumVerify.DocState.DortorBack.getCode())){
//sumbitName
nextRole.setSumbitName(EnumVerify.DocState.DortorBack.getName());
nextRole.setName(EnumVerify.DocState.DortorSubmit.getName());
nextRole.setId(archiveFlowRole.getId());
nextRole.setRole(Short.valueOf("1"));
break;
//护士退回下个节点为护士
}else if(appointNextCode.equals(EnumVerify.DocState.NurseBack.getCode())){
nextRole.setSumbitName(EnumVerify.DocState.NurseBack.getName());
nextRole.setName(EnumVerify.DocState.NurseSubmit.getName());
nextRole.setId(archiveFlowRole.getId());
nextRole.setRole(Short.valueOf("2"));
break;
//下个节点是病案室审核,属于召回
}else if(appointNextCode.equals(EnumVerify.DocState.CallBacked.getCode())){
nextRole.setSumbitName(archiveFlowRole.getSumbitName());
nextRole.setName(EnumVerify.DocState.MedicalRoomCheck.getName());
//查询病案室终审id
for (ArchiveFlowRole archiveFlowRole1 : archiveFlowRoles) {
if (archiveFlowRole1.getCode().equals(EnumVerify.DocState.MedicalRoomCheck.getCode()+"")) {
nextRole.setId(archiveFlowRole1.getId());
break;
}
//病案室审核
}else if(appointNextCode.equals(EnumVerify.DocState.MedicalRoomCheck.getCode())){
nextRole.setName("已归档");
nextRole.setId(archiveFlowRole.getId());
}
//病案室审核
}else if(appointNextCode.equals(EnumVerify.DocState.MedicalRoomCheck.getCode())){
nextRole.setName("已归档");
nextRole.setId(archiveFlowRole.getId());
}
}
}
}
//下个节点为空,填写护士长
if(StringUtils.isBlank(nextRole.getName())){
for (ArchiveFlowRole archiveFlowRole : archiveFlowRoles) {
if(archiveFlowRole.getCode().equals(EnumVerify.DocState.HeadNurseCheck.getCode()+"")){
nextRole = archiveFlowRole;
break;
}
}
}
flowInfo.setTargetStep(nextRole.getName());
//下个节点的id
flowInfo.setTargetStepId(nextRole.getId());
//useSeconds:距离上次提交用时s数
Date preDate = new Date();
//查询上次节点的时间
//查询上次节点的时间方法参数当前节点的名称,当下个节点为病案室终审不带当前审核名称查询该病案最后审核时间
String currentName = "";
if(!nextRole.getName().equals(EnumVerify.DocState.MedicalRoomCheck.getName())){
currentName = currentRole.getName();
}
List<ArchiveFlowInfo> archiveFlowInfos = flowInfoMapper.selectPreInfo(masterId,currentName);
if (null != archiveFlowInfos && !archiveFlowInfos.isEmpty()) {
//存在取最后一次提交时间
preDate = archiveFlowInfos.get(0).getCreatetime();
} else {
//取出院时间
Archive_Master archiveMaster1 = archiveMasterMapper.selectByPrimaryKey(masterId);
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dischargeDateTime = archiveMaster1.getDischargeDateTime();
if (StringUtils.isNotBlank(dischargeDateTime)) {
preDate = fmt.parse(dischargeDateTime);
}
//下个节点为空,填写护士长
if(StringUtils.isBlank(nextRole.getName())){
for (ArchiveFlowRole archiveFlowRole : archiveFlowRoles) {
if(archiveFlowRole.getCode().equals(EnumVerify.DocState.HeadNurseCheck.getCode()+"")){
nextRole = archiveFlowRole;
nextRole.setRole(null);
nextRole.setSumbitName(null);
break;
}
}
if (null != preDate) {
long millis = System.currentTimeMillis() - preDate.getTime();
//查询是否这个时间段是否有假日
int holidayDays = holidaySetMapper.selectHolidayByDate(preDate);
if(holidayDays != 0){
int holidayMilTime = holidayDays * 24 * 3600 * 1000;
millis -= holidayMilTime;
}
flowInfo.setUseSeconds(millis / 1000);
}
return nextRole;
}
/**
*
* @param currentStatus
* @param archiveFlowRoles
* @return
*/
private ArchiveFlowRole getCurrentRoleByCurrentStatus(String currentStatus, List<ArchiveFlowRole> archiveFlowRoles) {
ArchiveFlowRole currentRole = new ArchiveFlowRole();
for (ArchiveFlowRole archiveFlowRole : archiveFlowRoles) {
if (archiveFlowRole.getCode().equals(currentStatus)) {
currentRole = archiveFlowRole;
break;
}
flowInfo.setOperRole(operRole);
//remark:提交内容
flowInfo.setRemark(remark);
//userName:提交人用户名
// 从session获取用户名
String username = (String) SecurityUtils.getSubject().getSession().getAttribute("userSession");
flowInfo.setUserName(username);
//submit:提交时间
flowInfo.setSumbitTime(sumbitDate);
//createtime:创建时间
flowInfo.setCreatetime(new Date());
flowInfoMapper.insertSelective(flowInfo);
return flowInfo.getId();
}
return null;
return currentRole;
}
/**
* masterId
* @param id

@ -7,7 +7,9 @@
package com.emr.service.ipml;
import com.emr.dao.ArchiveFlowRoleMapper;
import com.emr.dao.Archive_DetailMapper;
import com.emr.dao.Archive_MasterMapper;
import com.emr.dao.Zd_AssortMapper;
import com.emr.entity.*;
import com.emr.service.Archive_MasterService;
import com.emr.service.Emr_Fault_DetailService;
@ -20,6 +22,7 @@ import org.apache.shiro.SecurityUtils;
import javax.servlet.http.HttpServletRequest;
import org.apache.shiro.util.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -45,6 +48,10 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
private ArchiveFlowRoleMapper flowRoleMapper;
@Autowired
private ArchiveFlowInfoService flowInfoService;
@Autowired
private Archive_DetailMapper detailMapper;
@Autowired
private Zd_AssortMapper assortMapper;
/**
*
* */
@ -62,9 +69,92 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
public OffsetLimitPage selectByColumn(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit) {
PageHelper.offsetPage(offset, limit);
List<Archive_Master_Vo> list = selectByColumn(archiveMasterVo);
long start = System.currentTimeMillis();
//组织完整性字段
//list集合的分组分类集合
if(!CollectionUtils.isEmpty(list)){
List<Archive_Detail> details = getArchiveDetailsByMasterIds(list);
if(!CollectionUtils.isEmpty(details)){
//查询需要校验完整性的分类集合
Zd_Assort assort = new Zd_Assort();
assort.setIsCheck(1);
List<Zd_Assort> assortList = assortMapper.selectAll(assort);
//循环遍历list集合判断是否完整完整isCheck赋值1且批量更新LockInfo字段为完整
checkSuccess(list, details, assortList);
}
}
long end = System.currentTimeMillis();
System.out.println("用时"+(end-start)/1000.0+"s");
return new OffsetLimitPage((Page) list);
}
/**
* //循环遍历list集合判断是否完整完整isCheck赋值1且批量更新LockInfo字段为完整
* @param list
* @param details
* @param assortList
*/
private void checkSuccess(List<Archive_Master_Vo> list, List<Archive_Detail> details, List<Zd_Assort> assortList) {
//循环遍历list集合判断是否完整完整isCheck赋值1且批量更新LockInfo字段为完整
//定义通过完整性校验的masterIds
StringBuilder masterIds = new StringBuilder();
for(Archive_Master_Vo master : list){
//定义匹配分类成功次数
int successCount = 0;
for(Zd_Assort assortFor : assortList){
//定义无匹配的分类
boolean flag = false;
for(Archive_Detail detail : details){
//判断主键相同且分类id相同
if(master.getId().equals(detail.getMasterid()) && assortFor.getAssortId().equals(detail.getAssortid())){
successCount++;
flag = true;
break;
}
}
//该分类无匹配直接跳出循环,改主键不完整
if(!flag){
break;
}
}
//如果成功匹配个数和需校验分类个数相等,全部匹配
if(successCount == assortList.size()){
//list的isSuccess字段值赋值1
master.setIsSuccess(1);
//不完整的批量更新为完整
if(!"完整".equals(master.getLockinfo())) {
if (StringUtils.isBlank(masterIds)) {
masterIds.append("'").append(master.getId()).append("'");
} else {
masterIds.append(",'").append(master.getId()).append("'");
}
}
}
}
//不完整的批量批量更新master表的LockInfo字段为完整
if(StringUtils.isNotBlank(masterIds)){
archiveMasterMapper.updateLockInfoByMasterId(masterIds.toString(),"完整");
}
}
/**
* masterIdsdetail
* @param list
* @return
*/
private List<Archive_Detail> getArchiveDetailsByMasterIds(List<Archive_Master_Vo> list) {
StringBuilder masterIds = new StringBuilder();
for (int i = 0; i < list.size(); i++) {
if(i == 0){
masterIds.append("'").append(list.get(i).getId()).append("'");
}else{
masterIds.append(",'").append(list.get(i).getId()).append("'");
}
}
//根据id集合查detail明细表分组分类集合
return detailMapper.selectAssortIdsByMasterIds(masterIds.toString());
}
/**
*
* */
@ -443,12 +533,10 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
public int updateReturn(Emr_Fault_Detail_Vo emrFaultDetail) throws Exception{
//修改病案归档状态:复审退回
Archive_Master archiveMaster = new Archive_Master();
archiveMaster.setId(emrFaultDetail.getArchiveDetailId());
// 从session获取用户名
String username = (String) SecurityUtils.getSubject().getSession().getAttribute("userSession");//获取前面登录的用户名
//设置回退给角色信息
String returntoRole = emrFaultDetail.getReturntoRole();
archiveMaster.setReturntoRole(returntoRole);
log.info(username+"将病案:"+emrFaultDetail.getArchiveDetailId()+"退回给"+returntoRole);
if(StringUtils.isNotBlank(emrFaultDetail.getStatus())) {
int status = Integer.valueOf(emrFaultDetail.getStatus());
@ -467,9 +555,7 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
}
//定义退回内容
String remark = emrFaultDetail.getBackContent();
Integer backToCode = 0;
//流转记录的最新id
Integer flowInfoId = 0;
List<Integer> backToCodeList = new ArrayList<>();
//参数输入
SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String nowTime = format1.format(new Date());
@ -479,41 +565,38 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
switch (returntoRole) {
//退回给医生
case "DOCTOR":
//获取当前状态码
status = EnumVerify.DocState.backToDoctor(Integer.valueOf(emrFaultDetail.getStatus()),archiveFlowRoles);
//添加进流转记录
backToCode = EnumVerify.DocState.DortorBack.getCode();
flowInfoId = flowInfoService.insertFlowInfo(masterId,targetCode,remark,backToCode,new Date());
emrFaultDetail.setParentId(flowInfoId);
//添加缺陷记录
emrFaultDetailService.insertSel(emrFaultDetail);
//退回的状态码
backToCodeList.add(EnumVerify.DocState.DortorBack.getCode());
break;
//退回给护士
case "NURSE":
backToCode = EnumVerify.DocState.NurseBack.getCode();
status = EnumVerify.DocState.backToNurse(Integer.valueOf(emrFaultDetail.getStatus()),archiveFlowRoles);
//添加进流转记录
flowInfoId = flowInfoService.insertFlowInfo(masterId,targetCode,remark,backToCode,new Date());
emrFaultDetail.setParentId(flowInfoId);
//添加缺陷记录
emrFaultDetailService.insertSel(emrFaultDetail);
backToCodeList.add(EnumVerify.DocState.NurseBack.getCode());
break;
//退回给医生和护士
case "ALL":
status = EnumVerify.DocState.backToAll();
backToCode = EnumVerify.DocState.DortorBack.getCode();
flowInfoId = flowInfoService.insertFlowInfo(masterId,targetCode,remark,backToCode,new Date());
emrFaultDetail.setParentId(flowInfoId);
//添加缺陷记录
emrFaultDetailService.insertSel(emrFaultDetail);
backToCode = EnumVerify.DocState.NurseBack.getCode();
flowInfoId = flowInfoService.insertFlowInfo(masterId,targetCode,remark,backToCode,new Date());
emrFaultDetail.setParentId(flowInfoId);
//添加缺陷记录
emrFaultDetailService.insertSel(emrFaultDetail);
backToCodeList.add(EnumVerify.DocState.DortorBack.getCode());
backToCodeList.add(EnumVerify.DocState.NurseBack.getCode());
break;
default:;
}
//循环添加进流转记录和缺陷记录
for(Integer backToCode : backToCodeList){
//获取当前节点和下个节点对象集合
List<ArchiveFlowRole> currentRoleAndNextRole = flowInfoService.getCurrentRoleAndNextRole(targetCode, backToCode);
//添加进流转记录
Integer flowInfoId = flowInfoService.insertFlowInfo(masterId,remark,currentRoleAndNextRole.get(0),currentRoleAndNextRole.get(1),new Date());
emrFaultDetail.setParentId(flowInfoId);
//添加缺陷记录
emrFaultDetailService.insertSel(emrFaultDetail);
}
archiveMaster.setArchivestate(status + "");
}
archiveMaster.setId(emrFaultDetail.getArchiveDetailId());
archiveMaster.setReturntoRole(returntoRole);
//设置回退操作人信息
archiveMaster.setReturnOperUsername(username);
updateByClo(archiveMaster);
@ -592,8 +675,10 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
BeanUtils.copyProperties(master,archiveMaster);
//更新
updateByClo(archiveMaster);
//获取当前节点和下个节点对象集合
List<ArchiveFlowRole> currentRoleAndNextRole = flowInfoService.getCurrentRoleAndNextRole(master.getStatus()+"", null);
//添加进流转记录
flowInfoService.insertFlowInfo(master.getId(),master.getStatus()+"",master.getRemark(),null,new Date());
flowInfoService.insertFlowInfo(master.getId(),master.getRemark(),currentRoleAndNextRole.get(0),new ArchiveFlowRole(),new Date());
return Msg.success();
} else {
return Msg.fail("初始状态出错了!");
@ -609,32 +694,41 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
// 从session获取用户名
String username = (String) SecurityUtils.getSubject().getSession().getAttribute("userSession");//获取前面登录的用户名
SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//修改病案归档状态
Archive_Master archiveMaster = new Archive_Master();
//拷贝对象
BeanUtils.copyProperties(master,archiveMaster);
//定义提交时间
//设置审核时间
Date sumbitDate = new Date();
if(StringUtils.isBlank(master.getCheckedDatetime())){
//未手动修改终审时间,使用当前时间
archiveMaster.setCheckedDatetime(format1.format(new Date()));
}else{
//手动修改终审时间,是否修改的时间
archiveMaster.setCheckedDatetime(master.getCheckedDatetime());
sumbitDate = format1.parse(master.getCheckedDatetime());
String ids = master.getId();
String[] idList = ids.split(",");
for(String id : idList) {
if(StringUtils.isNotBlank(id)) {
//修改病案归档状态
Archive_Master archiveMaster = new Archive_Master();
master.setId(id);
//拷贝对象
BeanUtils.copyProperties(master, archiveMaster);
//定义提交时间
//设置审核时间
Date sumbitDate = new Date();
if (StringUtils.isBlank(master.getCheckedDatetime())) {
//未手动修改终审时间,使用当前时间
archiveMaster.setCheckedDatetime(format1.format(new Date()));
} else {
//手动修改终审时间,是否修改的时间
archiveMaster.setCheckedDatetime(master.getCheckedDatetime());
sumbitDate = format1.parse(master.getCheckedDatetime());
}
//设置审核人
archiveMaster.setCheckedDoctor(username);
//设为已归档状态
archiveMaster.setArchivestate(EnumVerify.DocState.MedicalRoomCheck.getCode() + "");
//更新
updateByClo(archiveMaster);
//当前节点两种可能病案室审核和已召回
//是已召回将当前节点code置为病案室审核
String currentStatus = EnumVerify.DocState.MedicalRoomCheck.getCode() + "";
//获取当前节点和下个节点对象集合
List<ArchiveFlowRole> currentRoleAndNextRole = flowInfoService.getCurrentRoleAndNextRole(currentStatus, EnumVerify.DocState.MedicalRoomCheck.getCode());
//添加流转节点
flowInfoService.insertFlowInfo(master.getId(), master.getRemark(), currentRoleAndNextRole.get(0), currentRoleAndNextRole.get(1), sumbitDate);
}
}
//设置审核人
archiveMaster.setCheckedDoctor(username);
//设为已归档状态
archiveMaster.setArchivestate(EnumVerify.DocState.MedicalRoomCheck.getCode()+"");
//更新
updateByClo(archiveMaster);
//当前节点两种可能病案室审核和已召回
//是已召回将当前节点code置为病案室审核
String currentStatus = EnumVerify.DocState.MedicalRoomCheck.getCode() + "";
//添加流转节点
flowInfoService.insertFlowInfo(master.getId(),currentStatus,master.getRemark(),EnumVerify.DocState.MedicalRoomCheck.getCode(),sumbitDate);
/*//masterId;
flowInfo.setMasterId(master.getId());
//stepIndex:当前步骤

@ -1,6 +1,7 @@
package com.emr.service.ipml;
import com.alibaba.fastjson.JSON;
import com.emr.dao.RecordStatisticsMapper;
import com.emr.dao.StatisticsMapper;
import com.emr.dao.TUuInfoMapper;
import com.emr.dao.TUuPrintMapper;
@ -52,6 +53,8 @@ public class StatisticsService {
private TUuPrintMapper uuPrintMapper;
@Autowired
private TUuInfoMapper uuInfoMapper;
@Autowired
private RecordStatisticsMapper recordStatisticsMapper;
//终审按天统计
public List<FinalAndFirstStatistics> getFinalStatistics(Integer offset, Integer limit, String startDate, String endDate,String sql) throws Exception{
if(null != offset && null != limit){
@ -200,5 +203,144 @@ public class StatisticsService {
}
return userList;
}
/**
*
* @param recordStatistics
* @return
*/
public List<RecordStatistics> getRecordStatistics(RecordStatistics recordStatistics) {
List<RecordStatistics> list = new Page<>();
RecordStatistics record = new RecordStatistics();
//设置总病历数
int recordCount = recordStatisticsMapper.getRecordCount(recordStatistics);
record.setAllRecordCount(recordCount);
List<RecordStatistics> fileCountList = null;
if(recordCount != 0) {
//查询总文件数
fileCountList = recordStatisticsMapper.getFileCount(recordStatistics);
}
//计算总文件数,总自动采集文件数,扫描上传文件数
setFileCounts(record, fileCountList,null,null);
//计算总页数,自动采集总页数,扫描上传总页数
setPageCounts(record);
list.add(record);
return list;
}
//计算总页数,自动采集总页数,扫描上传总页数
private void setPageCounts(RecordStatistics record) {
//TODO 设置总页数
record.setAllPageCount(null);
//TODO 设置自动采集总页数
record.setAutoCollectionPageCount(null);
//TODO 设置扫描上传总页数
record.setManualScanPageCount(null);
}
//计算总文件数,总自动采集文件数,扫描上传文件数
private void setFileCounts(RecordStatistics record, List<RecordStatistics> fileCountList,String param,String paramFlag) {
int allFileCount = 0;
int autoFileCount = 0;
int scanFileCount = 0;
if(!CollectionUtils.isEmpty(fileCountList) && (record.getAllRecordCount() == null || record.getAllRecordCount() != 0)){
for(RecordStatistics recordTemp : fileCountList){
//定义是否匹配标识
boolean flag = false;
if("deptName".equals(paramFlag)){
flag = recordTemp.getDeptName().equals(param);
}else if("masterId".equals(paramFlag)){
flag = recordTemp.getMasterId().equals(param);
}
//匹配上或不需匹配时才参与计算
if(flag || StringUtils.isBlank(paramFlag)) {
Integer fileCount = recordTemp.getAllFileCount();
//计算总文件数
allFileCount += fileCount;
String source = recordTemp.getSource();
if (StringUtils.isNotBlank(source) && "扫描上传".equals(source)) {
//计算扫描上传的文件数
scanFileCount += fileCount;
} else {
//计算自动采集的文件数
autoFileCount += fileCount;
}
}
}
}
//设置总文件数
record.setAllFileCount(allFileCount);
//设置自动采集总文件数
record.setAutoCollectionFileCount(autoFileCount);
//设置扫描上传总文件数
record.setManualScanFileCount(scanFileCount);
}
/**
*
* @param offset
* @param limit
* @param recordStatistics
* @return
*/
public List<RecordStatistics> getRecordStatisticsGroupDept(Integer offset,Integer limit,RecordStatistics recordStatistics) {
if(null != offset && null != limit){
PageHelper.offsetPage(offset, limit);
}
//按科室分组统计病案数
List<RecordStatistics> list = recordStatisticsMapper.getRecordStatisticsGroupDept(recordStatistics);
//按科室code匹配计算总文件数、自动采集文件数和扫描上传文件数
if(!CollectionUtils.isEmpty(list)){
//按科室和文件来源统计文件数
List<RecordStatistics> fileList = recordStatisticsMapper.getFileStatisticsGroupDept(recordStatistics);
for(RecordStatistics record : list){
//获取科室code
String deptName = record.getDeptName();
//计算总文件数,总自动采集文件数,扫描上传文件数
setFileCounts(record, fileList,deptName,"deptName");
//计算总页数,自动采集总页数,扫描上传总页数
setPageCounts(record);
}
}
return list;
}
/**
*
* @param offset
* @param limit
* @param recordStatistics
* @return
*/
public List<RecordStatistics> getRecordStatisticsByDeptName(Integer offset, Integer limit, RecordStatistics recordStatistics) {
if(null != offset && null != limit){
PageHelper.offsetPage(offset, limit);
}
//根据科室查询基本信息
List<RecordStatistics> list = recordStatisticsMapper.getRecordStatisticsByDeptName(recordStatistics);
//获取分页查询后的masterId集合
if(!CollectionUtils.isEmpty(list)){
//定义masterId集合
StringBuilder masterIds = new StringBuilder();
for (int i = 0; i < list.size(); i++) {
String masterId = list.get(i).getMasterId();
if(i == 0){
masterIds.append("'").append(masterId).append("'");
}else{
masterIds.append(",'").append(masterId).append("'");
}
}
//根据masterIds集合查询文件数集合
List<RecordStatistics> fileCountList = recordStatisticsMapper.getFileCountByMasterIds(masterIds.toString());
for(RecordStatistics record : list){
String masterId = record.getMasterId();
//计算总文件数,总自动采集文件数,扫描上传文件数
setFileCounts(record, fileCountList,masterId,"masterId");
//计算总页数,自动采集总页数,扫描上传总页数
setPageCounts(record);
}
}
return list;
}
}

@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import java.util.List;
import java.util.Set;
/**
* @author HJL

@ -0,0 +1,37 @@
package com.emr.vo;
import lombok.Data;
/**
* @ProjectName:
* @Description:
* @Param
* @Return
* @Author:
* @CreateDate: 2020/8/7 10:29
* @UpdateUser:
* @UpdateDate: 2020/8/7 10:29
* @UpdateRemark:
* @Version: 1.0
*/
@Data
public class RecordStatistics {
private String inpNo;//住院号
private String visitId;//住院次数
private String name;//患者姓名
private String deptName;//出院科室
private String dischargeDateTime;//出院日期
private Integer allRecordCount; //总病历数
private Integer allFileCount;//总文件数
private Integer allPageCount;//总页数
private Integer autoCollectionFileCount;//自动采集总文件数
private Integer autoCollectionPageCount;//自动采集总页数
private Integer manualScanFileCount;//扫描上传总文件数
private Integer manualScanPageCount;//扫描上传总页数
private String startDate;//出院开始日期
private String endDate;//出院结束日期
private String deptNameCn;//出院科室转换中文
private String source;//文件来源
private String masterId;//病案主键
private Integer timeInterval;//出院时段
}

@ -65,7 +65,7 @@
and t.MasterID=#{patientId,jdbcType=VARCHAR}
</if>
<if test="assortId != null and assortId != ''">
and t.AssortID=#{assortId,jdbcType=VARCHAR}
and t.AssortID IN (${assortId})
</if>
<if test="assortName != null and assortName != ''">
and t.AssortID in (${assortName})
@ -317,4 +317,21 @@
where MasterID = #{masterId} and id in (${detailIds}) and flag != 1
order by zd_assort.assort_sort,archive_detail.UpLoadDateTime
</select>
<!--按查询按masterId分组查询assortId分类且需要完整性校验的集合-->
<select id="selectAssortIdsByMasterIds" resultMap="BaseResultMap" parameterType="java.lang.String">
SELECT
AssortID,
MasterID
FROM
archive_detail
INNER JOIN
zd_assort
ON
archive_detail.AssortID = zd_assort.assort_id AND zd_assort.is_check = 1
WHERE
MasterID IN (${masterIds})
GROUP BY
AssortID,
MasterID
</select>
</mapper>

@ -919,4 +919,9 @@
</if>
</where>
</select>
<!--批量masterIds集合更新LockInfo字段-->
<update id="updateLockInfoByMasterId">
UPDATE archive_master SET LockInfo = #{lockinfo}
WHERE id IN (${masterIds})
</update>
</mapper>

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.emr.dao.RecordStatisticsMapper">
<resultMap id="BaseResultMap" type="com.emr.vo.RecordStatistics">
</resultMap>
<!--公共查询方法-->
<sql id="commomSearch">
<if test="deptName != null and deptName != ''">
AND archive_master.dept_name IN
<foreach item="item" collection="deptName.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<choose>
<when test="startDate != null and startDate != '' and endDate != null and endDate != ''">
AND archive_master.discharge_date_time between CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120) and
#{endDate,jdbcType=NCHAR}+ ' 23:59:59'
</when>
<when test="startDate != null and startDate != ''">
AND archive_master.discharge_date_time >= CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120)
</when>
<when test="endDate != null and endDate != ''">
AND archive_master.discharge_date_time &lt;= #{endDate,jdbcType=NCHAR}+ ' 23:59:59'
</when>
</choose>
<if test="inpNo != null and inpNo != ''">
AND archive_master.inp_no like '%'+#{inpNo,jdbcType=NCHAR}+'%'
</if>
<if test="name != null and name != ''">
and archive_master.name like '%'+#{name,jdbcType=NCHAR}+'%'
</if>
</sql>
<!--总病历数-->
<select id="getRecordCount" resultType="java.lang.Integer" parameterType="com.emr.vo.RecordStatistics">
SELECT COUNT(archive_master.id) allRecordCount FROM archive_master
<where>
<include refid="commomSearch"/>
</where>
</select>
<!--总文件数-->
<select id="getFileCount" resultMap="BaseResultMap" parameterType="com.emr.vo.RecordStatistics">
SELECT COUNT(archive_detail.id) allFileCount,Source source FROM archive_detail
<if test="(deptName != null and deptName != '')
or (startDate != null and startDate != '' and endDate != null and endDate != '')
or (inpNo != null and inpNo != '')
or (name != null and name != '')">
INNER JOIN archive_master
ON archive_detail.MasterID = archive_master.id
</if>
WHERE flag = 0
<include refid="commomSearch"/>
GROUP BY source
</select>
<!--按科室分组统计病案数-->
<select id="getRecordStatisticsGroupDept" resultMap="BaseResultMap">
SELECT
emr_dictionary.CODE deptName,
emr_dictionary.NAME deptNameCn,
COUNT( dept_name ) allRecordCount
FROM
archive_master
INNER JOIN emr_dictionary ON archive_master.dept_name = emr_dictionary.CODE
AND emr_dictionary.parent_id = 'dept_code'
AND emr_dictionary.effective = 1
<where>
<include refid="commomSearch"/>
</where>
GROUP BY
emr_dictionary.NAME,
emr_dictionary.CODE
ORDER BY
emr_dictionary.CODE
</select>
<!--按科室分组统计文件数-->
<select id="getFileStatisticsGroupDept" resultMap="BaseResultMap">
SELECT
dept_name deptName,
COUNT( archive_detail.id ) allFileCount,
archive_detail.Source source
FROM
archive_master
INNER JOIN archive_detail ON archive_master.id = archive_detail.MasterID
AND flag = 0
<where>
<include refid="commomSearch"/>
</where>
GROUP BY
dept_name,
Source
</select>
<select id="getRecordStatisticsByDeptName" resultMap="BaseResultMap">
SELECT
archive_master.id masterId,
emr_dictionary.NAME deptNameCn,
inp_no,
archive_master.NAME,
visit_id,
discharge_date_time
FROM
archive_master
INNER JOIN emr_dictionary ON archive_master.dept_name = emr_dictionary.CODE
AND emr_dictionary.parent_id = 'dept_code'
AND effective = 1
<where>
<include refid="commomSearch"/>
</where>
ORDER BY discharge_date_time DESC
</select>
<select id="getFileCountByMasterIds" resultMap="BaseResultMap">
SELECT
MasterID masterId,
COUNT( id ) allFileCount,
Source
FROM
archive_detail
WHERE
MasterID IN (${masterIds})
AND flag = 0
GROUP BY
MasterID,
Source
</select>
</mapper>

@ -6,6 +6,7 @@
<result column="assort_name" property="assortName" jdbcType="VARCHAR" />
<result column="assort_sort" property="assortSort" jdbcType="SMALLINT" />
<result column="print_flag" property="printFlag" jdbcType="VARCHAR" />
<result column="is_check" property="isCheck" jdbcType="INTEGER" />
</resultMap>
<!--查询全部-->
<select id="selectAll" resultMap="BaseResultMap">
@ -20,6 +21,9 @@
<if test="record.printFlag != '' and record.printFlag != null">
AND print_flag = ${record.printFlag}
</if>
<if test="record.isCheck != null">
AND is_check = 1
</if>
</where>
ORDER BY
assort_sort

@ -1,5 +1,6 @@
<%@ page import="java.util.Date" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
@ -28,7 +29,8 @@
<script type="text/javascript" src="${path}/static/js/jquery-3.3.1.js"></script>
<script type="text/javascript" src="${path}/static/bootstrap-3.3.7/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script type="text/javascript" src="${path}/static/js/comm.js"></script>
<!-- jQuery UI 1.11.4 -->
<script type="text/javascript" src="${path}/static/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="${path}/static/bootstrap-3.3.7/bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.js"></script>
<script type="text/javascript" src="${path}/static/bootstrap-3.3.7/bower_components/bootstrap-datepicker/dist/locales/bootstrap-datepicker.zh-CN.min.js"></script>
<script type="text/javascript" src="${path}/static/bootstrap-3.3.7/bower_components/bootstrap-table/bootstrap-table.js"></script>
@ -54,62 +56,4 @@
<script src="${path}/static/bootstrap-3.3.7/bower_components/bootstrap/dist/js/fileinput.min.js"></script>
<script type="text/javascript" src="${path}/static/js/hospitalCommom/pinying.js"></script>
<script>
/**
* 判断出院日期是否是1801-02-03
* */
function operDisDate(value){
if(value != ''){
if(value.length >= 10){
value = value.substring(0, 10);
}
if(value == '1801-02-03'){
return '';
}
}
return value;
}
/**
* 判断出院时间是否是1801-02-03
* */
function operDisTime(value){
if(value != '' && value != null){
if (value.length >= 10 && '1801-02-03' == value.substring(0, 10)) {
value = '';
}
if(value.length >= 19){
return value.substring(0, 19);
}else{
return value;
}
}
}
//封装改变日期方法
function initDateInput(startTimeId,endTimeId){
$('#'+startTimeId).datepicker({
language: "zh-CN",
format: "yyyy-mm-dd",
autoclose: true//选中之后自动隐藏日期选择框
}).on('changeDate',function(){
$("#beginTime-error").hide();
var startTime= $("#"+startTimeId).val();
$("#"+endTimeId).datepicker('setStartDate',startTime);
$("#"+startTimeId).datepicker('hide');
});
$('#'+endTimeId).datepicker({
language: "zh-CN",
format: "yyyy-mm-dd",
autoclose: true//选中之后自动隐藏日期选择框
}).on('changeDate',function(){
var startTime = $("#"+startTimeId).val();
var endtime = $("#"+endTimeId).val();
$("#"+startTimeId).datepicker('setEndDate',endtime);
$("#"+endTimeId).datepicker('hide');
});
}
//获取table的高度
function getHeight(height) {
return $(window).height() - height;
}
</script>
<script type="text/javascript" src="${path}/static/js/comm.js"></script>

@ -196,8 +196,7 @@
</div>
<div class="form-group divCss8" id="deptDiv" style="height: 18px;margin-top: -7px;">
<label>出院科室:</label>
<select class="selectpicker bla bla bli" multiple data-live-search="true" name="deptName" id="deptName"
title="请输入科室">
<select class="selectpicker bla bla bli" multiple data-live-search="true" name="deptName" id="deptName" title="请输入科室">
<option value="">全部</option>
</select>
</div>
@ -211,11 +210,7 @@
</div>
<div class="form-group divCss">
<label>出院时段:</label>
<select class="form-control input-sm" onchange="loadTableByTime(this.options[this.options.selectedIndex].value)">
<option value="">不限</option>
<option value="1">3天内</option>
<option value="2">1个月内</option>
<option value="3">6个月内</option>
<select class="form-control input-sm" id="timeInterval" onchange="loadTableByTime(this.options[this.options.selectedIndex].value,'startDateTo','endDateTo','table')">
</select>
</div>
<div class="form-group divCss">
@ -228,6 +223,7 @@
</div>
<button type="button" class="btn btn-primary btn-sm divCss" id="searchBtn">查询</button>
<button type="button" class="btn btn-info btn-sm divCss" id="excelBtn">条件导出</button>
<button type="button" class="btn btn-primary btn-sm divCss" id="approvesBtn">批量审核</button>
</div>
</form>
<!--数据表格-->
@ -579,6 +575,7 @@
<input id="roleCode" type="hidden"/>
<input id="archivestate" type="hidden"/>
<input id="role" type="hidden"/>
<input id="approveCount" type="hidden"/>
<span style="vertical-align:top;">内容:</span><textarea rows="6" cols="70" id="verifyText"
maxlength="255"></textarea>
</div>
@ -616,6 +613,26 @@
</div>
</div>
</div>
<%--审核确认弹窗--%>
<div class="modal fade verifyModal" id="sureModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content ">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title">确认是否批量审批本次选中病历</h4>
</div>
<div class="modal-body">
<table id="table3" class="table text-nowrap table-striped"></table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default btn-sm" data-dismiss="modal">返回</button>
<button type="button" class="btn btn-primary btn-sm" id="sureBtn">确认通过</button>
</div>
</div>
</div>
</div>
<%--查看流程弹窗--%>
<div class="modal fade" id="showFlowInfo" role="dialog" aria-labelledby="exampleModalLabel">
<div class="modal-dialog" role="document">

@ -78,11 +78,7 @@
</div>
<div class="form-group divCss">
<label>出院时段:</label>
<select class="form-control input-sm" onchange="loadTableByTime(this.options[this.options.selectedIndex].value)">
<option value="">不限</option>
<option value="1">3天内</option>
<option value="2">1个月内</option>
<option value="3">6个月内</option>
<select class="form-control input-sm" id="timeInterval" onchange="loadTableByTime(this.options[this.options.selectedIndex].value,'startDateTo','endDateTo','table')">
</select>
</div>
<div class="form-group divCss8" id="deptDiv" style="height: 18px;margin-top: -7px;">

@ -77,11 +77,7 @@
</div>
<div class="form-group divCss">
<label>出院时段:</label>
<select class="form-control input-sm" onchange="loadTableByTime(2,this.options[this.options.selectedIndex].value)">
<option value="">不限</option>
<option value="1">3天内</option>
<option value="2">1个月内</option>
<option value="3">6个月内</option>
<select class="form-control input-sm" id="timeInterval" onchange="loadTableByTime(this.options[this.options.selectedIndex].value,'startTime2','endTime2','table')">
</select>
</div>
<div class="form-group divCss8">

@ -181,11 +181,7 @@
</div>
<div class="form-group divCss">
<label>入院时段:</label>
<select class="form-control input-sm" onchange="loadTableByTime(this.options[this.options.selectedIndex].value)">
<option value="">不限</option>
<option value="1">3天内</option>
<option value="2">1个月内</option>
<option value="3">6个月内</option>
<select class="form-control input-sm" id="timeInterval" onchange="loadTableByTime(this.options[this.options.selectedIndex].value,'startDateTo','endDateTo','table')">
</select>
</div>
<button type="button" class="btn btn-primary btn-sm divCss" id="searchBtn">查询</button>

@ -144,9 +144,9 @@
width: 100%;
}
#verifyModal .modal-content {
margin-left: 50%;
margin-top: 35%;
.verifyModal .modal-content {
margin-left:35%;
margin-top: 10%;
width: 100%;
}
@ -213,15 +213,12 @@
</div>
<div class="form-group divCss">
<label>出院时段:</label>
<select class="form-control input-sm" onchange="loadTableByTime(this.options[this.options.selectedIndex].value)">
<option value="">不限</option>
<option value="1">3天内</option>
<option value="2">1个月内</option>
<option value="3">6个月内</option>
<select class="form-control input-sm" id="timeInterval" onchange="loadTableByTime(this.options[this.options.selectedIndex].value,'startDateTo','endDateTo','table')">
</select>
</div>
<button type="button" class="btn btn-primary btn-sm divCss" id="searchBtn">查询</button>
<button type="button" class="btn btn-info btn-sm divCss" id="excelBtn">条件导出</button>
<button type="button" class="btn btn-primary btn-sm divCss" id="approvesBtn">批量审核</button>
</div>
</form>
<!--数据表格-->
@ -568,7 +565,7 @@
</div>
</div>
<%--审核弹窗--%>
<div class="modal fade" id="verifyModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
<div class="modal fade verifyModal" id="verifyModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content ">
<div class="modal-header">
@ -582,8 +579,12 @@
<input type="hidden" id="checkDatetime">
<input type="hidden" name="formToken" id="formToken">
<div class="form-group ">
<!--masterId-->
<input id="archiveId" hidden/>
<!--当前状态码-->
<input id="status1" type="hidden"/>
<!--审批个数-->
<input id="approveCount" type="hidden"/>
<span style="vertical-align:top;">内容:</span><textarea rows="6" cols="70"
id="verifyText"
maxlength="255"></textarea>
@ -604,6 +605,26 @@
</div>
</div>
</div>
<%--审核确认弹窗--%>
<div class="modal fade verifyModal" id="sureModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content ">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title">确认是否批量审批本次选中病历</h4>
</div>
<div class="modal-body">
<table id="table3" class="table text-nowrap table-striped"></table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default btn-sm" data-dismiss="modal">返回</button>
<button type="button" class="btn btn-primary btn-sm" id="sureBtn">确认通过</button>
</div>
</div>
</div>
</div>
<%--查看流程弹窗--%>
<div class="modal fade" id="showFlowInfo" role="dialog" aria-labelledby="exampleModalLabel">
<div class="modal-dialog" role="document">

@ -59,11 +59,7 @@
</div>
<div class="form-group divCss">
<label>终审时段:</label>
<select class="form-control input-sm" onchange="loadTableByTime(1,this.options[this.options.selectedIndex].value)">
<option value="">不限</option>
<option value="1">3天内</option>
<option value="2">1个月内</option>
<option value="3">6个月内</option>
<select class="form-control input-sm" id="timeInterval" onchange="loadTableByTime(this.options[this.options.selectedIndex].value,'startTime1','endTime1','table')">
</select>
</div>
<button type="button" class="btn btn-primary btn-sm divCss" id="searchBtn">查询</button>

@ -74,11 +74,7 @@
</div>
<div class="form-group divCss">
<label>出院时段:</label>
<select class="form-control input-sm" onchange="loadTableByTime(2,this.options[this.options.selectedIndex].value)">
<option value="">不限</option>
<option value="1">3天内</option>
<option value="2">1个月内</option>
<option value="3">6个月内</option>
<select class="form-control input-sm" id="timeInterval" onchange="loadTableByTime(this.options[this.options.selectedIndex].value,'startTime2','endTime2','table')">
</select>
</div>
<div class="form-group divCss8">

@ -45,11 +45,7 @@
</div>
<div class="form-group divCss">
<label>审核时段:</label>
<select class="form-control input-sm" onchange="loadTableByTime(1,this.options[this.options.selectedIndex].value)">
<option value="">不限</option>
<option value="1">3天内</option>
<option value="2">1个月内</option>
<option value="3">6个月内</option>
<select class="form-control input-sm" id="timeInterval" onchange="loadTableByTime(this.options[this.options.selectedIndex].value,'startTime1','endTime1','table')">
</select>
</div>
<button type="button" class="btn btn-primary btn-sm divCss" id="searchBtn">查询</button>

@ -45,11 +45,7 @@
</div>
<div class="form-group divCss">
<label>复印时段:</label>
<select class="form-control input-sm" onchange="loadTableByTime(1,this.options[this.options.selectedIndex].value)">
<option value="">不限</option>
<option value="1">3天内</option>
<option value="2">1个月内</option>
<option value="3">6个月内</option>
<select class="form-control input-sm" id="timeInterval" onchange="loadTableByTime(this.options[this.options.selectedIndex].value,'startTime1','endTime1','table')">
</select>
</div>
<div class="form-group divCss8">

@ -45,11 +45,7 @@
</div>
<div class="form-group divCss">
<label>复印时段:</label>
<select class="form-control input-sm" onchange="loadTableByTime(1,this.options[this.options.selectedIndex].value)">
<option value="">不限</option>
<option value="1">3天内</option>
<option value="2">1个月内</option>
<option value="3">6个月内</option>
<select class="form-control input-sm" id="timeInterval" onchange="loadTableByTime(this.options[this.options.selectedIndex].value,'startTime1','endTime1','table')">
</select>
</div>
<div class="form-group divCss8">

@ -0,0 +1,124 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set value="${pageContext.request.contextPath}" var="path" scope="page"/>
<html>
<head>
<title>病案统计报表</title>
<meta charset="utf-8">
<!-- 解决部分兼容性问题如果安装了GCF则使用GCF来渲染页面如果未安装GCF则使用最高版本的IE内核进行渲染。 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!-- 页面按原比例显示 -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<%@include file="../../jspf/comm.jspf" %>
<link rel="shortcut icon" href="${path}/favicon.ico">
<style>
/* .divCss {
margin-top: 5px;
}*/
.divCss8 {
margin-top: 5px;
margin-right: 20px;
}
/* dataTables表头居中 */
/*.table > thead:first-child > tr:first-child > th {
text-align: center !important;
}*/
/**
*多选下拉框
*/
.bootstrap-select:not([class*=col-]):not([class*=form-control]):not(.input-group-btn){
width: 168px!important;
}
#tableDiv{
margin-top: 10px;
}
</style>
<script>
var path = "${path}";
</script>
</head>
<body>
<!--隐藏是否是初始化-->
<input type="hidden" id="isSearch" value="1">
<!--定义加载的层级数-->
<input type="hidden" id="level" value="${level}">
<!--初始化加载科室选中-->
<input type="hidden" id="searchDeptName" value="${record.deptName}">
<!--第三层初始化按科室查-->
<input type="hidden" id="searchDeptNameTemp">
<input type="hidden" id="timeIntervalTemp" value="${record.timeInterval}">
<div class="mainDiv">
<!--搜索-->
<form style="margin-top:5px;margin-bottom: 0!important;height: 75px">
<div class="form-inline">
<div class="form-group divCss8">
<label>出院日期:</label>
<div class="input-group">
<input type="text" class="input-sm form-control" id="startTime1" style="text-align: center" maxlength="10" autocomplete="off" value="${record.startDate}"/>
<span class="input-group-addon">-</span>
<input type="text" class="input-sm form-control" id="endTime1" style="text-align: center" maxlength="10" autocomplete="off" value="${record.endDate}"/>
</div>
</div>
<div class="form-group divCss">
<label>出院时段:</label>
<c:choose>
<c:when test="${level == '1'}">
<select class="form-control input-sm" id="timeInterval" onchange="loadTableByTime(this.options[this.options.selectedIndex].value,'startTime1','endTime1','table')">
</select>
</c:when>
<c:when test="${level == '2'}">
<select class="form-control input-sm" id="timeInterval" onchange="loadTableByTime(this.options[this.options.selectedIndex].value,'startTime1','endTime1','table1')">
</select>
</c:when>
<c:when test="${level == '3'}">
<select class="form-control input-sm" id="timeInterval" onchange="loadTableByTime(this.options[this.options.selectedIndex].value,'startTime1','endTime1','table2')">
</select>
</c:when>
</c:choose>
</select>
</div>
<div class="form-group divCss8">
<label >出院科室:</label>
<select class="selectpicker bla bla bli" multiple data-live-search="true" name="deptName"
id="deptName"
title="请输入出院科室">
<option value="">全部</option>
</select>
</div>
<div class="form-group divCss8">
<label>患者姓名:</label>
<input type="text" class="form-control input-sm" id="name" maxlength="8" value="${record.name}">
</div>
<div class="form-group divCss8">
<label>&emsp;住院号:</label>
<input type="text" class="form-control input-sm" id="inpNo" maxlength="25" value="${record.inpNo}">
</div>
<div class="form-group divCss8">
<button type="button" class="btn btn-primary btn-sm divCss" id="searchBtnStatistics">查询</button>
<button type="button" class="btn btn-info btn-sm divCss" id="excelBtn">条件导出</button>
</div>
</div>
</form>
<!--数据表格-->
<c:if test="${level == '1'}">
<div id="tableDiv">
<table id="table" class="table text-nowrap table-bordered"></table>
</div>
</c:if>
<c:if test="${level == '2'}">
<div id="tableDiv">
<table id="table1" class="table text-nowrap table-bordered"></table>
</div>
</c:if>
<c:if test="${level == '3'}">
<div id="tableDiv">
<table id="table2" class="table text-nowrap table-bordered"></table>
</div>
</c:if>
</div>
<script src="${path}/static/js/statistics/getDeptCommom.js"></script>
<script src="${path}/static/js/statistics/statisticsCommom.js?t=2020-07-24"></script>
<script src="${path}/static/js/statistics/recordStatistics.js"></script>
</body>
</html>

@ -45,11 +45,7 @@
</div>
<div class="form-group divCss">
<label>扫描时段:</label>
<select class="form-control input-sm" onchange="loadTableByTime(1,this.options[this.options.selectedIndex].value)">
<option value="">不限</option>
<option value="1">3天内</option>
<option value="2">1个月内</option>
<option value="3">6个月内</option>
<select class="form-control input-sm" id="timeInterval" onchange="loadTableByTime(this.options[this.options.selectedIndex].value,'startTime1','endTime1','table')">
</select>
</div>
<div class="form-group divCss8">

@ -45,11 +45,7 @@
</div>
<div class="form-group divCss">
<label>扫描时段:</label>
<select class="form-control input-sm" onchange="loadTableByTime(1,this.options[this.options.selectedIndex].value)">
<option value="">不限</option>
<option value="1">3天内</option>
<option value="2">1个月内</option>
<option value="3">6个月内</option>
<select class="form-control input-sm" id="timeInterval" onchange="loadTableByTime(this.options[this.options.selectedIndex].value,'startTime1','endTime1','table')">
</select>
</div>
<div class="form-group divCss8">

@ -74,11 +74,7 @@
</div>
<div class="form-group divCss">
<label>出院时段:</label>
<select class="form-control input-sm" onchange="loadTableByTime(2,this.options[this.options.selectedIndex].value)">
<option value="">不限</option>
<option value="1">3天内</option>
<option value="2">1个月内</option>
<option value="3">6个月内</option>
<select class="form-control input-sm" id="timeInterval" onchange="loadTableByTime(this.options[this.options.selectedIndex].value,'startTime2','endTime2','table')">
</select>
</div>
<div class="form-group divCss8">

@ -223,11 +223,7 @@
</div>
<div class="form-group divCss">
<label>出院时段:</label>
<select class="form-control input-sm" onchange="loadTableByTime(this.options[this.options.selectedIndex].value)">
<option value="">不限</option>
<option value="1">3天内</option>
<option value="2">1个月内</option>
<option value="3">6个月内</option>
<select class="form-control input-sm" id="timeInterval" onchange="loadTableByTime(this.options[this.options.selectedIndex].value,'startDateTo','endDateTo','table')">
</select>
</div>
<div class="form-group divCss">

File diff suppressed because one or more lines are too long

@ -1,4 +1,5 @@
var tipLoad = 1;
var selects = '';
//出院列表
function initTable() {
if (tipLoad == 1) {
@ -65,7 +66,6 @@ function initTable() {
visitId: "" + $("#visitId").val(),
name: "" + $("#name").val(),
archivestate: "" + $("#archivestate1").val(),
//deptName: "" + $("#deptName").val(),
startDateTo: $("#startDateTo").val(),
endDateTo: $("#endDateTo").val(),
deptName: deptName.toString(),
@ -136,6 +136,17 @@ function initTable() {
valign: 'middle',
formatter:paramsMatter,
},
{
title: '是否完整',
field: 'isSuccess',
align: 'center',
valign: 'middle',
formatter:function(value, row){
if(value == 0){
return '<span style="color:red">否</span>';
}
}
},
{
title: "操作",
align: 'left',
@ -242,6 +253,83 @@ function initTable() {
});
}
}
//确认批量审批列表
function initTable3() {
$("#table3").bootstrapTable("destroy");
$("#table3").bootstrapTable({ // 对应table标签的id
data: selects, // 获取表格数据的url
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //是否显示行间隔色
pagination: true, // 在表格底部显示分页组件默认false
pageSize:"5",
pageList: [5,10,20,50,100], // 如果设置了分页设置可供选择的页面数据条数。设置为All 则显示所有记录。
undefinedText: '---', //当数据为 undefined 时显示的字符
height: 240, //定义表格的高度。
paginationDetailHAlign: 'left',//指定 分页详细信息 在水平方向的位置。'left' 或 'right'。
columns: [
{
title: '住院号',
field: 'inpNo',
align: 'left',
valign: 'middle',
},
{
title: '住院次数',
field: 'visitId',
align: 'center',
valign: 'middle',
},
{
title: '姓名',
field: 'name',
align: 'left',
valign: 'middle',
},
{
title: '性别',
field: 'sex',
align: 'center',
valign: 'middle',
},
{
title: '出院科室',
field: 'deptName',
align: 'left',
valign: 'middle',
},
{
title: '出院日期',
field: 'dischargeDateTime',
align: 'center',
formatter: function (value, row, index) {
return operDisDate(value);
}
},
{
title: '主管医生',
field: 'doctorInCharge',
align: 'left'
}
],
onLoadSuccess: function (result) { //加载成功时执行
$(".page-list").show();
},
onLoadError: function () { //加载失败时执行
}
});
getTdValue();
}
//
function getTdValue(){
var tableId = document.getElementById("table3");
for(var i = 1;i < tableId.rows.length;i++) {
console.log(tableId.rows[i])
if(tableId.rows[i].cells[x].innerHTML.indexOf("否") != -1 ){
tableId.rows[i].setAttribute("style","background: red;");
}
}
}
//格式化状态
function paramsMatter(value, row) {
var result = '';
@ -257,8 +345,6 @@ function paramsMatter(value, row) {
//审核弹窗
function verifyInfo(role,archivestate,roleCode,masterId){
//生成表单token,防止表单重复提交
setFormToken();
//查询his判断医生护士是否全部提交
var result = 1;
//result = selectHis(row);
@ -282,26 +368,129 @@ function verifyInfo(role,archivestate,roleCode,masterId){
//提交审核
$("#verifyBtn").on('click', function () {
//审核信息保存
var id = $("#archiveId").val();
//归档状态改为初审还是有就是初审内容保存
//判断完整性
var result = checkSuccessMethod(id);
if(result != '完整'){
var approveCount = $("#approveCount").val();
if(approveCount > 1) {
//大于一个弹出确认框
$("#verifyModal").modal('hide');
$("#resultLabel").text("完整性未通过:"+result+",是否强制提交?");
$('#WZModal').modal({
initTable3();
$('#sureModal').modal({
backdrop: 'static',//backdrop 为 static 时,点击模态对话框的外部区域不会将其关闭。
keyboard: false,//keyboard 为 false 时,按下 Esc 键不会关闭 Modal。
show: true//弹出对话框
});
}else {
//审核信息保存
var id = $("#archiveId").val();
//归档状态改为初审还是有就是初审内容保存
//判断完整性
var result = '';
result = checkSuccessMethod(id);
if (result != '完整') {
$("#verifyModal").modal('hide');
$("#resultLabel").text("完整性未通过:" + result + ",是否强制提交?");
$('#WZModal').modal({
backdrop: 'static',//backdrop 为 static 时,点击模态对话框的外部区域不会将其关闭。
keyboard: false,//keyboard 为 false 时,按下 Esc 键不会关闭 Modal。
show: true//弹出对话框
});
} else {
$("#verifyModal").modal('hide');
save();
}
}
});
//批量初审功能
$("#approvesBtn").on('click', function () {
selects = $("#table").bootstrapTable('getSelections');
var count = selects.length;
//定义可提交审核的个数
var approveCount = 0;
//定义不需审核的集合下角标
var unSelects = [];
if(count !== 0){
var ids = '';
var roleCode = '';
var archivestate = '';
for (var i = 0; i < count; i++) {
//需要审批的对象
var power = selects[i].btns;
if(power != '') {
approveCount++;
var roleCodeTemp = power.split("(")[1].split(",")[2];
var status = selects[i].archivestate;
if (i === 0) {
ids += selects[i].id;
roleCode += roleCodeTemp;
archivestate += status;
} else {
ids += "," + selects[i].id;
roleCode += "," + roleCodeTemp;
archivestate += "," + status;
}
}else{
unSelects.push(i);
}
}
if(ids == ''){
toastr.warning("请选中需要审批的记录");
}else{
//从selects中删除不需审核的对象
if(unSelects.length > 0){
for(var i = count - 1;i >= 0;i--){
for(var j = 0;j < unSelects.length;j++){
if(unSelects[j] == i){
selects.splice(i,1);
break;
}
}
}
}
callApproveDiag(ids,roleCode,archivestate,approveCount);
}
}else{
toastr.warning("批量审批请至少选中一个");
}
});
//调用审批diag
function callApproveDiag(ids,roleCode,archivestate,approveCount) {
setFormToken();
$('#verifyModal').modal({
backdrop: 'static',//backdrop 为 static 时,点击模态对话框的外部区域不会将其关闭。
keyboard: false,//keyboard 为 false 时,按下 Esc 键不会关闭 Modal。
show: true//弹出对话框
});
$("#archiveId").val(ids);
$("#roleCode").val(roleCode);
$("#archivestate").val(archivestate);
$("#verifyText").val("");
//审批个数
$("#approveCount").val(approveCount);
}
//终审功能
$("#verifyBtn").on('click', function () {
//审核信息保存
//获取审批个数
var approveCount = $("#approveCount").val();
if(approveCount > 1){
//大于一个弹出确认框
$("#verifyModal").modal('hide');
save();
$('#sureModal').modal({
backdrop: 'static',//backdrop 为 static 时,点击模态对话框的外部区域不会将其关闭。
keyboard: false,//keyboard 为 false 时,按下 Esc 键不会关闭 Modal。
show: true//弹出对话框
});
}else{
//只有一个直接提交
approveMethod();
}
});
//提交审核方法
function save(){
//生成表单token,防止表单重复提交
setFormToken();
var id = $("#archiveId").val();
var roleCode = $("#roleCode").val();
var firstTrial = $("#verifyText").val();

@ -42,6 +42,130 @@ $(document).keyup(function(event){
$("#searchBtn").trigger("click");
}
});
/**
* 判断出院日期是否是1801-02-03
* */
function operDisDate(value){
if(value != ''){
if(value.length >= 10){
value = value.substring(0, 10);
}
if(value == '1801-02-03'){
return '';
}
}
return value;
}
/**
* 判断出院时间是否是1801-02-03
* */
function operDisTime(value){
if(value != '' && value != null){
if (value.length >= 10 && '1801-02-03' == value.substring(0, 10)) {
value = '';
}
if(value.length >= 19){
return value.substring(0, 19);
}else{
return value;
}
}
}
//封装改变日期方法
function initDateInput(startTimeId,endTimeId){
$('#'+startTimeId).datepicker({
language: "zh-CN",
format: "yyyy-mm-dd",
autoclose: true//选中之后自动隐藏日期选择框
}).on('changeDate',function(){
$("#beginTime-error").hide();
var startTime= $("#"+startTimeId).val();
$("#"+endTimeId).datepicker('setStartDate',startTime);
$("#"+startTimeId).datepicker('hide');
});
$('#'+endTimeId).datepicker({
language: "zh-CN",
format: "yyyy-mm-dd",
autoclose: true//选中之后自动隐藏日期选择框
}).on('changeDate',function(){
var startTime = $("#"+startTimeId).val();
var endtime = $("#"+endTimeId).val();
$("#"+startTimeId).datepicker('setEndDate',endtime);
$("#"+endTimeId).datepicker('hide');
});
}
//获取table的高度
function getHeight(height) {
return $(window).height() - height;
}
//加载时段
function loadTimeInterval(){
$.ajax({
type:'get',
url:path+'/static/json/timeInterval.json',
dataType:'json',
success:function(data){
if(data != ''){
var html = '<option value="">不限</option>';
var timeIntervalTemp = $("#timeIntervalTemp").val();
for (var i = 0; i < data.length; i++) {
if(timeIntervalTemp == data[i].code){
html += '<option value="'+data[i].code+'" selected>'+data[i].name+'</option>'
}else{
html += '<option value="'+data[i].code+'">'+data[i].name+'</option>'
}
}
$("#timeInterval").append(html);
}
}
})
}
//出院时段触发查询
function loadTableByTime(value,startDateId,endDateId,tableId){
//填空出院日期搜索框并立即查询
//开始日期id
var startDateDocument = $("#"+startDateId);
//结束日期id
var endDateDocument = $("#"+endDateId);
switch (value) {
case '':
//不限
startDateDocument.val("");
break;
case '1':
//3天内
//开始日期为3天前getHisDay
startDateDocument.val(getHisDay(3));
break;
case '2':
//7天内
//开始日期为7天前getHisDay
startDateDocument.val(getHisDay(7));
break;
case '3':
//1个月内
//开始日期为1个月前
startDateDocument.val(getPreMonthToday());
break;
case '4':
//3个月内
//开始日期为6个月前
startDateDocument.val(getPreMonthDay(getNowDay(),3));
break;
}
if(value != ''){
//非不限结束日期均为今天
//结束时间为今天
endDateDocument.val(getNowDay());
}else{
//结束时间为今天
endDateDocument.val("");
}
$("#"+tableId).bootstrapTable("refreshOptions", {pageNumber: 1});
}
jQuery(function ($) {
//解决模态框背景色越来越深的问题
$(document).on('show.bs.modal', '.modal', function (event) {

@ -389,39 +389,3 @@ $("#saveBtn").click(function () {
}
});
});
jQuery(function ($) {
//解决模态框背景色越来越深的问题
$(document).on('show.bs.modal', '.modal', function (event) {
$(this).appendTo($('body'));
}).on('shown.bs.modal', '.modal.in', function (event) {
setModalsAndBackdropsOrder();
}).on('hidden.bs.modal', '.modal', function (event) {
setModalsAndBackdropsOrder();
});
function setModalsAndBackdropsOrder() {
var modalZIndex = 1040;
$('.modal.in').each(function (index) {
var $modal = $(this);
modalZIndex++;
$modal.css('zIndex', modalZIndex);
$modal.next('.modal-backdrop.in').addClass('hidden').css('zIndex', modalZIndex - 1);
});
$('.modal.in:visible:last').focus().next('.modal-backdrop.in').removeClass('hidden');
}
//覆盖Modal.prototype的hideModal方法
$.fn.modal.Constructor.prototype.hideModal = function () {
var that = this
this.$element.hide()
this.backdrop(function () {
//判断当前页面所有的模态框都已经隐藏了之后body移除.modal-open即body出现滚动条。
$('.modal.fade.in').length === 0 && that.$body.removeClass('modal-open')
that.resetAdjustments()
that.resetScrollbar()
that.$element.trigger('hidden.bs.modal')
})
}
});

@ -688,8 +688,6 @@ function initTable2() {
});
}
initTable2();
$("#selModal").keydown(function (e) {
if (e.keyCode == 13) {
event.preventDefault();//禁用默认回车事件
@ -739,11 +737,8 @@ function initTree(patientId,checker) {
zNodes.push(obj);
}
}
var treeObj = $.fn.zTree.init($("#ztree"), setting, zNodes);
//添加选中父节点
var node = treeObj.getNodeByParam("id", 0);
treeObj.selectNode(node, true);//将指定ID的节点选中
$('#table2').bootstrapTable('refresh');
$.fn.zTree.init($("#ztree"), setting, zNodes);
initTable2();
spinner.spin();
}, error: function () {
}
@ -774,13 +769,14 @@ var setting = {
callback: {
beforeClick: function (treeId, treeNode) {
idArr = [];
$("#assortId").html(treeNode.id);
$("#assortId").html("'"+treeNode.id+"'");
//查询之后重新从第一页算起
$('#table2').bootstrapTable('refreshOptions', {limit: 1, offset: 10});
//刷新
$('#table2').bootstrapTable('refresh');
},
onClick:onClick
onClick:onClick,
onCheck:onCheck
}
};
//树点击事件
@ -788,7 +784,32 @@ function onClick(e, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj("ztree");
//点击后选中
zTree.checkNode(treeNode,!treeNode.checked, true);
loadTable2ByOperTree();
};
//树选中事件
function onCheck(e, treeId, treeNode) {
loadTable2ByOperTree();
};
function loadTable2ByOperTree(){
var ids = '';
//获取树
var zTree = $.fn.zTree.getZTreeObj("ztree");
//获取改变的全部结点
var changedNodes = zTree.getChangeCheckedNodes();
for (var i = 0; i < changedNodes.length; i++) {
if (changedNodes[i].id !== 0) {
ids += "'" + changedNodes[i].id + "',";
}
}
if(ids !== ''){
ids = ids.substring(0,ids.length-1);
}
$("#assortId").html(ids);
//查询之后重新从第一页算起
$('#table2').bootstrapTable('refreshOptions', {limit: 1, offset: 10});
//刷新
$('#table2').bootstrapTable('refresh');
}
//查询树节点
function searchNode() {
var zTree = $.fn.zTree.getZTreeObj("ztree");

@ -9,42 +9,10 @@ $(function(){
initDateInput('startDate','endDate');
initDateInput('startDateTo','endDateTo');
initDateInput('startDateTo','endDateTo1');
//加载时段
loadTimeInterval();
})
//出院时段触发查询
function loadTableByTime(value){
//填空出院日期搜索框并立即查询
switch (value) {
case '':
//不限
$("#startDateTo").val("");
break;
case '1':
//3天内
//开始日期为3天前getHisDay
$("#startDateTo").val(getHisDay(3));
break;
case '2':
//1个月内
//开始日期为1个月前
$("#startDateTo").val(getPreMonthToday());
break;
case '3':
//6个月内
//开始日期为6个月前
$("#startDateTo").val(getPreMonthDay(getNowDay(),6));
break;
}
if(value != ''){
//非不限结束日期均为今天
//结束时间为今天
$("#endDateTo").val(getNowDay());
}else{
//结束时间为今天
$("#endDateTo").val("");
}
$("#table").bootstrapTable("refreshOptions", {pageNumber: 1});
}
//未终审页面、在院浏览、出院浏览查看病历时按审核角色查询分类主要查询checker=2护士的只查看护理记录单和体温表
function getChecker(){
$.get(path+'/beHosp/getChecker',function(data){
@ -65,6 +33,7 @@ function getChecker(){
}
},'json');
}
//查看病历清单时查询分段列表
function getZdAssort(){
var inpType = $("#inpType").val();

@ -2,6 +2,7 @@ var tipLoad = 1;
//创建数组保存图片
var files = new Array();
var id = 0;
var selects = '';
//终审列表
function initTable() {
if (tipLoad == 1) {
@ -197,16 +198,8 @@ function initTable() {
});
},
'click .verifyInfo': function (e, value, row, index) {
setFormToken();
// console.log("====审核====");
$('#verifyModal').modal({
backdrop: 'static',//backdrop 为 static 时,点击模态对话框的外部区域不会将其关闭。
keyboard: false,//keyboard 为 false 时,按下 Esc 键不会关闭 Modal。
show: true//弹出对话框
});
$("#archiveId").val(row.id);
$("#status1").val(row.archivestate);
$("#verifyText").val("");
//调用审批diag
callApproveDiag(row.id,1);
},
'click .selInfo': function (e, value, row, index) {
//查询是否医生或护士是否提交
@ -290,20 +283,105 @@ function initTable() {
});
}
}
//确认批量审批列表
function initTable3() {
$("#table3").bootstrapTable("destroy");
$("#table3").bootstrapTable({ // 对应table标签的id
data: selects, // 获取表格数据的url
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //是否显示行间隔色
pagination: true, // 在表格底部显示分页组件默认false
pageSize:"5",
pageList: [5,10,20,50,100], // 如果设置了分页设置可供选择的页面数据条数。设置为All 则显示所有记录。
undefinedText: '---', //当数据为 undefined 时显示的字符
height: 240, //定义表格的高度。
paginationDetailHAlign: 'left',//指定 分页详细信息 在水平方向的位置。'left' 或 'right'。
columns: [
{
title: '住院号',
field: 'inpNo',
align: 'left',
valign: 'middle',
},
{
title: '住院次数',
field: 'visitId',
align: 'center',
valign: 'middle',
},
{
title: '姓名',
field: 'name',
align: 'left',
valign: 'middle',
},
{
title: '性别',
field: 'sex',
align: 'center',
valign: 'middle',
},
{
title: '出院科室',
field: 'deptName',
align: 'left',
valign: 'middle',
},
{
title: '出院日期',
field: 'dischargeDateTime',
align: 'center',
formatter: function (value, row, index) {
return operDisDate(value);
}
},
{
title: '主管医生',
field: 'doctorInCharge',
align: 'left',
},
],
onLoadSuccess: function (result) { //加载成功时执行
$(".page-list").show();
},
onLoadError: function () { //加载失败时执行
}
});
}
//终审功能
$("#verifyBtn").on('click', function () {
//审核信息保存
var id = $("#archiveId").val();
var remark = $("#verifyText").val();
//获取审批个数
var approveCount = $("#approveCount").val();
if(approveCount > 1){
//大于一个弹出确认框
$("#verifyModal").modal('hide');
initTable3();
$('#sureModal').modal({
backdrop: 'static',//backdrop 为 static 时,点击模态对话框的外部区域不会将其关闭。
keyboard: false,//keyboard 为 false 时,按下 Esc 键不会关闭 Modal。
show: true//弹出对话框
});
}else{
//只有一个直接提交
approveMethod();
}
});
//终审方法
function approveMethod(){
setFormToken();
//归档状态改为初审还是有就是初审内容保存
$.ajax({
url: path+"/lastVerify/updateStateByArchivId",
type: "POST",
data: {id: id, remark: remark,changeReason:$("#changeReason").val(),checkedDatetime:$("#checkedDateTime").val(),status:$("#status1").val(),formToken:$("#formToken").val()},
data: {id: $("#archiveId").val(), remark: $("#verifyText").val(),changeReason:$("#changeReason").val(),checkedDatetime:$("#checkedDateTime").val(),status:$("#status1").val(),formToken:$("#formToken").val()},
dataType:'json',
success: function (result) {
if (result.code == 100) {
$("#verifyModal").modal('hide');
$("#sureModal").modal('hide');
$("#table").bootstrapTable("refresh");
toastr.success("终审操作成功!");
} else {
@ -311,8 +389,46 @@ $("#verifyBtn").on('click', function () {
}
}
});
}
//批量终审功能
$("#approvesBtn").on('click', function () {
selects = $("#table").bootstrapTable('getSelections');
var count = selects.length;
if(count !== 0){
var ids = '';
for (var i = 0; i < count; i++) {
if(i === 0){
ids += selects[i].id;
}else{
ids += "," + selects[i].id;
}
}
callApproveDiag(ids,count);
}else{
toastr.warning("批量审批请至少选中一个");
}
});
//批量终审确认提交
$("#sureBtn").on('click',function(){
approveMethod();
});
//调用审批diag
function callApproveDiag(ids,count) {
$('#verifyModal').modal({
backdrop: 'static',//backdrop 为 static 时,点击模态对话框的外部区域不会将其关闭。
keyboard: false,//keyboard 为 false 时,按下 Esc 键不会关闭 Modal。
show: true//弹出对话框
});
$("#archiveId").val(ids);
$("#status1").val("64");
$("#verifyText").val("");
//审批个数
$("#approveCount").val(count);
}
//查看初审信息
$("#getFirstBtn").on('click', function () {
//退回信息保存
@ -375,6 +491,7 @@ $("#getRecallBtn").on('click', function () {
});
$(function () {
$(".modal-dialog").draggable();//为模态对话框添加拖拽
//日期控件
var url = window.location.href;
var index = url.substring(url.lastIndexOf('?') + 1).replace("num=", "");

@ -1,7 +1,7 @@
function getDeptName(){
var deptNameArr = $("#deptName").val();
var deptName = '';
if(deptNameArr.length > 0){
if(deptNameArr != undefined && deptNameArr.length > 0){
for (var i = 0; i < deptNameArr.length; i++) {
if(deptNameArr[i] != ''){
deptName += deptNameArr[i] + ',';

@ -0,0 +1,394 @@
var tipLoad = 0;
var url = path + '/statistics/recordStatistics/';
$(function(){
//加载科室
getDeptStatistics();
//获取加载层数级
var level = $("#level").val();
switch (level) {
case '1':
initTable();
break;
case '2':
initTable1();
break;
case '3':
initTable2();
break;
}
})
//加载科室
function getDeptStatistics() {
//获取科室列表
$.ajax({
url: path+"/inHosp/getDept",
type: "POST",
data: {effective: 1, typecode: "dept_code"},
async:false,
success: function (result) {
if (result != null) {
var html = '';
for (var i = 0; i < result.length; i++) {
//默认需要选中
var searchDeptName = $("#searchDeptName").val().split(",");
//定义是否包含默认需要选中的
var name = result[i].name;
var py = makePy(name);
var pingyin = ConvertPinyin(name);
html += '<option data-tokens="' + name + '|' + py[0] + '|' + pingyin + '" value="' + result[i].code + '">' + name + '</option>';
}
$("#deptName").append(html);
$("#deptAdmissionTo").append(html);
$("#deptName").val(searchDeptName);
}
$(".selectpicker").selectpicker('refresh'); //
}
});
}
//第一层,查全部
function initTable() {
$("#table").bootstrapTable({ // 对应table标签的id
url: path+"/statistics/getRecordStatistics", // 获取表格数据的url
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
sidePagination: 'server', // 设置为服务器端分页 客户端client
toolbar: '#toolbar',//指定工具栏
searchOnEnterKey: true, //设置为 true时按回车触发搜索方法否则自动触发搜索方法
detailView:true,//是否可展开
undefinedText: '--', //当数据为 undefined 时显示的字符
singleSelect: false,//设置True 将禁止多选
clickToSelect: true,//设置true 将在点击行时自动选择rediobox 和 checkbox
height: getHeight(100), //定义表格的高度。
searchTimeOut: 500,// 默认500 设置搜索超时时间。
showHeader: true,//是否显示列头。
//是否显示导出按钮
queryParams: function (params) {
return queryParams(params,this);
},
columns: [
{
title: '序号',
align: 'center',
formatter: function (value, row, index) {
return index + 1;
}
},
{
title: '总病历数',
field: 'allRecordCount',
align: 'center'
},
{
title: '总文件数',
field: 'allFileCount',
align: 'center'
},
{
title: '总页数',
field: 'allPageCount',
align: 'center'
},
{
title: '自动采集总文件数',
field: 'autoCollectionFileCount',
align: 'center'
},
{
title: '自动采集总页数',
field: 'autoCollectionPageCount',
align: 'center'
},
{
title: '扫描上传总文件数',
field: 'manualScanFileCount',
align: 'center'
},
{
title: '扫描上传总页数',
field: 'manualScanPageCount',
align: 'center'
},
{
title:'操作',
align: 'center',
valign: 'middle',
formatter: function (value, row, index) {
var allRecordCount = row.allRecordCount;
if(allRecordCount != 0){
return showDetail('2',null);
}
}
}
],
onLoadSuccess: function (result) { //加载成功时执行
$(".page-list").show();
},
//展开详情事件
onExpandRow: function (index, row, $detail) {//點擊datagrid 展開按鈕事件
var html = '<div id="tableDiv1">\n' +
' <table id="table1" class="table text-nowrap"></table>\n' +
' </div>';
$detail.html(html);
initTable1();
}
});
}
//第二层,按科室分组查
function initTable1() {
$("#table1").bootstrapTable({ // 对应table标签的id
url: path + "/statistics/getRecordStatisticsGroupDept", // 获取表格数据的url
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
paginationShowPageGo: true,
pageList: [10, 20, 50, 100], // 如果设置了分页设置可供选择的页面数据条数。设置为All 则显示所有记录。
sidePagination: 'server', // 设置为服务器端分页 客户端client
searchOnEnterKey: true, //设置为 true时按回车触发搜索方法否则自动触发搜索方法
detailView: true,//是否可展开
undefinedText: '--', //当数据为 undefined 时显示的字符
singleSelect: false,//设置True 将禁止多选
clickToSelect: true,//设置true 将在点击行时自动选择rediobox 和 checkbox
paginationDetailHAlign: 'left',//指定 分页详细信息 在水平方向的位置。'left' 或 'right'。
height: getHeight(150), //定义表格的高度。
searchTimeOut: 500,// 默认500 设置搜索超时时间。
showHeader: true,//是否显示列头。
//查询条件
queryParams: function (params) {
return queryParams(params,this);
},
columns: [
{
title: '序号',
align: 'center',
formatter: function (value, row, index) {
return index + 1;
}
},
{
title: '出院科室',
field: 'deptNameCn',
align: 'left'
},
{
title: '总文件数',
field: 'allFileCount',
align: 'center'
},
{
title: '总页数',
field: 'allPageCount',
align: 'center'
},
{
title: '自动采集总文件数',
field: 'autoCollectionFileCount',
align: 'center'
},
{
title: '自动采集总页数',
field: 'autoCollectionPageCount',
align: 'center'
},
{
title: '扫描上传总文件数',
field: 'manualScanFileCount',
align: 'center'
},
{
title: '扫描上传总页数',
field: 'manualScanPageCount',
align: 'center'
},
{
title:'操作',
align: 'center',
valign: 'middle',
formatter: function (value, row, index) {
return showDetail('3',row.deptName);
}
}
],
onLoadSuccess: function (result) { //加载成功时执行
$(".page-list").show();
},
//展开详情事件
onExpandRow: function (index, row, $detail) {//點擊datagrid 展開按鈕事件
var html = '<div id="tableDiv2">\n' +
' <table id="table2" class="table text-nowrap table-bordered"></table>\n' +
' </div>';
$detail.html(html);
var deptName = row.deptName;
//刷新科室选中
$("#deptName").val(deptName);
$(".selectpicker").selectpicker('refresh');
initTable2();
}
});
}
//第三层,根据科室查询病患详情
function initTable2() {
$("#table2").bootstrapTable({ // 对应table标签的id
url: path+"/statistics/getRecordStatisticsByDeptName", // 获取表格数据的url
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
sidePagination: 'server', // 设置为服务器端分页 客户端client
pagination: true, // 在表格底部显示分页组件默认false
paginationShowPageGo: true,
pageList: [10, 20, 50, 100], // 如果设置了分页设置可供选择的页面数据条数。设置为All 则显示所有记录。
toolbar: '#toolbar',//指定工具栏
searchOnEnterKey: true, //设置为 true时按回车触发搜索方法否则自动触发搜索方法
//detailView:true,//是否可展开
undefinedText: '--', //当数据为 undefined 时显示的字符
singleSelect: false,//设置True 将禁止多选
clickToSelect: true,//设置true 将在点击行时自动选择rediobox 和 checkbox
paginationDetailHAlign: 'left',//指定 分页详细信息 在水平方向的位置。'left' 或 'right'。
height: getHeight(150), //定义表格的高度。
searchTimeOut: 500,// 默认500 设置搜索超时时间。
showHeader: true,//是否显示列头。
//是否显示导出按钮
queryParams: function (params) {
return queryParams(params,this);
},
columns: [
{
title: '序号',
align: 'center',
formatter: function (value, row, index) {
return index + 1;
}
},
{
title: '住院号',
field: 'inpNo',
align: 'left'
},
{
title: '姓名',
field: 'name',
align: 'left'
},
{
title: '住院次数',
field: 'visitId',
align: 'center'
},
{
title: '出院科室',
field: 'deptNameCn',
align: 'left'
},
{
title: '出院日期',
field: 'dischargeDateTime',
align: 'center',
formatter: function (value) {
return operDisDate(value);
}
},
{
title: '总文件数',
field: 'allFileCount',
align: 'center'
},
{
title: '总页数',
field: 'allPageCount',
align: 'center'
},
{
title: '自动采集总文件数',
field: 'autoCollectionFileCount',
align: 'center'
},
{
title: '自动采集总页数',
field: 'autoCollectionPageCount',
align: 'center'
},
{
title: '扫描上传总文件数',
field: 'manualScanFileCount',
align: 'center'
},
{
title: '扫描上传总页数',
field: 'manualScanPageCount',
align: 'center'
}
],
onLoadSuccess: function (result) { //加载成功时执行
$(".page-list").show();
}
});
}
//各表格查询条件
function queryParams(params,_this){
var currPageSize = _this.pageSize;
if (currPageSize == 2) {
currPageSize = 10;
}
var limit = null;
var offset = params.offset;
//判断是否导出全部all
if ($("#sel_exportoption").val() == "all") {
offset = 0;
limit = _this.totalRows;
_this.pageSize = limit;
} else {
limit = currPageSize;
_this.pageSize = currPageSize;
}
var temp = {
offset:offset,
limit:limit,
startDate: $("#startTime1").val(),
endDate: $("#endTime1").val(),
deptName:getDeptName(),
timeInterval:$("#timeInterval").val(),
name:$("#name").val(),
inpNo:$("#inpNo").val()
};
return temp;
}
//封装展开显示按钮方法
function showDetail(level,deptName){
return '<a type="button" onclick="showDetailMethod('+level+','+deptName+')" target="_blank" class="btn btn-primary btn-sm">展开显示</button></a>'}
//封装展开显示跳转方法
function showDetailMethod(level,deptName){
var startDate =$("#startTime1").val();
var endDate = $("#endTime1").val();
var timeInterval = $("#timeInterval").val();
var name = $("#name").val();
var inpNo = $("#inpNo").val();
if(deptName == null){
deptName = getDeptName();
}
var urlTemp = url + level + "?deptName="+deptName+"&startDate="+ startDate
+ "&endDate="+endDate+"&timeInterval="+timeInterval+"&name="+name
+"&inpNo="+inpNo;
window.open(urlTemp);
}
//查询按钮
$('#searchBtnStatistics').click(function () {
$("#isSearch").val(1);
//查询之后重新从第一页算起
if (tipLoad == 0) {
var level = $("#level").val();
if(level == '1') {
$("#table").bootstrapTable("refreshOptions", {pageNumber: 1});
}else if(level == '2') {
$("#table1").bootstrapTable("refreshOptions", {pageNumber: 1});
}else if(level == '3') {
$("#table2").bootstrapTable("refreshOptions", {pageNumber: 1});
}
} else {
toastr.warning("正在查询,请稍等...");
}
});
//键盘回车查询
$(document).keyup(function(event){
if(event.keyCode ==13){
$("#searchBtnStatistics").trigger("click");
}
});

@ -9,42 +9,10 @@ $(function () {
//$("#endTime1").val(getNowDay());
//$("#endTime2").val(getNowDay());
initTable();
//加载时段
loadTimeInterval();
})
//出院时段触发查询
function loadTableByTime(no,value){
//填空出院日期搜索框并立即查询
switch (value) {
case '':
//不限
$("#startTime"+no).val("");
break;
case '1':
//3天内
//开始日期为3天前getHisDay
$("#startTime"+no).val(getHisDay(3));
break;
case '2':
//1个月内
//开始日期为1个月前
$("#startTime"+no).val(getPreMonthToday());
break;
case '3':
//6个月内
//开始日期为6个月前
$("#startTime"+no).val(getPreMonthDay(getNowDay(),6));
break;
}
if(value != ''){
//非不限结束日期均为今天
//结束时间为今天
$("#endTime"+no).val(getNowDay());
}else{
//结束时间为今天
$("#endTime"+no).val("");
}
$("#table").bootstrapTable("refreshOptions", {pageNumber: 1});
}
//指定扫描打印表格高度
function getStaticTableHeight(){
return $(window).height() - 150;

@ -0,0 +1,18 @@
[
{
"code": 1,
"name": "3天内"
},
{
"code": 2,
"name": "7天内"
},
{
"code": 3,
"name": "1个月内"
},
{
"code": 4,
"name": "3个月内"
}
]
Loading…
Cancel
Save