his病案终审按需采集

master
linjj 1 year ago
parent 8f3f8fdc1d
commit 3663d253cb

@ -70,6 +70,11 @@
<artifactId>commons-net</artifactId>
<version>${commons-net.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.4</version>
</dependency>
<!--json-->
<!-- httpclient -->
<dependency>

@ -8,6 +8,7 @@ package com.emr.controller;
import com.emr.entity.*;
import com.emr.service.Archive_MasterService;
import com.emr.service.CompenSateService;
import com.emr.service.Emr_Fault_DetailService;
import com.emr.service.Emr_Fault_TypeService;
import com.emr.service.ipml.EmrPaperPositionInfoServer;
@ -60,6 +61,8 @@ public class lastVerifyController {
@Autowired
private EmrPaperPositionInfoServer paperPositionInfoServer;
@Autowired
private CompenSateService compenSateService;
@RequestMapping(value = "/lastVerifys")
public String faults() {
return "lastVerifyDir/lastVerifyList";
@ -77,6 +80,14 @@ public class lastVerifyController {
return result;
}
@ResponseBody
@RequestMapping(value = "/updateCompensate")
public int updateCompensate(String id,String patientId){
return compenSateService.updateCompenSate(id,patientId);
}
@ResponseBody
@RequestMapping(value = "/exportExcel")
public void exportExcel(HttpServletResponse response, Archive_Master_Vo archiveMasterVo,Integer isSearch) throws Exception {

@ -0,0 +1,24 @@
package com.emr.dao;
import com.emr.vo.CompenSateVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @InterfaceName CompenSateMapper
* @Description
* @Author linjj
* @Date 2024/3/25 14:16
* @Version 1.0
*/
public interface CompenSateMapper {
List<CompenSateVo> selectAll(@Param(value = "ids")String ids);
int updateCompenSate(String masterId);
List<CompenSateVo> selectAllByMasterId(String masterId);
int addCompenSate(@Param(value = "masterId")String masterId,@Param(value = "patientId")String patientId,@Param(value = "compensateState")int compensateState);
}

@ -50,6 +50,15 @@ public class Archive_Master_Vo {
private String deptCodeLend;
private String returntoRole;
private int compensateState;
public int getCompensateState() {
return compensateState;
}
public void setCompensateState(int compensateState) {
this.compensateState = compensateState;
}
private String returnOperUsername;

@ -0,0 +1,13 @@
package com.emr.service;
/**
* @InterfaceName CompenSateService
* @Description
* @Author linjj
* @Date 2024/3/25 14:42
* @Version 1.0
*/
public interface CompenSateService {
int updateCompenSate(String masterId,String patientId);
}

@ -7,13 +7,18 @@
package com.emr.service.ipml;
import com.emr.dao.Archive_MasterMapper;
import com.emr.dao.CompenSateMapper;
import com.emr.dao1.OracleMapper;
import com.emr.entity.*;
import com.emr.service.Archive_MasterService;
import com.emr.service.Emr_DictionaryService;
import com.emr.util.ExceptionPrintUtil;
import com.emr.util.ListUtil;
import com.emr.util.Setters;
import com.emr.vo.CompenSateVo;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -21,6 +26,7 @@ import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@Service
public class Archive_MasterServiceImpl implements Archive_MasterService {
@ -33,6 +39,8 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
@Autowired
private OracleMapper oracleMapper;
@Autowired
private CompenSateMapper compenSateMapper;
@Override
public OffsetLimitPage selectByCol(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit) {
PageHelper.offsetPage(offset, limit);
@ -115,6 +123,30 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
List<Archive_Master_Vo> list = archiveMasterMapper.selectByLast(archiveMasterVo);
//设置科室设置纸质签收状态和his召回状态
setPaperStatusAndCallbackStatus(list);
if (list.size()>0){
//按需采集
//masterIds集合
List<String> masterIds = ListUtil.distinctSelect(list, Archive_Master_Vo::getId);
//分批次
List<List<String>> newList = ListUtils.partition(masterIds, 1000);
for (List<String> messageList : newList) {
//转成逗号拼接
String ids = String.join(",", messageList);
//获取按需采集信息
List<CompenSateVo> compenSateVos = compenSateMapper.selectAll(ids);
//医生是否有缺陷
Map<String, CompenSateVo> masterIdMap = ListUtil.toMap(compenSateVos, CompenSateVo::getMasterId);
Setters.<Archive_Master_Vo>instance().list(list).cycleSetProperties(p -> {
String masterId = p.getId();
if (masterIdMap.containsKey(masterId)){
p.setCompensateState(masterIdMap.get(masterId).getCompensateState());
}else {
p.setCompensateState(1);
}
});
}
}
return new OffsetLimitPage((Page) list);
}

@ -0,0 +1,36 @@
package com.emr.service.ipml;
import com.emr.dao.CompenSateMapper;
import com.emr.service.CompenSateService;
import com.emr.vo.CompenSateVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
/**
* @ClassName CompenSateServiceImpl
* @Description
* @Author linjj
* @Date 2024/3/25 14:42
* @Version 1.0
*/
@Service
public class CompenSateServiceImpl implements CompenSateService {
@Autowired
private CompenSateMapper compenSateMapper;
@Override
public int updateCompenSate(String masterId, String patientId) {
//判断按需表中是否存在当前记录
List<CompenSateVo> list = compenSateMapper.selectAllByMasterId(masterId);
//如果不存在则新增任务,存在则更新任务状态
if (list == null || list.isEmpty()) {
return compenSateMapper.addCompenSate(masterId, patientId, 0);
} else {
return compenSateMapper.updateCompenSate(masterId);
}
}
}

@ -0,0 +1,12 @@
package com.emr.util;
/**
* @InterfaceName FieldSelector
* @Description
* @Author linjj
* @Date 2023/6/29 16:41
* @Version 1.0
*/
public interface FieldSelector<Type, FieldType> {
FieldType select(Type type);
}

@ -0,0 +1,22 @@
package com.emr.util;
import java.util.List;
public class ListPropertySetter<T> {
private final List<T> values;
public ListPropertySetter(List<T> values) {
this.values = values;
}
public List<T> cycleSetProperties(PropertySetter<T> setter) {
if (null == values) return values;
for (T value : values) {
setter.apply(value);
}
return values;
}
}

@ -0,0 +1,73 @@
package com.emr.util;
import org.springframework.util.CollectionUtils;
import java.util.*;
public final class ListUtil {
public static <T, K> Map<K, T> toMap(List<T> list, FieldSelector<T, K> selector) {
if (CollectionUtils.isEmpty(list)) return Collections.emptyMap();
Map<K, T> map = new HashMap<>(list.size());
for (T t : list) {
K key = selector.select(t);
if (key != null) map.put(key, t);
}
return map;
}
public static <T, K> Map<K, List<T>> groupBy(List<T> list, FieldSelector<T, K> selector) {
if (CollectionUtils.isEmpty(list)) return Collections.emptyMap();
Map<K, List<T>> map = new HashMap<>();
for (T t : list) {
K key = selector.select(t);
if (key == null) continue;
if (!map.containsKey(key)) {
map.put(key, new ArrayList<T>());
}
map.get(key).add(t);
}
return map;
}
public static <T, K> List<K> select(List<T> list, FieldSelector<T, K> selector) {
if (CollectionUtils.isEmpty(list)) return Collections.emptyList();
List<K> filedList = new ArrayList<>(list.size());
for (T t : list) {
K key = selector.select(t);
if (key != null) filedList.add(key);
}
return filedList;
}
public static <T, K> List<K> distinctSelect(List<T> list, FieldSelector<T, K> selector) {
if (CollectionUtils.isEmpty(list)) return Collections.emptyList();
Set<K> filedSet = new HashSet<>();
for (T t : list) {
K key = selector.select(t);
if (key != null) filedSet.add(key);
}
return new ArrayList<>(filedSet);
}
@SafeVarargs
public static <T> List<T> unionWithoutDuplicate(List<T>... values) {
if (null == values || values.length <= 0) return Collections.emptyList();
Set<T> unionFiledSet = new HashSet<>();
for (List<T> value : values) {
if (!CollectionUtils.isEmpty(value)) {
unionFiledSet.addAll(value);
}
}
return new ArrayList<>(unionFiledSet);
}
public static <T, K> List<T> skipDuplicateKey(List<T> list, FieldSelector<T, K> selector) {
if (CollectionUtils.isEmpty(list)) return Collections.emptyList();
List<T> filedList = new ArrayList<>(list.size());
Map<K, T> map = toMap(list, selector);
for (K key : map.keySet()) {
filedList.add(map.get(key));
}
return filedList;
}
}

@ -0,0 +1,7 @@
package com.emr.util;
public interface PropertySetter<T> {
void apply(T t);
}

@ -0,0 +1,14 @@
package com.emr.util;
import java.util.List;
public class Setters<T> {
public static <T> Setters<T> instance() {
return new Setters<>();
}
public ListPropertySetter<T> list(List<T> values) {
return new ListPropertySetter<>(values);
}
}

@ -0,0 +1,18 @@
package com.emr.vo;
import lombok.Data;
/**
* @ClassName CompenSateVo
* @Description
* @Author linjj
* @Date 2024/3/25 14:15
* @Version 1.0
*/
@Data
public class CompenSateVo {
private String masterId;
private String patientId;
private int compensateState;
}

@ -47,9 +47,9 @@ logAbandoned: true
#\u56FE\u7247\u5730\u5740
pictureUrl=src\\main\\webapp
powerUrl=http://localhost:8081/power/font/getMenusByUserIdAndSysFlag
POWER_URLHEAD=http://localhost:8081/power
POWER_JSP=http://localhost:8081/power
powerUrl=http://localhost:8084/power/font/getMenusByUserIdAndSysFlag
POWER_URLHEAD=http://localhost:8084/power
POWER_JSP=http://localhost:8084/power
recallReason=\u533B\u9662\u9700\u8981\u8FD9\u4EFD\u6587\u6863
HomepageDictionary=http://localhost:8080/WholeCheckInterface/services/HomepageDictionary?wsdl
HomepageMethod=CheckData

@ -0,0 +1,25 @@
<?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.CompenSateMapper" >
<insert id="addCompenSate">
insert into compensate (masterId, patientId,
compensateState)
values (#{masterId}, #{patientId},
#{compensateState})
</insert>
<update id="updateCompenSate">
update compensate set compensateState=0 where masterId=#{masterId}
</update>
<select id="selectAll" resultType="com.emr.vo.CompenSateVo">
select * from compensate where
masterId in
<foreach item="item" collection="ids.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="selectAllByMasterId" resultType="com.emr.vo.CompenSateVo">
select * from compensate where masterId=#{masterId}
</select>
</mapper>

@ -1751,9 +1751,9 @@
$("#outHospLab").html(row.dischargeDisposition);
$("#inLab").html(row.inpNo);
$("#inTimeLab").html(row.visitId);
if (row.lockinfo == '') {
$("#wzContent").text(row.lockinfo);
} else {
// if (row.lockinfo == '') {
// $("#wzContent").text(row.lockinfo);
// } else {
//请求接口查看并回显
$.ajax({
type: 'get',
@ -1767,7 +1767,7 @@
}
},
})
}
// }
///入/出院年+出院月+住院号+住院次数
var outDate = "";
if (row.dischargeDateTime != null && row.dischargeDateTime != "") {

@ -1447,6 +1447,21 @@
}
});
}
function compensateState(id,patientId) {
console.log("id"+id)
console.log("patientId"+patientId)
$.ajax({
url: "${path}/lastVerify/updateCompensate",
type: "POST",
data: {id: id,patientId:patientId},
success: function (result) {
if (result==1){
toastr.success("his重新采集成功");
$('#table').bootstrapTable('refresh');
}
}
});
}
getFaultType();
@ -1759,6 +1774,11 @@
html += '<button type="button" class="btn btn-sm btn-primary verifyInfo">审核</button>';
}
}
if (row.compensateState==1){
html += '<button type="button" class="btn btn-warning btn-sm compensateState" >his重新采集</button>';
}else {
html += '<button type="button" class="btn btn-warning btn-sm compensateState" disabled>his正在采集</button>';
}
return html;
},
@ -1780,13 +1800,14 @@
});
getFaultType();
$('#returnModal').modal({
backdrop: 'static',//backdrop 为 static 时,点击模态对话框的外部区域不会将其关闭。
keyboard: false,//keyboard 为 false 时,按下 Esc 键不会关闭 Modal。
show: true//弹出对话框
});
}, 'click .compensateState': function (e, value, row, index) {
compensateState(row.id,row.patientId);
},
'click .verifyInfo': function (e, value, row, index) {
// console.log("====审核====");
@ -1841,9 +1862,6 @@
$("#inLab").html(row.inpNo);
$("#inTimeLab").html(row.visitId);
$("#wzContent").html(row.lockinfo);
if(row.lockinfo == ''){
$("#wzContent").html(row.lockinfo);
}else{
//请求接口查看并回显
$.ajax({
type:'get',
@ -1857,7 +1875,7 @@
}
},
})
}
//入/出院年+出院月+住院号+住院次数
var outDate = "";
if (row.dischargeDateTime != null && row.dischargeDateTime != "") {

Loading…
Cancel
Save