1.医嘱任务重新采集未改结束时间,修改重新采集置按需表archive_other.C1为空串,判断该逻辑作为是否重新采集完成标识

4.出院浏览、终审浏览页面HIS召回7天显示召回完成
gaoming_branch
zengwh 3 years ago
parent dd9ad7f5ee
commit 313d9714ec

Binary file not shown.

@ -3,6 +3,7 @@ package com.emr.controller;
import com.emr.entity.ArchiveOther;
import com.emr.entity.OffsetLimitPage;
import com.emr.service.ipml.ArchiveOtherExtService;
import com.emr.service.ipml.ArchiveOtherService;
import com.emr.util.ExceptionPrintUtil;
import com.emr.util.ExportExcelUtil;
import com.emr.util.Msg;
@ -28,6 +29,8 @@ import java.util.List;
public class ArchiveOtherExtController {
@Autowired
private ArchiveOtherExtService archiveOtherExtService;
@Autowired
private ArchiveOtherService archiveOtherService;
/**
*
* @param offset
@ -114,6 +117,9 @@ public class ArchiveOtherExtController {
}
}
List<ArchiveOther> list = archiveOtherExtService.selectAllByIdsAndSubmitTime(temp.toString(),jzh);
//判断遗嘱
List<ArchiveOther> archiveOthers = archiveOtherService.selectAllByC2(temp.toString(),"Done",-8);
list.addAll(archiveOthers);
return Msg.success().add("list",list);
}else{
return Msg.fail("参数ids不能为空");

@ -630,7 +630,7 @@ public class FontController {
//已归档
return Msg.success().add("data",1);
}
archiveOtherService.updateArchiveOther(patientId,masterId);
archiveOtherService.updateArchiveOther(patientId,masterId,null,null);
return Msg.success();
}

@ -23,13 +23,13 @@ public interface ArchiveOtherMapper extends CommomMapper{
* @param patientId
* @return
*/
List<ArchiveOther> selectExistByPatientId(String patientId);
List<ArchiveOther> selectExistByPatientId(@Param("patientId") String patientId,@Param("sysFlag")Integer sysFlag);
/**
* c2
* @param c2s
* @return
*/
List<ArchiveOther> selectAllByC2(@Param("c2s")String c2s,@Param("c1")String c1);
List<ArchiveOther> selectAllByC2(@Param("c2s")String c2s,@Param("c1")String c1,@Param("sysFlag")Integer sysFlag);
/**
* c2c1
* @param c2s

@ -21,6 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import java.io.*;
import java.text.CollationElementIterator;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
@ -56,6 +57,8 @@ public class ArchiveOtherExtService {
String maxETime = archiveOtherExtMapper.selectMaxETimeByNursingAndJzh(archiveOtherExtVo.getJzh());
archiveOtherExtVo.setNursingEndTime(maxETime);
for (ArchiveOtherExtVo vo : list) {
//遗嘱特殊处理结束时间
operYizhuETime(vo);
if (vo.getSysflag().equals(1)) {
if (StringUtils.isNotBlank(maxETime)) {
vo.setNursingEndTime(maxETime);
@ -99,6 +102,27 @@ public class ArchiveOtherExtService {
return list;
}
/**
* @Description: operYizhuETimeeTime使archive_otherT2
* @param: [vo]
* @return: void
* @author
* @createTime 2022/5/21 22:29
*/
private void operYizhuETime(ArchiveOtherExtVo vo) {
Integer sysflag = vo.getSysflag();
if(null != sysflag && sysflag == 8){
String extId = "'" + vo.getIdTemp() + "'";
//查询该archive_other
List<ArchiveOther> archiveOthers = archiveOtherService.selectAllByC2(extId.toString(),"Done",-8);
if(!CollectionUtils.isEmpty(archiveOthers)){
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
vo.setEtimeStr(fmt.format(archiveOthers.get(0).getT2()));
}
}
}
/**
* json
* @param request
@ -138,7 +162,7 @@ public class ArchiveOtherExtService {
//存在护理记录则调用护理按需采集功能
if(null != sysFlag && sysFlag == 1) {
//调用护理按需采集功能
archiveOtherService.updateArchiveOther(jzh, masterId);
archiveOtherService.updateArchiveOther(jzh, masterId,null,null);
//ext表更新非护理记录
if(StringUtils.isNotBlank(notNursingIds)){
idsTemp = splitString2String(notNursingIds);
@ -146,7 +170,7 @@ public class ArchiveOtherExtService {
}
//ext表更新非护理记录
if(StringUtils.isNotBlank(notNursingIds)){
updateCommomSubmit(idsTemp);
updateCommomSubmit(jzh, masterId,idsTemp);
}
//操作提交信息表
operOtherExtSubmitInfo(ids,idsStr,detailIds,request);
@ -159,9 +183,66 @@ public class ArchiveOtherExtService {
* 3.
* @param idsTemp
*/
private void updateCommomSubmit(String idsTemp) throws Exception {
private void updateCommomSubmit(String jzh,String masterId,String idsTemp) throws Exception {
//判断是存在遗嘱sysFlag = 8
//查询是否存在遗嘱集合
List<ArchiveOtherExt> yizhuOtherExts = archiveOtherExtMapper.selectListBySysFlagAndIds(8, idsTemp);
//定义非护理和遗嘱的id集合
StringBuilder notNurseAndYizhuIds = new StringBuilder();
if(CollectionUtils.isEmpty(yizhuOtherExts)){
notNurseAndYizhuIds = new StringBuilder(idsTemp);
}else{
String[] extIdArr = idsTemp.split(",");
//定义遗嘱id
StringBuilder yizhuExtIds = new StringBuilder();
//定义遗嘱的extId
Long yizhuExtIdLong = null;
for(String extId : extIdArr){
//定义是否是遗嘱id
boolean flag = false;
//遍历遗嘱任务集合
for(ArchiveOtherExt ext : yizhuOtherExts){
String yizhuExtId = "'" + ext.getId() + "'";
if(extId.equals(yizhuExtId)){
if(StringUtils.isNotBlank(yizhuExtIds)){
yizhuExtIds.append(",");
}
yizhuExtIds.append("'").append(extId).append("'");
flag = true;
//接收遗嘱id
yizhuExtIdLong = ext.getId();
break;
}
}
if(!flag){
if(StringUtils.isNotBlank(notNurseAndYizhuIds)){
notNurseAndYizhuIds.append(",");
}
notNurseAndYizhuIds.append("'").append(extId).append("'");
}
}
if(StringUtils.isNotBlank(yizhuExtIds)){
archiveOtherService.updateArchiveOther(jzh, masterId,-8,yizhuExtIdLong);
}
}
if(StringUtils.isBlank(notNurseAndYizhuIds)){
return;
}
//同步更新非护理和遗嘱部分
updateNotNurseAndYizhu(notNurseAndYizhuIds.toString());
}
/**
* @Description: updateNotNurseAndYizhu
* @param: [idsTemp]
* @return: void
* @author
* @createTime 2022/5/21 20:19
*/
private void updateNotNurseAndYizhu(String idsTemp) throws Exception {
//根据other_ext的id查询存在c2字段值的集合
List<ArchiveOther> archiveOthers = archiveOtherService.selectAllByC2(idsTemp,null);
List<ArchiveOther> archiveOthers = archiveOtherService.selectAllByC2(idsTemp,null,null);
//定义需要新增的id集合
String notExistTemp = "";
if(!CollectionUtils.isEmpty(archiveOthers)){

@ -38,9 +38,9 @@ public class ArchiveOtherService {
* C1''
* @param patientId
*/
public void updateArchiveOther(String patientId,String masterId) throws Exception{
public void updateArchiveOther(String patientId,String masterId,Integer sysFlag,Long extId) throws Exception{
//查询记账号是否存在
List<ArchiveOther> archiveOthers = archiveOtherMapper.selectExistByPatientId(patientId);
List<ArchiveOther> archiveOthers = archiveOtherMapper.selectExistByPatientId(patientId,sysFlag);
if(!CollectionUtils.isEmpty(archiveOthers)){
//存在则将C1值置为空字符串
ArchiveOther archiveOther = archiveOthers.get(0);
@ -51,6 +51,9 @@ public class ArchiveOtherService {
ArchiveOtherExtVo extObj = new ArchiveOtherExtVo();
extObj.setJzh(patientId);
extObj.setMid(masterId);
//非护理的需要的
extObj.setSysflag(sysFlag);
extObj.setId(extId);
//填充数据
ArchiveOther archiveOther = getArchiveOther(extObj);
archiveOtherMapper.insert(archiveOther);
@ -129,6 +132,10 @@ public class ArchiveOtherService {
sysFlagTemp = -8;
otherInfo = "医嘱";
break;
case -8:
sysFlagTemp = -8;
otherInfo = "医嘱";
break;
default:
break;
}
@ -143,7 +150,7 @@ public class ArchiveOtherService {
* @return
*/
public int selectC1ByPatientId(String patientId) {
List<ArchiveOther> archiveOthers = archiveOtherMapper.selectExistByPatientId(patientId);
List<ArchiveOther> archiveOthers = archiveOtherMapper.selectExistByPatientId(patientId,null);
if(!CollectionUtils.isEmpty(archiveOthers)){
//获取对象
ArchiveOther archiveOther = archiveOthers.get(0);
@ -164,8 +171,8 @@ public class ArchiveOtherService {
* @param c1
* @return
*/
public List<ArchiveOther> selectAllByC2(String c2s,String c1){
return archiveOtherMapper.selectAllByC2(c2s,c1);
public List<ArchiveOther> selectAllByC2(String c2s,String c1,Integer sysFlag){
return archiveOtherMapper.selectAllByC2(c2s,c1,sysFlag);
}
/**

@ -266,12 +266,22 @@
</update>
<!--根据记账号查询数据是否存在-->
<select id="selectExistByPatientId" resultMap="BaseResultMap">
select * from archive_other with(nolock) where sysFlag = -2 and pid = #{patientId}
select * from archive_other with(nolock) where
<if test="sysFlag == null">
sysFlag = -2
</if>
<if test="sysFlag != null">
sysFlag = #{sysFlag}
</if>
and pid = #{patientId}
</select>
<select id="selectAllByC2" resultMap="BaseResultMap">
select * from archive_other with(nolock) where C2 in (${c2s})
<if test="sysFlag != null">
AND sysFlag = #{sysFlag}
</if>
<if test="c1 != null and c1 != null">
AND C1 = 'done'
AND C1 = 'Done'
</if>
</select>
<update id="updateBatchC1ByC2s">

@ -613,7 +613,7 @@
</sql>
<sql id="selectCallBackList">
(select distinct jzh from archive_other_ext where sysFlag = -300)
(select jzh,max(sysUpdateTime) sysUpdateTime from archive_other_ext where sysFlag = -300 GROUP BY jzh)
</sql>
<sql id="selectPatientIdByPrintInfo">
@ -625,8 +625,12 @@
select
<include refid="selectColumms"></include>,
CASE
WHEN jzh IS NOT NULL THEN
'是'
WHEN (jzh IS NOT NULL AND datediff(day,archive_other_ext.sysUpdateTime,GETDATE()) &lt; 7)
THEN
'召回中'
WHEN (jzh IS NOT NULL AND datediff(day,archive_other_ext.sysUpdateTime,GETDATE()) >= 7)
THEN
'召回完成'
ELSE
'否'
END callBackStatus,
@ -665,8 +669,12 @@
SELECT
<include refid="selectColumms"></include>,
CASE
WHEN jzh IS NOT NULL THEN
'是'
WHEN (jzh IS NOT NULL AND datediff(day,archive_other_ext.sysUpdateTime,GETDATE()) &lt; 7)
THEN
'召回中'
WHEN (jzh IS NOT NULL AND datediff(day,archive_other_ext.sysUpdateTime,GETDATE()) >= 7)
THEN
'召回完成'
ELSE
'否'
END callBackStatus,
@ -714,8 +722,12 @@
'已签收' ELSE '未签收'
END remark,
CASE
WHEN jzh IS NOT NULL THEN
WHEN (jzh IS NOT NULL AND datediff(day,archive_other_ext.sysUpdateTime,GETDATE()) &lt; 7)
THEN
'召回中'
WHEN (jzh IS NOT NULL AND datediff(day,archive_other_ext.sysUpdateTime,GETDATE()) >= 7)
THEN
'召回完成'
ELSE
'否'
END callBackStatus,

@ -156,8 +156,8 @@ function initTable() {
align: 'center',
valign: 'middle',
formatter:function(value, row){
if(value == '召回中'){
return '<span style="color:green">召回中</span>';
if(value != '否'){
return '<span style="color:green">'+value+'</span>';
}else{
return '<span style="color:red">未召回</span>';
}

@ -1530,7 +1530,7 @@ function submitUpdate(ids,notNursingIds,detailIds,sysFlag) {
success: function (result) {
if (result.code == 100) {
var data = result.extend.list.length;
if(otherExtIds.split(",").length == data){
if(otherExtIds.split(",").length <= data){
toastr.success("按需采集全部完成,页面将在" + times + "秒后自动刷新");
setTimeout(function(){
//刷新列表

@ -194,8 +194,8 @@ function initTable() {
align: 'center',
valign: 'middle',
formatter:function(value, row){
if(value == '召回中'){
return '<span style="color:green">召回中</span>';
if(value != '否'){
return '<span style="color:green">'+value+'</span>';
}else{
return '<span style="color:red">未召回</span>';
}

Loading…
Cancel
Save