归档系统采集器修改

master
ALW 3 years ago
parent 914c1fb806
commit c6bcc27781

@ -37,6 +37,8 @@ public class ArchiveOtherExtController {
@RequestMapping("getArchiveExtInfo")
@ResponseBody
public OffsetLimitPage getArchiveExtInfo(Integer offset, Integer limit, ArchiveOtherExtVo archiveOtherExtVo, HttpServletRequest request){
// String s = archiveOtherExtVo.getId().toString();
// archiveOtherExtVo.setMid(s);
if(null != offset && null != limit) {
PageHelper.offsetPage(offset, limit);
}
@ -90,6 +92,12 @@ public class ArchiveOtherExtController {
archiveOtherExtService.updateSubmit(ids,notNursingIds,detailIds,jzh,masterId,sysFlag,request);
return Msg.success();
}
@RequestMapping("submitUpdate1")
@ResponseBody
public Msg submitUpdate1(String ids){
archiveOtherExtService.updateSubmit1(ids);
return Msg.success();
}
/**
* id
@ -117,6 +125,23 @@ public class ArchiveOtherExtController {
return Msg.fail("参数ids不能为空");
}
}
/**
* id
* @param ids
* @return
* @throws Exception
*/
@RequestMapping("selectAllByIdsAndSubmitTime1")
@ResponseBody
public int selectSuccessByExtIds1(String ids) {
Integer i = archiveOtherExtService.SuccessByExtIds1(ids);
if (i==0){
//返回1是采集完毕2还没完成采集
return 1;
}else {
return 0;
}
}
/**
*

@ -33,6 +33,7 @@ public interface ArchiveOtherExtMapper {
*/
List<ArchiveOther> selectAllByIdsAndSubmitTime(@Param("ids")String ids,@Param("patientId")String patientId);
Integer SuccessByExtIds1(@Param("ids")String ids);
/**
*
* @param patientId

@ -10,6 +10,7 @@ import com.emr.entity.ArchiveOtherExtSubmittime;
import com.emr.vo.ArchiveOtherExtVo;
import com.emr.vo.KeyValue;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.apache.shiro.util.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -148,6 +149,10 @@ public class ArchiveOtherExtService {
operOtherExtSubmitInfo(ids,idsStr,detailIds,request);
}
public void updateSubmit1(String ids){
archiveOtherExtMapper.updateSubmit(ids);
}
/**
*
* 1.idsTemparchive_other
@ -337,6 +342,9 @@ public class ArchiveOtherExtService {
public List<ArchiveOther> selectAllByIdsAndSubmitTime(String ids,String jzh) {
return archiveOtherExtMapper.selectAllByIdsAndSubmitTime(ids,jzh);
}
public Integer SuccessByExtIds1(String ids){
return archiveOtherExtMapper.SuccessByExtIds1(ids);
}
/**
*

@ -32,10 +32,7 @@ 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;
import java.util.Set;
import java.util.*;
/**
* @author zwh
@ -322,7 +319,8 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
PageHelper.offsetPage(offset, limit);
}
archiveMasterVo.setIsSuccess(null);
list = archiveMasterMapper.selectMasterByColumn(archiveMasterVo);
list = archiveMasterMapper.selectByColumn(archiveMasterVo);
//组织完整性字段并完整的更新archive_master表的完整性字段值为完整LockInfo='完整'
//updateMasterBySuccess(list);
//转换科室与赋值超期天数
@ -356,6 +354,44 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
}
}
}*/
Emr_Dictionary dictionary = new Emr_Dictionary();
dictionary.setTypecode("dept_code");
List<Emr_Dictionary> dictionaries = dictionaryMapper.dicByTypeCode(dictionary);
for (Archive_Master_Vo masterVo : list) {
//科室名称编码转名称
deptNameCode2Name(dictionaries, masterVo);
//状态均为护士长已质控,取出一个对象,转换中文状态
Integer status = Integer.valueOf(masterVo.getArchivestate());
if(status.equals(EnumVerify.DocState.HeadNurseCheck.getCode())){
masterVo.setStatus(EnumVerify.DocState.HeadNurseCheck.getName());
}else if(status.equals(EnumVerify.DocState.CallBacked.getCode())){
masterVo.setStatus(EnumVerify.DocState.CallBacked.getName());
}
}
if (null != list && !list.isEmpty()) {
List<ArchiveFlowRole> flowRoles = this.flowRoleMapper.selectAll();
Msg role = this.getRole();
if (null != role) {
Iterator var8 = list.iterator();
while(var8.hasNext()) {
Archive_Master_Vo masterVo = (Archive_Master_Vo)var8.next();
String archivestate = masterVo.getArchivestate();
if (StringUtils.isNotBlank(archivestate)) {
boolean numeric = this.isNumeric(archivestate);
if (numeric) {
Integer status = Integer.valueOf(archivestate);
archivestate = EnumVerify.DocState.GetStepName(status, role.getCode());
String currentArchivestate = EnumVerify.DocState.GetCurrentStepName(status, role.getCode());
masterVo.setStatus(archivestate);
masterVo.setCurrentStatus(currentArchivestate);
String btns = this.getBtns(status, flowRoles, masterVo.getId());
masterVo.setBtns(btns);
}
}
}
}
}
return list;
}

@ -433,95 +433,141 @@
</if>
</sql>
<select id="getArchiveExtInfo" resultMap="BaseResultMap">
select temp.*,zd_assort.assort_name,zd_assort.assort_id,
archive_other_ext_submitTime.create_time,archive_other_ext_submitTime.str2 tempTime,
CASE
WHEN sysFlag = 1 THEN
CASE
WHEN archive_other_ext_submitTime.str2 IS NOT NULL
AND archive_other_ext_submitTime.str2 >= (select top 1 convert(varchar(19),eTime,120) eTime from archive_other_ext where sysFlag = 1 and jzh = temp.jzh order by eTime desc) THEN
- 1
ELSE
statusFlag
END
ELSE
CASE
WHEN archive_other_ext_submitTime.str2 IS NOT NULL
AND archive_other_ext_submitTime.str2 >= etimeStr THEN
- 1
ELSE
statusFlag
END
END
statusFlagSort
from (
select
archive_other_ext.ID idTemp,
SycTime,
sysFlag,
CONVERT(varchar(19),sysUpdateTime,120) sysupdatetimeStr,
CONVERT(varchar(19),stime,120) stimeStr,
CONVERT(varchar(19),eTime,120) etimeStr,
statusFlag,
pResult,
C1,
DID,
jzh
from archive_other_ext
<where>
C1 != '一般病程记录' and sysFlag != 5
<include refid="selectWhereSql"></include>
</where>
union all
select
top 1
archive_other_ext.ID idTemp,
SycTime,
sysFlag,
CONVERT(varchar(19),sysUpdateTime,120) sysupdatetimeStr,
CONVERT(varchar(19),stime,120) stimeStr,
CONVERT(varchar(19),eTime,120) etimeStr,
statusFlag,
pResult,
'手麻系统病历' as C1,
DID,
jzh
from archive_other_ext
<where>
and sysFlag = 5 /*and (C1 = '术前访视' or C1 = '术后访视' or C1 = '麻醉记录' or C1 = '麻醉小结')*/
<include refid="selectWhereSql"></include>
</where>
union all
select
top 1
archive_other_ext.ID idTemp,
SycTime,
sysFlag,
CONVERT(varchar(19),sysUpdateTime,120) sysupdatetimeStr,
CONVERT(varchar(19),stime,120) stimeStr,
CONVERT(varchar(19),eTime,120) etimeStr,
statusFlag,
pResult,
C1,
DID,
jzh
from archive_other_ext
<where>
C1 = '一般病程记录'
<include refid="selectWhereSql"></include>
</where>
order by sysUpdateTime desc
) temp
LEFT JOIN archive_detail ON temp.DID = archive_detail.id
LEFT JOIN zd_assort ON archive_detail.AssortID = zd_assort.assort_id
LEFT JOIN archive_other_ext_submitTime
ON archive_other_ext_submitTime.other_ext_id = temp.idTemp
<where>
<if test="assortId != null and assortId != ''">
and zd_assort.assort_id = #{assortId,jdbcType=NVARCHAR}
</if>
</where>
order by statusFlagSort
<!--select temp.*,zd_assort.assort_name,zd_assort.assort_id,-->
<!--archive_other_ext_submitTime.create_time,archive_other_ext_submitTime.str2 tempTime,-->
<!--CASE-->
<!--WHEN sysFlag = 1 THEN-->
<!--CASE-->
<!--WHEN archive_other_ext_submitTime.str2 IS NOT NULL-->
<!--AND archive_other_ext_submitTime.str2 >= (select top 1 convert(varchar(19),eTime,120) eTime from archive_other_ext where sysFlag = 1 and jzh = temp.jzh order by eTime desc) THEN-->
<!-- - 1-->
<!--ELSE-->
<!--statusFlag-->
<!--END-->
<!--ELSE-->
<!--CASE-->
<!--WHEN archive_other_ext_submitTime.str2 IS NOT NULL-->
<!--AND archive_other_ext_submitTime.str2 >= etimeStr THEN-->
<!-- - 1-->
<!--ELSE-->
<!--statusFlag-->
<!--END-->
<!--END-->
<!--statusFlagSort-->
<!--from (-->
<!--select-->
<!--archive_other_ext.ID idTemp,-->
<!--SycTime,-->
<!--sysFlag,-->
<!--CONVERT(varchar(19),sysUpdateTime,120) sysupdatetimeStr,-->
<!--CONVERT(varchar(19),stime,120) stimeStr,-->
<!--CONVERT(varchar(19),eTime,120) etimeStr,-->
<!--statusFlag,-->
<!--pResult,-->
<!--C1,-->
<!--DID,-->
<!--jzh-->
<!--from archive_other_ext-->
<!--<where>-->
<!--C1 != '一般病程记录' and sysFlag != 5-->
<!--<include refid="selectWhereSql"></include>-->
<!--</where>-->
<!--union all-->
<!--select-->
<!--top 1-->
<!--archive_other_ext.ID idTemp,-->
<!--SycTime,-->
<!--sysFlag,-->
<!--CONVERT(varchar(19),sysUpdateTime,120) sysupdatetimeStr,-->
<!--CONVERT(varchar(19),stime,120) stimeStr,-->
<!--CONVERT(varchar(19),eTime,120) etimeStr,-->
<!--statusFlag,-->
<!--pResult,-->
<!--'手麻系统病历' as C1,-->
<!--DID,-->
<!--jzh-->
<!--from archive_other_ext-->
<!--<where>-->
<!--and sysFlag = 5 /*and (C1 = '术前访视' or C1 = '术后访视' or C1 = '麻醉记录' or C1 = '麻醉小结')*/-->
<!--<include refid="selectWhereSql"></include>-->
<!--</where>-->
<!--union all-->
<!--select-->
<!--top 1-->
<!--archive_other_ext.ID idTemp,-->
<!--SycTime,-->
<!--sysFlag,-->
<!--CONVERT(varchar(19),sysUpdateTime,120) sysupdatetimeStr,-->
<!--CONVERT(varchar(19),stime,120) stimeStr,-->
<!--CONVERT(varchar(19),eTime,120) etimeStr,-->
<!--statusFlag,-->
<!--pResult,-->
<!--C1,-->
<!--DID,-->
<!--jzh-->
<!--from archive_other_ext-->
<!--<where>-->
<!--C1 = '一般病程记录'-->
<!--<include refid="selectWhereSql"></include>-->
<!--</where>-->
<!--order by sysUpdateTime desc-->
<!--) temp-->
<!--LEFT JOIN archive_detail ON temp.DID = archive_detail.id-->
<!--LEFT JOIN zd_assort ON archive_detail.AssortID = zd_assort.assort_id-->
<!--LEFT JOIN archive_other_ext_submitTime-->
<!--ON archive_other_ext_submitTime.other_ext_id = temp.idTemp-->
<!--<where>-->
<!--<if test="assortId != null and assortId != ''">-->
<!--and zd_assort.assort_id = #{assortId,jdbcType=NVARCHAR}-->
<!--</if>-->
<!--</where>-->
<!--order by statusFlagSort-->
select
archive_other_ext.ID idTemp,
archive_other_ext_submitTime.create_time,
archive_other_ext_submitTime.str2 tempTime,
SycTime,
sysFlag,
zd_assort.assort_name,
zd_assort.assort_id,
CONVERT(varchar(19),sysUpdateTime,120) sysupdatetimeStr,
CONVERT(varchar(19),stime,120) stimeStr,
CONVERT(varchar(19),eTime,120) etimeStr,
statusFlag,
pResult,
archive_other_ext.C2,
DID,
jzh,
CASE
WHEN sysFlag = 1 THEN
CASE
WHEN archive_other_ext_submitTime.str2 IS NOT NULL
AND archive_other_ext_submitTime.str2 >= (select top 1 convert(varchar(19),eTime,120) eTime from archive_other_ext where sysFlag = 1 and jzh = archive_other_ext.jzh order by eTime desc) THEN
- 1
ELSE
statusFlag
END
ELSE
CASE
WHEN archive_other_ext_submitTime.str2 IS NOT NULL
AND archive_other_ext_submitTime.str2 >= CONVERT(varchar(19),eTime,120) THEN
- 1
ELSE
statusFlag
END
END
statusFlagSort
from
archive_other_ext
LEFT JOIN archive_other_ext_submitTime ON archive_other_ext_submitTime.other_ext_id=archive_other_ext.MID
LEFT JOIN archive_detail ON archive_other_ext.DID = archive_detail.id
LEFT JOIN zd_assort ON archive_detail.AssortID = zd_assort.assort_id
<where>
<if test="assortId != null and assortId != ''">
and zd_assort.assort_id = #{assortId,jdbcType=NVARCHAR}
</if>
</where>
order by statusFlagSort
</select>
<select id="selectAllByIds" resultMap="BaseResultMap">
select *,
@ -531,7 +577,7 @@
<!--批量更新statusFlag = 0-->
<update id="updateSubmit">
update archive_other_ext
set statusFlag = 0,T2 = '1801-02-03'
set statusFlag = 2
<where>
<if test="ids != null and ids != ''">
ID in (${ids})
@ -743,7 +789,16 @@
AND sysFlag = - 300
<include refid="disDateRangeWhereSql"></include>
</select>
<!--出院日期范围的功能查询语句-->
<select id="SuccessByExtIds1" resultType="java.lang.Integer" parameterType="java.lang.Integer">
select count(*)
from archive_other_ext
where id in (${ids})
and statusFlag =2 AND statusFlag !=0
</select>
<!--出院日期范围的功能查询语句-->
<sql id="disDateRangeWhereSql">
<choose>
<when test="startDateTo != null and startDateTo != '' and endDateTo != null and endDateTo != ''">

@ -745,7 +745,7 @@
and admission_date_time &lt;= #{endDate,jdbcType=NCHAR}+ ' 23:59:59'
</when>
</choose>
and discharge_date_time='1801-02-03 00:00:00'
and discharge_date_time ='1801-02-03 00:00:00'
ORDER BY admission_date_time desc
</select>

@ -150,32 +150,32 @@ function initTable() {
}
}
},
{
title: 'HIS召回状态',
field: 'callBackStatus',
align: 'center',
valign: 'middle',
formatter:function(value, row){
if(value == '是'){
return '<span style="color:green">是</span>';
}else{
return '<span style="color:red">否</span>';
}
}
},
{
title: '打印状态',
field: 'printStatus',
align: 'center',
valign: 'middle',
formatter:function(value, row){
if(value == '是'){
return '<span style="color:green">是</span>';
}else{
return '<span style="color:red">否</span>';
}
}
},
// {
// title: 'HIS召回状态',
// field: 'callBackStatus',
// align: 'center',
// valign: 'middle',
// formatter:function(value, row){
// if(value == '是'){
// return '<span style="color:green">是</span>';
// }else{
// return '<span style="color:red">否</span>';
// }
// }
// },
// {
// title: '打印状态',
// field: 'printStatus',
// align: 'center',
// valign: 'middle',
// formatter:function(value, row){
// if(value == '是'){
// return '<span style="color:green">是</span>';
// }else{
// return '<span style="color:red">否</span>';
// }
// }
// },
{
title: "操作",
align: 'left',

@ -1204,13 +1204,10 @@ function initTable5(data,sidePagination) {
events: {
'click .editInfo': function (e, value, row, index) {
var id = row.idTemp;
var sysflag = row.sysflag;
var notNursingIds = '';
if(sysflag != 1){
sysflag = '';
notNursingIds = id;
}
submitUpdate(id,notNursingIds,row.did,sysflag);
var sysFlagStr =row.sysFlagStr;
var sysFlagArray1 = row.sysFlagArray;
console.log(row.sysFlagArray)
submitUpdate(id,sysFlagStr,sysFlagArray1);
}
}
},
@ -1222,7 +1219,7 @@ function initTable5(data,sidePagination) {
},
{
title: '标题',
field: 'c1',
field: 'c2',
align: 'left',
valign: 'middle',
formatter: function (value, row, index) {
@ -1330,6 +1327,7 @@ function initTable5(data,sidePagination) {
option.url = path+"/archiveExt/getArchiveExtInfo";
}else{
option.data = data;
}
$("#table5").bootstrapTable(option);
}
@ -1398,20 +1396,52 @@ function cancleListentingSuccess(){
}
//提交同步采集
function submitUpdate(ids,notNursingIds,detailIds,sysFlag) {
function submitUpdate(ids,sysFlagStr) {
//记录需要监听的数据
addListentingData(ids);
//addListentingData(ids);
//撤销定时
clearInterval(timeInterval);
var jzh = $("#patientId").val();
var consumeTime = '';
var consumeTImeSum = 0;
var consumeTImeArray = [];
$.ajax({
type:'post',
url:path+'/archiveExt/submitUpdate',
data:{ids:ids,notNursingIds:notNursingIds,detailIds:detailIds,jzh:jzh,masterId:$("#idLab").text(),sysFlag:sysFlag},
url:path+'/archiveExt/submitUpdate1',
data:{ids:ids},
dataType:'json',
success:function (data) {
if(data.code == 100){
toastr.success("同步更新已发送,请耐心等待!");
for (var i = 0; i < sysFlagStr.length; i++){
switch(sysFlagStr[i]) {
case "护理文书":
consumeTime = 1
break
case "电子病历":
consumeTime =1
break
case "Pacs检查":
consumeTime =1
break
case "心电图":
consumeTime =1
break
case "手麻信息":
consumeTime =2
break
case "Lis检验":
consumeTime =1
break
case "病案首页":
consumeTime =3
break
case "长临医嘱":
consumeTime =2
break
}
consumeTImeSum +=consumeTime
}
toastr.success("同步更新已发送,预计"+consumeTImeSum+"分钟请耐心等待!");
//刷新列表
initTable5('','server');
setTimeout(function() {
@ -1419,50 +1449,31 @@ function submitUpdate(ids,notNursingIds,detailIds,sysFlag) {
},500);
$("#loading").show();
timeInterval = setInterval(function () {
if(otherExtIds != '') {
//其他
$.ajax({
type: 'get',
url: path + '/archiveExt/selectAllByIdsAndSubmitTime',
data: {ids: otherExtIds,jzh:jzh},
dataType: 'json',
async:false,
success: function (result) {
if (result.code == 100) {
var data = result.extend.list.length;
if(otherExtIds.split(",").length == data){
if(sysFlag == 1){
//包括护理
//撤销监听
clearInterval(timeInterval);
//执行业务
setTimeout(function(){
toastr.success("按需采集全部完成,页面将在" + times + "秒后自动刷新");
//刷新列表
initTable5('','server');
setTimeout(function() {
$('#table5').bootstrapTable('selectPage', pageNumber);
},500);
//撤销监听
cancleListentingSuccess();
},nurseTimes*1000);
}else{
toastr.success("按需采集全部完成,页面将在" + times + "秒后自动刷新");
setTimeout(function(){
//刷新列表
initTable5('','server');
setTimeout(function() {
$('#table5').bootstrapTable('selectPage', pageNumber);
},500);
},times*1000);
//撤销监听
cancleListentingSuccess();
}
}
}
//其他
$.ajax({
type: 'get',
url: path + '/archiveExt/selectAllByIdsAndSubmitTime1',
data: {ids: ids},
dataType: 'json',
async:false,
success: function (result) {
if (result == 1) {
//撤销监听
clearInterval(timeInterval);
//执行业务
setTimeout(function(){
toastr.success("按需采集全部完成,页面将在" + times + "秒后自动刷新");
//刷新列表
initTable5('','server');
setTimeout(function() {
$('#table5').bootstrapTable('selectPage', pageNumber);
},500);
//撤销监听
cancleListentingSuccess();
},times*1000);
}
})
}
}
})
/*setTimeout(function(){
toastr.error("后台按需采集超时,请联系系统运维人员");
//隐藏加载控件
@ -1482,37 +1493,30 @@ $("#searchBtn6").click(function(){
toastr.warning("请至少选中一个!");
}else{
var ids = '';
var sysflag = '';
var notNursingIds = '';
var detailIds = '';
var sysFlagArray=[];
for (var i = 0; i < data.length; i++) {
var id = data[i].idTemp;
var detailId = data[i].did;
if(detailId == ''){
//占位
detailId = null;
}
//拼接detailId
if(detailIds != ''){
detailIds += ',';
}
detailIds += detailId;
//拼接id
if(ids != ''){
ids += ',';
}
ids += id;
if(data[i].sysflag == 1){
//判断包含护理
sysflag = 1;
}else{
//拼接不包含护理的id
if(notNursingIds != ''){
notNursingIds += ',';
}
notNursingIds += id;
sysFlagArray.push(data[i].sysFlagStr);
if(ids!=''){
ids += ",";
}
ids += data[i].idTemp;
}
submitUpdate(ids,notNursingIds,detailIds,sysflag);
sysFlagArray=unique(sysFlagArray);
console.log(sysFlagArray)
submitUpdate(ids,sysFlagArray);
}
})
function unique (arr) {
return Array.from(new Set(arr))
// for (var i = 0; i < sysFlagStrsss.length; i++) {
//
// sysFlagStrss +=sysFlagStrsss[i]
// if(i !=sysFlagStrss.length-1){
// sysFlagStrss += ",";
// }
// }
}

Loading…
Cancel
Save