1.新的完整性校验策略

2.第三方浏览病案页面接口查询不到文档,下方pdf.js不加载
3.完整性情况值用程序进程刷值,一小时刷一次
master
zengwh 5 years ago
parent 2bd3a39de1
commit 4913fbf7ca

@ -161,7 +161,7 @@ public class beHospitaledController {
archiveMasterVo.setEndDateTo(null);
}
try {
List<Archive_Master_Vo> list = archiveMasterService.selectByColumn(archiveMasterVo,request);
List<Archive_Master_Vo> list = archiveMasterService.selectByColumn(null,null,archiveMasterVo,request);
//文件名
String fileName = "出院浏览" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls";
//ExportExcelUtil

@ -21,4 +21,6 @@ public interface ArchiveTransferDeptUserMapper extends CommomMapper{
List<ArchiveTransferDeptUser> selectAllByMasterId(@Param("masterId")String masterId);
void deleteTransferDeptUserByMasterId(@Param("masterId")String masterId);
List<ArchiveTransferDeptUser> selectMasterIdByTranDept(@Param("userName")String userName);
}

@ -51,4 +51,6 @@ public interface Archive_DetailMapper {
List<Archive_Detail> getSourceByMasterId(@Param("masterid") String masterid);
List<Archive_Detail> selectIsScan(@Param("ids") String ids,@Param("fieldFlag")Integer fieldFlag);
List<Archive_Detail> selectRepeatRecordFileForMasterIds(@Param("masterIds")String masterIds);
}

@ -55,4 +55,9 @@ public interface Archive_MasterMapper {
List<Archive_Master> loadOverTimeDoctorInCharge();
List<Archive_Master> selectPatientIdsForSign();
/**
*
*/
List<Archive_Master_Vo> selectCompleteMasterIds(Archive_Master_Vo master);
}

@ -0,0 +1,44 @@
package com.emr.dao;
import com.emr.vo.CompleteVo;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
public interface CompleteTaskMapper {
/**
* masterId
* @param nowDate
* @return
*/
List<CompleteVo> selectCompleteMasterIds(@Param("nowDate")Date nowDate);
/**
*
* @param masterId
* @return
*/
List<CompleteVo> selectMasterIdByCustomComplete(@Param("masterId") String masterId);
/**
*
* @param isCheck
* @return
*/
List<CompleteVo> selectRecordNames(@Param("isCheck")Integer isCheck);
/**
*
* @param masterId
* @return
*/
List<CompleteVo> selectMasterIdByInspection(@Param("masterId") String masterId);
/**
*
* @param masterId
* @return
*/
List<CompleteVo> selectMasterIdByRepeat(@Param("masterId") String masterId);
}

@ -63,6 +63,10 @@ public class Archive_Master_Vo extends Archive_Master{
private String assortId;//分段id
private Integer count;//数量
private String masterIds;//id集合
private String masterIdsByTranDept;//转科的id集合
}

@ -0,0 +1,176 @@
package com.emr.quart;
import com.emr.dao.CompleteTaskMapper;
import com.emr.dao.Emr_Commom_SetMapper;
import com.emr.entity.Archive_Master;
import com.emr.entity.Emr_Commom_Set;
import com.emr.service.Archive_MasterService;
import com.emr.vo.CompleteVo;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Component
public class CompleteTask {
private static Logger log = Logger.getLogger("compeleteMsg");
@Autowired
private Emr_Commom_SetMapper commomSetMapper;
@Autowired
private CompleteTaskMapper completeTaskMapper;
@Autowired
private Archive_MasterService archiveMasterService;
@Scheduled(cron="0 0 0/1 * * ?")
public void completeTask(){
Date newDate = new Date();
log.info("===================任务开始===================");
//查询最后一次刷表的时间
Emr_Commom_Set commomSet = commomSetMapper.selectByPrimaryKey(1);
//根据最后一次刷表的时间查询出院记录里的且比刷表时间还晚的采集单的masterId集合
List<CompleteVo> masterList= completeTaskMapper.selectCompleteMasterIds(commomSet.getDate1());
log.info("此次任务菜单病历有"+masterList.size()+"份");
//遍历masterId集合
if(!CollectionUtils.isEmpty(masterList)) {
for(CompleteVo masterVo : masterList) {
String masterId = masterVo.getId();
//原来的完整性值
String oldLockInfo = masterVo.getLockInfo();
//定义新的完整性值
String newLockInfo = selectLockInfoByMasterId(masterId);
if(StringUtils.isNotBlank(newLockInfo)){
newLockInfo = newLockInfo.substring(1,newLockInfo.length());
//控制新值不能超过100个字符超过100个字符则后面部分用...代替
if(newLockInfo.length() > 100){
newLockInfo = newLockInfo.substring(0,100) + "...";
}
}else{
newLockInfo = "完整";
}
//完整性值不一样则更新完整性值
if(StringUtils.isBlank(oldLockInfo) || !oldLockInfo.equals(newLockInfo)){
Archive_Master master = new Archive_Master();
master.setId(masterId);
master.setLockinfo(newLockInfo);
archiveMasterService.updateByClo(master);
//输出更新的原来的和最新的完整性值
log.info(masterId+":"+oldLockInfo+"-->"+newLockInfo);
}
}
}
//更新最后一次时间
commomSet.setDate1(newDate);
commomSet.setId(1);
commomSetMapper.updateByPrimaryKeySelective(commomSet);
log.info("===================任务结束===================");
}
public String selectLockInfoByMasterId(String masterId){
//定义缺失的LockInfo
StringBuilder lockInfo = new StringBuilder();
//查询自定义的完整性策略缺失
lockInfo = selectMasterIdByCustomComplete(masterId,lockInfo);
//缺少检验检查报告缺失
lockInfo = selectMasterIdByInspection(masterId,lockInfo);
//判断重复文件
lockInfo = selectMasterIdByRepeat(masterId,lockInfo);
String newLockInfo = "";
if(StringUtils.isNotBlank(lockInfo)){
newLockInfo = lockInfo.substring(1,lockInfo.length());
//控制新值不能超过100个字符超过100个字符则后面部分用...代替
if(newLockInfo.length() > 100){
newLockInfo = newLockInfo.substring(0,100) + "...";
}
}else{
newLockInfo = "完整";
}
return newLockInfo;
}
/**
*
* @param masterId
* @param lockInfo
* @return
*/
private StringBuilder selectMasterIdByCustomComplete(String masterId, StringBuilder lockInfo) {
//查询自定义的完整性策略判断集合
List<CompleteVo> masterVos = completeTaskMapper.selectMasterIdByCustomComplete(masterId);
if(!CollectionUtils.isEmpty(masterVos)){
//定义普通的判断集合
List<CompleteVo> generalList = new ArrayList<>();
//定义可能麻醉存在的集合
List<CompleteVo> anaesthesiaList = new ArrayList<>();
for(CompleteVo vo : masterVos){
Integer isCheck = vo.getIsCheck();
if(isCheck == 1){
generalList.add(vo);
}else if(isCheck == 11){
anaesthesiaList.add(vo);
}
}
//拼接一般的缺失记录
lockInfo = appendRecordName(generalList,lockInfo);
if(!CollectionUtils.isEmpty(anaesthesiaList)) {
//查询第一组同时存在校验文档的集合
List<CompleteVo> completeList = completeTaskMapper.selectRecordNames(11);
if (completeList.size() != anaesthesiaList.size()) {
//拼接第一组同时存在校验文档的缺失记录
lockInfo = appendRecordName(anaesthesiaList, lockInfo);
}
}
}
return lockInfo;
}
/**
*
* @param masterVos
* @param lockInfo
* @return
*/
private StringBuilder appendRecordName(List<CompleteVo> masterVos, StringBuilder lockInfo) {
if(!CollectionUtils.isEmpty(masterVos)) {
for (CompleteVo obj : masterVos) {
lockInfo.append(",").append(obj.getRecordName());
}
}
return lockInfo;
}
/**
*
* @param masterId
* @param lockInfo
* @return
*/
private StringBuilder selectMasterIdByInspection(String masterId, StringBuilder lockInfo) {
List<CompleteVo> list = completeTaskMapper.selectMasterIdByInspection(masterId);
lockInfo = appendRecordName(list, lockInfo);
if(StringUtils.isNotBlank(lockInfo)) {
lockInfo = lockInfo.append("缺失");
}
return lockInfo;
}
/**
*
* @param masterId
* @param lockInfo
* @return
*/
private StringBuilder selectMasterIdByRepeat(String masterId, StringBuilder lockInfo) {
List<CompleteVo> list = completeTaskMapper.selectMasterIdByRepeat(masterId);
if(!CollectionUtils.isEmpty(list)){
for(CompleteVo obj : list){
lockInfo.append(",").append(obj.getRecordName()).append("重复").append(obj.getCount()).append("份");
}
}
return lockInfo;
}
}

@ -4,11 +4,12 @@ import com.emr.dao.ArchiveRemindDeptUserInfoMapper;
import com.emr.dao.ArchiveRemindDeptUserMapper;
import com.emr.dao.ArchiveRemindcancleDeptMapper;
import com.emr.dao.RecordMapper;
import com.emr.entity.*;
import com.emr.entity.ArchiveRemindDeptUser;
import com.emr.entity.ArchiveRemindDeptUserInfo;
import com.emr.entity.ArchiveRemindcancleDept;
import com.emr.entity.Archive_Master_Vo;
import com.emr.service.ipml.CommomService;
import com.emr.service.ipml.EmrOvertimeSetService;
import com.emr.service.ipml.SendMessageService;
import com.emr.service.ipml.StatisticsService;
import com.emr.util.ExceptionPrintUtil;
import com.emr.util.IDHelper;
import com.emr.util.OracleConnect;
@ -18,9 +19,7 @@ import com.emr.vo.User;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.apache.shiro.util.CollectionUtils;
import org.aspectj.weaver.ast.Var;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.lang.reflect.Field;

@ -36,7 +36,7 @@ public interface Archive_MasterService {
* @param archiveMasterVo
* @return
*/
List<Archive_Master_Vo> selectByColumn(Archive_Master_Vo archiveMasterVo,HttpServletRequest request);
List<Archive_Master_Vo> selectByColumn(Integer offset, Integer limit,Archive_Master_Vo archiveMasterVo,HttpServletRequest request);
//验证字符串是否是数字

@ -54,6 +54,8 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
private Zd_AssortMapper assortMapper;
@Autowired
private Emr_DictionaryMapper dictionaryMapper;
@Autowired
private ArchiveTransferDeptUserMapper transferDeptUserMapper;
/**
*
* */
@ -69,96 +71,103 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
* */
@Override
public OffsetLimitPage selectByColumn(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit,HttpServletRequest request) {
PageHelper.offsetPage(offset, limit);
//查询出院集合
List<Archive_Master_Vo> list = selectByColumn(archiveMasterVo,request);
//组织完整性字段
//list集合的分组分类集合
if(!CollectionUtils.isEmpty(list)){
//获取masterIds
String masterIds = getMasterIdsByList(list);
//查询缺少检验检查报告masterId集合
List<Archive_Detail> selectNotInspectionList = detailMapper.selectNotInspectionList(masterIds);
//查询需要校验完整性的患者的分类集合
List<Archive_Detail> details = detailMapper.selectAssortIdsByMasterIds(masterIds);
if(!CollectionUtils.isEmpty(details)){
//查询需要校验完整性的分类集合
Zd_Assort assort = new Zd_Assort();
assort.setIsCheck(1);
List<Zd_Assort> assortList = assortMapper.selectAll(assort);
//循环遍历list集合判断是否完整完整isCheck赋值1且批量更新LockInfo字段为完整
updateMasterBySuccess(list, selectNotInspectionList,details, assortList);
}
//设置查询条件审核角色
setInfoId(archiveMasterVo);
//设置登录用户
Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER");
if(user.getRoleId() != -100 && user.getRoleId() != 0){
archiveMasterVo.setUserName(user.getUserName());
}
//查询
List<Archive_Master_Vo> list = selectByColumn(offset, limit,archiveMasterVo,request);
return new OffsetLimitPage((Page) list);
}
/**
* //循环遍历list集合判断是否完整完整isCheck赋值1且批量更新LockInfo字段为完整
* @param list
* @param selectNotInspectionList
* @param details
* @param assortList
*/
private void updateMasterBySuccess(List<Archive_Master_Vo> list,List<Archive_Detail> selectNotInspectionList, List<Archive_Detail> details, List<Zd_Assort> assortList) {
//循环遍历list集合判断是否完整完整isCheck赋值1且批量更新LockInfo字段为完整
//定义通过完整性校验的masterIds
StringBuilder masterIds = new StringBuilder();
for(Archive_Master_Vo master : list){
//定义检验检查报告分类是完整的
boolean inspectionFlag = true;
//判断是否存在缺少校验检查分类
if(!CollectionUtils.isEmpty(selectNotInspectionList)){
for (Archive_Detail detail : selectNotInspectionList) {
if (master.getId().equals(detail.getMasterid())) {
inspectionFlag = false;
break;
}
private void updateMasterBySuccess(List<Archive_Master_Vo> list) {
//list集合的分组分类集合
if(!CollectionUtils.isEmpty(list)){
//获取资料完整的masterIds
String masterIds = getMasterIdsByList(list);
Archive_Master_Vo masterVo = new Archive_Master_Vo();
masterVo.setMasterIds(masterIds);
masterVo.setIsSuccess("1");
//查询自定义的完整性的masterIds集合
List<Archive_Master_Vo> selectCompleteMasterIds = archiveMasterMapper.selectCompleteMasterIds(masterVo);
if(!CollectionUtils.isEmpty(selectCompleteMasterIds)) {
//将暂时赋值完整的isSuccess = 1
setIsSuccess(selectCompleteMasterIds,list);
//获取mastertIds集合
masterIds = getMasterIdsByList(selectCompleteMasterIds);
List<Archive_Detail> selectNotInspectionList = null;
List<Archive_Detail> repeatRecordFileForMasterIds = null;
if (StringUtils.isNotBlank(masterIds)) {
//查询缺少检验检查报告masterId集合
selectNotInspectionList = detailMapper.selectNotInspectionList(masterIds);
//查询有重复采集文件的masterIds集合
repeatRecordFileForMasterIds = detailMapper.selectRepeatRecordFileForMasterIds(masterIds);
}
}
//检验检查报告分类完整才判断需要校验的分类是否完整
if(inspectionFlag) {
//定义匹配分类成功次数
int successCount = 0;
for (Zd_Assort assortFor : assortList) {
for (Archive_Detail detail : details) {
//判断主键相同且分类id相同
if (master.getId().equals(detail.getMasterid()) && assortFor.getAssortId().equals(detail.getAssortid())) {
successCount++;
break;
//循环遍历list集合判断是否完整完整isCheck赋值1且批量更新LockInfo字段为完整
//定义通过完整性校验的masterIds
StringBuilder masterIdsTemp = new StringBuilder();
for(Archive_Master_Vo master : list) {
//定义检验检查报告分类是完整的
boolean inspectionFlag = false;
//判断不存在缺少校验检查分类
if (!CollectionUtils.isEmpty(selectNotInspectionList)) {
for (Archive_Detail detail : selectNotInspectionList) {
if (master.getId().equals(detail.getMasterid())) {
inspectionFlag = true;
break;
}
}
}
}
//如果成功匹配个数和需校验分类个数相等,全部匹配
//特殊情况验证完整性婴儿带B的住院号少验证两类病案首页、入(出、死亡)院记录
int verificationCount = 0;
String inpNo = master.getInpNo();
if(StringUtils.isNotBlank(inpNo)){
//最后一个字符带B的是婴儿
String lastChar = inpNo.substring(inpNo.length() - 1, inpNo.length());
if("B".equals(lastChar)){
verificationCount = assortList.size() - 2;
}else{
verificationCount = assortList.size();
//判断不存在重复文件
boolean repeatFileFlag = true;
if (!CollectionUtils.isEmpty(repeatRecordFileForMasterIds)) {
for (Archive_Detail detail : repeatRecordFileForMasterIds) {
if (master.getId().equals(detail.getMasterid())) {
repeatFileFlag = false;
break;
}
}
}
//检验检查报告分类完整才判断需要校验的分类是否完整
if (inspectionFlag || !repeatFileFlag) {
//list的isSuccess字段值赋值1
master.setIsSuccess("0");
}
}
if (verificationCount > 0 && successCount == verificationCount) {
//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("'");
if (!"完整".equals(master.getLockinfo()) && "1".equals(master.getIsSuccess())) {
if (StringUtils.isNotBlank(masterIdsTemp)) {
masterIdsTemp.append(",");
}
masterIdsTemp.append("'").append(master.getId()).append("'");
}
}
if (StringUtils.isNotBlank(masterIdsTemp)) {
archiveMasterMapper.updateLockInfoByMasterId(masterIdsTemp.toString(), "完整");
}
}
}
//不完整的批量批量更新master表的LockInfo字段为完整
if(StringUtils.isNotBlank(masterIds)){
archiveMasterMapper.updateLockInfoByMasterId(masterIds.toString(),"完整");
}
/**
* isSuccess = 1
* @param selectCompleteMasterIds
* @param list
*/
private void setIsSuccess(List<Archive_Master_Vo> selectCompleteMasterIds, List<Archive_Master_Vo> list) {
for(Archive_Master_Vo vo : list){
for(Archive_Master_Vo vo1 : selectCompleteMasterIds){
if(vo.getId().equals(vo1.getId())){
vo.setIsSuccess("1");
break;
}
}
}
}
@ -169,12 +178,11 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
*/
private String getMasterIdsByList(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("'");
for (Archive_Master_Vo vo : list) {
if (StringUtils.isNotBlank(masterIds)) {
masterIds.append(",");
}
masterIds.append("'").append(vo.getId()).append("'");
}
return masterIds.toString();
}
@ -341,15 +349,15 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
}
@Override
public List<Archive_Master_Vo> selectByColumn(Archive_Master_Vo archiveMasterVo,HttpServletRequest request) {
//设置查询条件审核角色
setInfoId(archiveMasterVo);
//设置登录用户
Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER");
if(user.getRoleId() != 1 && user.getRoleId() != -100 && user.getRoleId() != 0){
archiveMasterVo.setUserName(user.getUserName());
public List<Archive_Master_Vo> selectByColumn(Integer offset, Integer limit,Archive_Master_Vo archiveMasterVo,HttpServletRequest request) {
//分是否按完整性查询
List<Archive_Master_Vo> list = null;
if(null != offset && null != limit) {
PageHelper.offsetPage(offset, limit);
}
List<Archive_Master_Vo> list = archiveMasterMapper.selectByColumn(archiveMasterVo);
list = archiveMasterMapper.selectByColumn(archiveMasterVo);
//组织完整性字段并完整的更新archive_master表的完整性字段值为完整LockInfo='完整'
//updateMasterBySuccess(list);
//转换科室与赋值超期天数
selectByColumnChange(list);
//根据状态code转换状态及判断显示按钮
@ -379,6 +387,18 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
return list;
}
/**
*
* @param archiveMasterVo
* @return
*/
private List<Archive_Master_Vo> selectBeHospitalByIsSuccess(Integer offset,Integer limit,Archive_Master_Vo archiveMasterVo) {
if(null != offset && null != limit) {
PageHelper.offsetPage(offset, limit);
}
return archiveMasterMapper.selectCompleteMasterIds(archiveMasterVo);
}
/**
*
* @param archiveMasterVo

@ -283,9 +283,9 @@ public class RecordService {
recordSearch.setStartDate(dateList.get(dateList.size()-1).getDisDate());
List<Archive_Master_Vo> masterVoList = recordMapper.selectAllWithCompleteAssort(recordSearch);
//组织masterId分组数据
List<Archive_Master_Vo> masterIdVoList = selectGroupDataByMasterId(masterVoList);
//List<Archive_Master_Vo> masterIdVoList = selectGroupDataByMasterId(masterVoList);
//按日期分组和masterId分组组织已提交和已归档的数量
selectGroupDateByMasterIdList(dateList,masterIdVoList);
selectGroupDateByMasterIdList(dateList,masterVoList);
//转换百分比并有按科室查询时转换科室名称
setDeptNameAndPercent(recordSearch, dateList);
}
@ -319,7 +319,7 @@ public class RecordService {
if("128".equals(archivestate)){
count2++;
}
if("1".equals(obj.getIsSuccess())){
if("完整".equals(obj.getLockinfo())){
count3++;
}
}

@ -1,6 +1,5 @@
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;
@ -10,24 +9,12 @@ import com.emr.entity.OffsetLimitPage;
import com.emr.vo.*;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import net.sf.json.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.apache.poi.ss.formula.functions.T;
import org.apache.shiro.util.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@ -0,0 +1,16 @@
package com.emr.vo;
import lombok.Data;
@Data
public class CompleteVo {
private String id;
private Integer isCheck;//是否校验
private String recordName;//校验的文档名称
private Integer count;
private String lockInfo;
}

@ -1,4 +1,4 @@
log4j.rootLogger=info,myLog,errorMsg
log4j.rootLogger=info,myLog,errorMsg,compeleteMsg
log4j.appender.myLog=org.apache.log4j.DailyRollingFileAppender
log4j.appender.myLog.File=D:\\logs\\emr_medical_record\\info\\info_log
log4j.appender.myLog.DatePattern=-yyyy-MM-dd'.log'
@ -15,8 +15,16 @@ log4j.appender.errorMsg.Threshold = error
log4j.appender.errorMsg.layout=org.apache.log4j.PatternLayout
log4j.appender.errorMsg.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss}:%m%n
log4j.appender.compeleteMsg=org.apache.log4j.DailyRollingFileAppender
log4j.appender.compeleteMsg.File=D:\\logs\\emr_medical_record\\compeleteTask\\compeleteTask_log
log4j.appender.compeleteMsg.DatePattern=-yyyy-MM-dd'.log'
log4j.appender.compeleteMsg.Append = true
log4j.appender.compeleteMsg.Threshold = INFO
log4j.appender.compeleteMsg.layout=org.apache.log4j.PatternLayout
log4j.appender.compeleteMsg.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss}:%m%n
#Console sql
#log4j.rootLogger=debug,myLog,errorMsg,CONSOLE
#log4j.rootLogger=debug,myLog,errorMsg,compeleteMsg,CONSOLE
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern =%d %-5p [%c{5}] - %m%n

@ -183,4 +183,8 @@
#{item.str1,jdbcType=NVARCHAR}, #{item.str2,jdbcType=NVARCHAR})
</foreach>
</insert>
<!--根据工号查询转科id集合-->
<select id="selectMasterIdByTranDept" resultMap="BaseResultMap">
select master_id from archive_transfer_dept_user where user_name = #{userName}
</select>
</mapper>

@ -448,4 +448,29 @@
GROUP BY
MasterID
</select>
<!--查询有重复的文件的masterId集合-->
<select id="selectRepeatRecordFileForMasterIds" resultMap="BaseResultMap">
SELECT
MasterID,
Title,
COUNT(Title) count
FROM
archive_detail
WHERE
MasterID in (${masterIds})
AND Source != '电子病历系统采集服务-长临医嘱'
AND Source != '扫描上传'
AND Source != '手工上传'
AND flag = 0
AND archive_detail.id NOT IN (
SELECT
DID
FROM
archive_other_ext
WHERE
MID in (${masterIds})
)
group by MasterID,Title
having(COUNT(Title) > 1)
</select>
</mapper>

@ -22,7 +22,7 @@
<result column="ID_NO" jdbcType="NVARCHAR" property="idNo"/>
<result column="DISCHARGE_DISPOSITION" jdbcType="NVARCHAR" property="dischargeDisposition"/>
<result column="dept_code_lend" jdbcType="NVARCHAR" property="deptCodeLend"/>
<result column="D1" property="d1" jdbcType="DOUBLE" />
<result column="D1" property="d1" jdbcType="DOUBLE"/>
</resultMap>
<resultMap id="BaseResultMap2" type="com.emr.entity.Archive_Master_Vo">
<id column="id" jdbcType="NVARCHAR" property="id"/>
@ -178,118 +178,101 @@
ORDER BY m.admission_date_time desc
</select>
<!--带科室出院浏览公共查询条件-->
<sql id="beHospitalSeach">
<!--出院浏览公共查询条件-->
<sql id="leaveHospitalCommomSearch">
and ArchiveState != '1024' and ArchiveState != '128' and YEAR(discharge_date_time) != '1801'
/**根据待审核节点查询*/
<include refid="selectByInfo"></include>
/**根据审核状态查询*/
<include refid="selectByStatus"></include>
<if test="inpNo != null and inpNo != ''">
and m.inp_no like '%'+#{inpNo,jdbcType=NCHAR}+'%'
and inp_no like '%'+#{inpNo,jdbcType=NCHAR}+'%'
</if>
<if test="visitId != null and visitId != ''">
and m.visit_id=#{visitId,jdbcType=NCHAR}
and visit_id=#{visitId,jdbcType=NCHAR}
</if>
<if test="name != null and name != ''">
and m.name like '%'+#{name,jdbcType=NCHAR}+'%'
</if>
<if test="deptName!= null and deptName!= ''">
and m.dept_name in
<foreach item="item" collection="deptName.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
and name like '%'+#{name,jdbcType=NCHAR}+'%'
</if>
<choose>
<when test="startDateTo != null and startDateTo != '' and endDateTo != null and endDateTo != ''">
and m.discharge_date_time between CONVERT(VARCHAR(10),#{startDateTo,jdbcType=NCHAR},120) and
and discharge_date_time between CONVERT(VARCHAR(10),#{startDateTo,jdbcType=NCHAR},120) and
#{endDateTo,jdbcType=NCHAR}+ ' 23:59:59'
</when>
<when test="startDateTo != null and startDateTo != ''">
and m.discharge_date_time >= CONVERT(VARCHAR(10),#{startDateTo,jdbcType=NCHAR},120)
and discharge_date_time >= CONVERT(VARCHAR(10),#{startDateTo,jdbcType=NCHAR},120)
</when>
<when test="endDateTo != null and endDateTo != ''">
and m.discharge_date_time &lt;= #{endDateTo,jdbcType=NCHAR}+ ' 23:59:59'
and discharge_date_time &lt;= #{endDateTo,jdbcType=NCHAR}+ ' 23:59:59'
</when>
</choose>
<if test="doctorInCharge != null and doctorInCharge != ''">
and m.DOCTOR_IN_CHARGE in (${doctorInCharge})
and DOCTOR_IN_CHARGE in (${doctorInCharge})
</if>
</sql>
<!--不带科室的出院条件查询-->
<sql id="beHospitalSeach1">
and ArchiveState != '1024' and ArchiveState != '128' and YEAR(discharge_date_time) != '1801'
/**根据待审核节点查询*/
<include refid="selectByInfo"></include>
/**根据审核状态查询*/
<include refid="selectByStatus"></include>
<if test="inpNo != null and inpNo != ''">
and m.inp_no like '%'+#{inpNo,jdbcType=NCHAR}+'%'
</if>
<if test="visitId != null and visitId != ''">
and m.visit_id=#{visitId,jdbcType=NCHAR}
</if>
<if test="name != null and name != ''">
and m.name like '%'+#{name,jdbcType=NCHAR}+'%'
<if test="isSuccess != null and isSuccess != ''">
<choose>
<when test="isSuccess == 1">
and LockInfo = '完整'
</when>
<otherwise>
and LockInfo != '完整'
</otherwise>
</choose>
</if>
<choose>
<when test="startDateTo != null and startDateTo != '' and endDateTo != null and endDateTo != ''">
and m.discharge_date_time between CONVERT(VARCHAR(10),#{startDateTo,jdbcType=NCHAR},120) and
#{endDateTo,jdbcType=NCHAR}+ ' 23:59:59'
</when>
<when test="startDateTo != null and startDateTo != ''">
and m.discharge_date_time >= CONVERT(VARCHAR(10),#{startDateTo,jdbcType=NCHAR},120)
</when>
<when test="endDateTo != null and endDateTo != ''">
and m.discharge_date_time &lt;= #{endDateTo,jdbcType=NCHAR}+ ' 23:59:59'
</when>
</choose>
<if test="doctorInCharge != null and doctorInCharge != ''">
and m.DOCTOR_IN_CHARGE in (${doctorInCharge})
</sql>
<!--带科室出院浏览公共查询条件-->
<sql id="beHospitalSearch">
<include refid="leaveHospitalCommomSearch"></include>
<if test="deptName!= null and deptName!= ''">
and dept_name in
<foreach item="item" collection="deptName.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</sql>
<!--查询是否完整的masterId集合-->
<sql id="searchSuccessForMasterIdList">
SELECT id
SELECT archive_master.id
FROM
archive_master m
archive_master
LEFT JOIN (
SELECT
MasterID,
COUNT( AssortID ) count
FROM
(
SELECT
archive_detail.MasterID,
dbo.archive_detail.AssortID
FROM
dbo.archive_detail
INNER JOIN dbo.zd_assort ON dbo.archive_detail.AssortID = dbo.zd_assort.assort_id
AND dbo.zd_assort.print_flag = 0
AND dbo.zd_assort.is_check = 1
WHERE
( dbo.archive_detail.flag = 0 )
GROUP BY
archive_detail.MasterID,
dbo.archive_detail.AssortID
) temp
GROUP BY
MasterID
) temp ON m.id = temp.MasterID
SELECT
MasterID,
COUNT( AssortID ) count
FROM
(
SELECT
archive_detail.MasterID,
dbo.archive_detail.AssortID
FROM
dbo.archive_detail
INNER JOIN dbo.zd_assort ON dbo.archive_detail.AssortID = dbo.zd_assort.assort_id
AND dbo.zd_assort.print_flag = 0
AND dbo.zd_assort.is_check = 1
WHERE
( dbo.archive_detail.flag = 0 )
GROUP BY
archive_detail.MasterID,
dbo.archive_detail.AssortID
) temp
GROUP BY
MasterID
) temp ON archive_master.id = temp.MasterID
LEFT JOIN (
SELECT
MID,
COUNT( MID ) inspectionCount
FROM
archive_other_ext
WHERE
sysFlag IN ( 3, 4, 6 )
AND ISNULL( DID, '' )= ''
AND ISNULL( MID, '' )!= ''
GROUP BY
MID
) archive_other_ext ON m.id = archive_other_ext.MID
SELECT
MID,
COUNT( MID ) inspectionCount
FROM
archive_other_ext
WHERE
sysFlag IN ( 3, 4, 6 )
AND ISNULL( DID, '' )= ''
AND ISNULL( MID, '' )!= ''
GROUP BY
MID
) archive_other_ext ON archive_master.id = archive_other_ext.MID
WHERE
<choose>
<when test="isSuccess == 1">
@ -297,10 +280,11 @@
AND count = (
CASE
WHEN substring(
m.inp_no,
LEN ( m.inp_no ),
LEN ( m.inp_no )) = 'B' THEN
(( SELECT count( assort_id ) FROM zd_assort WHERE is_check = 1 ) - 2 ) ELSE ( SELECT count( assort_id ) FROM zd_assort WHERE is_check = 1 ) END)
archive_master.inp_no,
LEN ( archive_master.inp_no ),
LEN ( archive_master.inp_no )) = 'B' THEN
(( SELECT count( assort_id ) FROM zd_assort WHERE is_check = 1 ) - 2 ) ELSE ( SELECT count( assort_id )
FROM zd_assort WHERE is_check = 1 ) END)
</when>
<otherwise>
inspectionCount is not null
@ -308,13 +292,14 @@
OR count != (
CASE
WHEN substring(
m.inp_no,
LEN ( m.inp_no ),
LEN ( m.inp_no )) = 'B' THEN
(( SELECT count( assort_id ) FROM zd_assort WHERE is_check = 1 ) - 2 ) ELSE ( SELECT count( assort_id ) FROM zd_assort WHERE is_check = 1 ) END)
archive_master.inp_no,
LEN ( archive_master.inp_no ),
LEN ( archive_master.inp_no )) = 'B' THEN
(( SELECT count( assort_id ) FROM zd_assort WHERE is_check = 1 ) - 2 ) ELSE ( SELECT count( assort_id )
FROM zd_assort WHERE is_check = 1 ) END)
</otherwise>
</choose>
<include refid="beHospitalSeach"></include>
<include refid="beHospitalSearch"></include>
</sql>
<!--&lt;!&ndash;待审核节点查询&ndash;&gt;
@ -428,29 +413,29 @@
<!--未审核-->
AND
(
<foreach collection="status.split(',')" item="item" separator="or">
<choose>
<when test="item == 2">
ArchiveState IN ('1','16','48','512','256','272','304','768')
</when>
<when test="item == 3">
ArchiveState IN ('2','18',
'50','514')
</when>
<when test="item == 4">
ArchiveState IN ('6','22','54','518')
</when>
<when test="item == 5">
ArchiveState IN ('1','2','6','14','256','512','514','518','526','768')
</when>
<when test="item == 6">
ArchiveState IN ('16','18','22','30','272')
</when>
<when test="item == 7">
ArchiveState IN ('62')
</when>
</choose>
</foreach>
<foreach collection="status.split(',')" item="item" separator="or">
<choose>
<when test="item == 2">
ArchiveState IN ('1','16','48','512','256','272','304','768')
</when>
<when test="item == 3">
ArchiveState IN ('2','18',
'50','514')
</when>
<when test="item == 4">
ArchiveState IN ('6','22','54','518')
</when>
<when test="item == 5">
ArchiveState IN ('1','2','6','14','256','512','514','518','526','768')
</when>
<when test="item == 6">
ArchiveState IN ('16','18','22','30','272')
</when>
<when test="item == 7">
ArchiveState IN ('62')
</when>
</choose>
</foreach>
)
</otherwise>
</choose>
@ -458,33 +443,191 @@
</sql>
<!--公共查询字段-->
<sql id="selectColumms">
m.id,m.patient_id,m.inp_no,m.visit_id,m.name,m.sex,m.
dept_name,m.discharge_date_time,m.ArchiveState,m.admission_date_time,m.
dept_admission_to,m.LockInfo,m.DOCTOR_IN_CHARGE,m.D1
archive_master.id,
archive_master.patient_id,
archive_master.inp_no,
archive_master.visit_id,
archive_master.name,
archive_master.sex,
archive_master.dept_name,
archive_master.discharge_date_time,
archive_master.ArchiveState,
archive_master.admission_date_time,
archive_master.dept_admission_to,
archive_master.LockInfo,
archive_master.DOCTOR_IN_CHARGE,
archive_master.D1
</sql>
<!--查询存在麻醉记录且不完整的MasterId集合-->
<!--<sql id="checkAnaesthesiaSql">
SELECT DISTINCT
MasterID id
FROM
archive_detail
INNER JOIN archive_record_name_info ON CHARINDEX (
',' + Title + ',',
',' + archive_record_name_info.record_name + ','
) > 0
AND archive_detail.flag = 0
AND effective = 1
AND is_check = 11
<include refid="beHospitalSearch"></include>
<if test="masterIds != null and masterIds != ''">
and archive_detail.MasterID in (${masterIds})
</if>
</sql>-->
<!--查询不完整的麻醉记录-->
<sql id="unCompleteAnaesthesiaSql">
SELECT
archive_master.*
FROM
v_record_completeness_info archive_master
LEFT JOIN archive_detail ON archive_master.id = archive_detail.MasterID
AND archive_detail.flag = 0
AND CHARINDEX (
',' + Title + ',',
',' + archive_master.record_name + ','
) > 0
WHERE
is_check = 11
AND Title IS NULL
<include refid="beHospitalSearch"></include>
<if test="masterIds != null and masterIds != ''">
and archive_detail.MasterID in (${masterIds})
</if>
<choose>
<when test="isSuccess == 1">
and archive_detail.MasterID not in (<include refid="selectFaultMasterIds"></include>)
</when>
<otherwise>
or archive_detail.MasterID in (<include refid="selectFaultMasterIds"></include>)
</otherwise>
</choose>
<if test="userName!= null and userName != ''">
or archive_detail.MasterID in (
${masterIdsByTranDept}
)
</if>
</sql>
<!--自定义完整性校验查询-->
<select id="selectCompleteMasterIds" resultMap="BaseResultMap2">
SELECT
AVG(
CASE
WHEN Title IS NULL THEN
0
ELSE
1
END
) isSuccess,
<include refid="selectColumms"></include>
FROM
(
SELECT
*
FROM
v_record_completeness_info
WHERE
is_check = 1
<include refid="beHospitalSearch"></include>
<if test="masterIds != null and masterIds != ''">
and v_record_completeness_info.id in (${masterIds})
</if>
<choose>
<when test="isSuccess == 1">
and v_record_completeness_info.id not in (<include refid="selectFaultMasterIds"></include>)
</when>
<otherwise>
or v_record_completeness_info.id in (<include refid="selectFaultMasterIds"></include>)
</otherwise>
</choose>
<if test="userName!= null and userName != ''">
or v_record_completeness_info.id in (
${masterIdsByTranDept}
)
</if>
UNION ALL
<include refid="unCompleteAnaesthesiaSql"></include>
) archive_master
LEFT JOIN archive_detail ON archive_master.id = archive_detail.MasterID
AND archive_detail.flag = 0
AND CHARINDEX (
',' + Title + ',',
',' + archive_master.record_name + ','
) > 0
GROUP BY
<include refid="selectColumms"></include>
HAVING(AVG(case when Title is null then 0 else 1 end)) = #{isSuccess}
ORDER BY archive_master.discharge_date_time desc
</select>
<!--查询文件重复或缺少sysFlag in (3,4,6)的masterId集合-->
<sql id="selectFaultMasterIds">
SELECT DISTINCT
MasterID
FROM
(
SELECT
MasterID
FROM
archive_detail
LEFT JOIN archive_other_ext ON archive_other_ext.DID = archive_detail.id
AND MasterID = archive_other_ext.MID
WHERE
Source NOT IN (
'电子病历系统采集服务-长临医嘱',
'扫描上传',
'手工上传'
)
AND flag = 0
AND DID IS NULL
GROUP BY
MasterID,
Title
HAVING
(COUNT(Title)) > 1
UNION ALL
SELECT
MID MasterID
FROM
archive_other_ext
WHERE
sysFlag IN (3, 4, 6)
AND ISNULL(DID, '') = ''
AND ISNULL(MID, '') != ''
) temp
</sql>
<!--查询跨科室的MasterId集合-->
<sql id="selectTransDeptMasterIds">
select archive_master.id from archive_transfer_dept_user
inner join
archive_master
on archive_master.id = archive_transfer_dept_user.master_id
where user_name = #{userName}
<include refid="leaveHospitalCommomSearch"></include>
</sql>
<!---出院-->
<select id="selectByColumn" parameterType="com.emr.entity.Archive_Master_Vo" resultMap="BaseResultMap2">
select * from (
select <include refid="selectColumms"></include>
from archive_master m
/**带完整性查询*/
<if test="isSuccess != null and isSuccess != ''">
INNER JOIN (<include refid="searchSuccessForMasterIdList"></include>) temp
ON m.id = temp.id
</if>
where 1=1
<include refid="beHospitalSeach"></include>
<if test="userName != null and userName != ''">
union all
select <include refid="selectColumms"></include> from archive_transfer_dept_user
select
<include refid="selectColumms"></include>
from archive_master
<where><include refid="beHospitalSearch"></include></where>
<if test="userName!= null and userName != ''">UNION ALL
SELECT
<include refid="selectColumms"></include>
from
archive_transfer_dept_user
inner join
archive_master m
on m.id = archive_transfer_dept_user.master_id
archive_master
on
archive_master.id = archive_transfer_dept_user.master_id
where user_name = #{userName}
<include refid="beHospitalSeach1"></include>
</if>
) m
ORDER BY m.discharge_date_time desc
<include refid="leaveHospitalCommomSearch"></include>
</if>
) archive_master
ORDER BY archive_master.discharge_date_time desc
</select>
<!--终审-->
@ -505,10 +648,11 @@
'否' ELSE '是'
END checkName
from archive_master m
LEFT JOIN ( SELECT MasterID FROM archive_detail INNER JOIN archive_master ON archive_detail.MasterID = archive_master.id WHERE Source = '扫描上传' GROUP BY MasterID ) archive_detail ON m.id = archive_detail.MasterID
LEFT JOIN ( SELECT MasterID FROM archive_detail INNER JOIN archive_master ON archive_detail.MasterID =
archive_master.id WHERE Source = '扫描上传' GROUP BY MasterID ) archive_detail ON m.id = archive_detail.MasterID
where 1=1 and ArchiveState in ('64','1024')
<if test="checkName != null and checkName != ''">
AND MasterID IS
AND MasterID IS
<choose>
<when test="checkName == 0">
NULL
@ -524,19 +668,19 @@
<choose>
<!--已签收-->
<when test="isSign == 1">
in
in
</when>
<otherwise>
not in
</otherwise>
</choose>
(
<choose>
<when test="patientIdsForSign != null">
<foreach collection="patientIdsForSign" item="item" separator=",">#{item}</foreach>
</when>
<otherwise>'无效'</otherwise>
</choose>
<choose>
<when test="patientIdsForSign != null">
<foreach collection="patientIdsForSign" item="item" separator=",">#{item}</foreach>
</when>
<otherwise>'无效'</otherwise>
</choose>
)
</if>
<if test="id != null and id != ''">
@ -1152,45 +1296,45 @@
FROM
archive_master m
<where>
<if test="list != null">
and m.id IN(
<foreach collection="list" item="item" separator=",">#{item.id,jdbcType=NVARCHAR}</foreach>
)
</if>
<if test="list != null">
and m.id IN(
<foreach collection="list" item="item" separator=",">#{item.id,jdbcType=NVARCHAR}</foreach>
)
</if>
</where>
</select>
<!--根据科室权限查询主管医生列表-->
<select id="loadDoctorInCharge" resultMap="BaseResultMap">
SELECT
DOCTOR_IN_CHARGE
DOCTOR_IN_CHARGE
FROM
archive_master
archive_master
WHERE
DOCTOR_IN_CHARGE != ''
<if test="deptName != null and deptName != ''">
AND dept_name IN ( ${deptName} )
</if>
DOCTOR_IN_CHARGE != ''
<if test="deptName != null and deptName != ''">
AND dept_name IN ( ${deptName} )
</if>
GROUP BY
DOCTOR_IN_CHARGE
DOCTOR_IN_CHARGE
ORDER BY
DOCTOR_IN_CHARGE
DOCTOR_IN_CHARGE
</select>
<!--根据科室权限查询主管医生列表-->
<select id="loadOverTimeDoctorInCharge" resultMap="BaseResultMap">
SELECT
DOCTOR_IN_CHARGE
DOCTOR_IN_CHARGE
FROM
v_overtime_record
v_overtime_record
WHERE
DOCTOR_IN_CHARGE != ''
<if test="deptName != null and deptName != ''">
AND dept_name IN ( ${deptName} )
</if>
DOCTOR_IN_CHARGE != ''
<if test="deptName != null and deptName != ''">
AND dept_name IN ( ${deptName} )
</if>
GROUP BY
DOCTOR_IN_CHARGE
DOCTOR_IN_CHARGE
ORDER BY
DOCTOR_IN_CHARGE
DOCTOR_IN_CHARGE
</select>
<!--查询需要查询纸质状态的记账号集合-->
<select id="selectPatientIdsForSign" resultMap="BaseResultMap">

@ -0,0 +1,144 @@
<?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.CompleteTaskMapper">
<resultMap id="BaseResultMap" type="com.emr.vo.CompleteVo">
<id column="id" jdbcType="NVARCHAR" property="id"/>
<result column="is_check" jdbcType="INTEGER" property="isCheck"/>
<result column="record_name" jdbcType="NVARCHAR" property="recordName"/>
<result column="LockInfo" jdbcType="NVARCHAR" property="lockInfo"/>
</resultMap>
<!--根据最后一次刷表的时间查询出院记录里的且比刷表时间还晚的采集单的masterId集合-->
<select id="selectCompleteMasterIds" resultMap="BaseResultMap">
SELECT
archive_master.id,LockInfo
FROM
archive_master
INNER JOIN archive_detail ON archive_master.id = archive_detail.MasterID
WHERE
ArchiveState != '1024'
AND ArchiveState != '128'
AND YEAR (discharge_date_time) != '1801'
<if test="nowDate != null and nowDate != ''">
AND archive_detail.UpLoadDateTime >= #{nowDate}
</if>
GROUP BY
archive_master.id,LockInfo
</select>
<sql id="selectRecordCompletenessInfo">
(
SELECT
dbo.archive_record_name_info.record_name,
dbo.archive_record_name_info.is_check,
dbo.archive_master.id
FROM
dbo.archive_master
CROSS JOIN dbo.archive_record_name_info
WHERE
(
dbo.archive_record_name_info.effective = 1
)
AND (
dbo.archive_record_name_info.is_check
&lt;>
0
)
AND (
dbo.archive_record_name_info.contain_dept_name = '-1'
)
AND (
CHARINDEX (
',' + dbo.archive_master.dept_name + ',',
',' + dbo.archive_record_name_info.exclude_dept_name + ','
)&lt;= 0
)
OR (
dbo.archive_record_name_info.effective = 1
)
AND (
dbo.archive_record_name_info.is_check &lt;> 0
)
AND (
CHARINDEX (
',' + dbo.archive_master.dept_name + ',',
',' + dbo.archive_record_name_info.exclude_dept_name + ','
) &lt;= 0
)
AND (
CHARINDEX (
',' + dbo.archive_master.dept_name + ',',
',' + dbo.archive_record_name_info.contain_dept_name + ','
) > 0
)
)
</sql>
<!--查询自定义的完整性策略缺失-->
<select id="selectMasterIdByCustomComplete" resultMap="BaseResultMap">
SELECT
record_name,
Title,
is_check
FROM
<include refid="selectRecordCompletenessInfo"></include> record_completeness_info
LEFT JOIN archive_detail ON record_completeness_info.id = archive_detail.MasterID
AND CHARINDEX (
',' + Title + ',',
',' + record_completeness_info.record_name + ','
) > 0
AND archive_detail.flag = 0
WHERE
record_completeness_info.id = #{masterId}
and Title is null
</select>
<!--查询同组同时校验的文档名称集合-->
<select id="selectRecordNames" resultMap="BaseResultMap">
SELECT
record_name
FROM
archive_record_name_info
<where>
<if test="isCheck != null">
and is_check = #{isCheck}
</if>
</where>
</select>
<!--查询缺失的检验检查报告集合-->
<select id="selectMasterIdByInspection" resultMap="BaseResultMap">
SELECT
C1 recordName
FROM
archive_other_ext
WHERE
sysFlag IN (3, 4, 6)
AND ISNULL(DID, '') = ''
AND ISNULL(MID, '') != ''
AND MID = #{masterId}
</select>
<!--判断重复文件-->
<select id="selectMasterIdByRepeat" resultMap="BaseResultMap">
SELECT
archive_detail.Title recordName,
COUNT(Title) count
FROM
archive_detail
LEFT JOIN archive_other_ext ON archive_detail.MasterID = archive_other_ext.MID
AND archive_detail.id = archive_other_ext.DID
WHERE
MasterID = #{masterId}
AND Source NOT IN (
'电子病历系统采集服务-长临医嘱',
'扫描上传',
'手工上传'
)
AND flag = 0
AND archive_other_ext.ID IS NULL
GROUP BY
Title
HAVING
(COUNT(Title) > 1)
</select>
</mapper>

@ -353,7 +353,8 @@
FROM
archive_master
<!--校验完整性-->
<include refid="verificationComplete"></include>
where archive_master.LockInfo = '完整'
<!--<include refid="verificationComplete"></include>-->
<include refid="selectByDate"></include>
) count3
</select>
@ -410,7 +411,8 @@
FROM
archive_master
<!--校验完整性-->
<include refid="verificationComplete"></include>
where archive_master.LockInfo = '完整'
<!--<include refid="verificationComplete"></include>-->
<include refid="selectByDate1"></include>
GROUP BY
<include refid="formatDate"></include>
@ -527,6 +529,19 @@
</where>
</select>
<!--查询属于需要校验完整的集合-->
<select id="selectAllWithCompleteAssort" resultMap="BaseResultMap2">
SELECT
id,
ArchiveState,
LockInfo,
<include refid="formatDate"></include> discharge_date_time
FROM
archive_master
<where>
<include refid="selectByDate"></include>
</where>
</select>
<!--
<select id="selectAllWithCompleteAssort" resultMap="BaseResultMap2">
SELECT
id,
@ -567,6 +582,7 @@
ArchiveState,
<include refid="formatDate"></include>
</select>
-->
<!--查询分组日期-->
<select id="selectGroupDate" resultMap="BaseResultMap1">
SELECT

@ -839,7 +839,7 @@
</div>
</div>
</body>
<script src="${path}/static/js/beHospList/beHospList.js?time=2021-01-12"></script>
<script src="${path}/static/js/beHospList/beHospList.js?time=2021-02-08"></script>
<script src="${path}/static/js/hospitalCommom/hospitalCommom.js?time=2021-01-12"></script>
<script src="${path}/static/js/hospitalLoadPdf/loadPdf.js?time=2020-10-16"></script>
</html>

@ -88,7 +88,7 @@
<div class="content-right">
<iframe width="100%" src="" id="iframe1" frameborder="0" scrolling="yes"></iframe>
</div>
<script type="text/javascript" src="${path}/static/js/showRecord/showRecordIframe.js?time=2020-12-29_1"></script>
<script type="text/javascript" src="${path}/static/js/showRecord/showRecordIframe.js?time=2021-02-07"></script>
<script type="text/javascript" src="${path}/static/js/showRecord/showRecordIframeCommom.js"></script>
</body>
</html>

@ -376,7 +376,7 @@
</div>
<footer class="main-footer">
<div class="pull-right">
<b>Version</b> 20210125
<b>Version</b> 20210208
</div>
<strong>Copyright &copy; 2019-2090 厦门嘉时软件.</strong> All rights
reserved.

@ -14,7 +14,7 @@ function initTable() {
striped: true, //是否显示行间隔色
pagination: true, // 在表格底部显示分页组件默认false
paginationShowPageGo: true,
pageList: [10, 20, 50, 100], // 如果设置了分页设置可供选择的页面数据条数。设置为All 则显示所有记录。
pageList: [10, 20, 50], // 如果设置了分页设置可供选择的页面数据条数。设置为All 则显示所有记录。
sidePagination: 'server', // 设置为服务器端分页 客户端client
search: false,
showColumns: true,
@ -137,13 +137,13 @@ function initTable() {
},
{
title: '是否完整',
field: 'isSuccess',
field: 'lockinfo',
align: 'center',
valign: 'middle',
formatter:function(value, row){
if(value == '1'){
if(value == '完整'){
return '<span style="color:green">是</span>';
}else if(value == '0'){
}else{
return '<span style="color:red">否</span>';
}
}

@ -137,45 +137,47 @@ function onloadPdf(){
//获取业务识别编码
var typeFlag = parent.$("#typeFlag").val();
var detailIds = $("#detailIds").val();
if(typeFlag == 1){
url = path + "/font/getPdfToPdf";
params = {detailIds: detailIds};
}else if(typeFlag == 2) {
url = path + "/font/getPdfToPdfByOpId";
params = {detailIds: detailIds};
if (detailIds != '') {
var detailIdArr = detailIds.split(",");
//只有一个需要查询病案资料,赋值就诊科室和主治医生
var count = 0;
var filePath = '';
for(var i = 0;i<detailIdArr.length;i++){
if(detailIdArr[i] != ''){
count++;
filePath = detailIdArr[i].replace("\'","").replace("\'","");
if(detailIds != '') {
if (typeFlag == 1) {
url = path + "/font/getPdfToPdf";
params = {detailIds: detailIds};
} else if (typeFlag == 2) {
url = path + "/font/getPdfToPdfByOpId";
params = {detailIds: detailIds};
if (detailIds != '') {
var detailIdArr = detailIds.split(",");
//只有一个需要查询病案资料,赋值就诊科室和主治医生
var count = 0;
var filePath = '';
for (var i = 0; i < detailIdArr.length; i++) {
if (detailIdArr[i] != '') {
count++;
filePath = detailIdArr[i].replace("\'", "").replace("\'", "");
}
}
if (count == 1) {
loadRecord(filePath);
} else {
parent.$("#c7").val('');
parent.$("#c8").val('');
}
}
if (count == 1) {
loadRecord(filePath);
}else{
parent.$("#c7").val('');
parent.$("#c8").val('');
}
$.ajax({
type: 'post',
url: url,
data: params,
success: function (data) {
if (data.code == 100) {
var pdfUrl = path + "/static/pdfjs/web/viewer.html?file=" + path + "/font/showPdf";
$("#iframe1").attr("src", pdfUrl);
$("#iframe1").css("height", $("body")[0].offsetHeight)
} else {
toastr.error(data.msg);
}
}
}
})
}
$.ajax({
type: 'post',
url: url,
data: params,
success: function (data) {
if (data.code == 100) {
var pdfUrl = path + "/static/pdfjs/web/viewer.html?file=" + path + "/font/showPdf";
$("#iframe1").attr("src", pdfUrl);
$("#iframe1").css("height", $("body")[0].offsetHeight)
} else {
toastr.error(data.msg);
}
}
})
/*$("#iframe1").attr("src",path+"/static/pdfjs/web/viewer.html?file="+path+"/font/getPdfToPdf/"+patientId+"/"+detailIds);*/
}

Loading…
Cancel
Save