|
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.diagbot.dto.RespDTO;
|
|
|
import com.diagbot.dto.data.ABehospitalInfoDTO;
|
|
|
+import com.diagbot.entity.BasDoctorInfo;
|
|
|
import com.diagbot.entity.BehospitalInfo;
|
|
|
import com.diagbot.entity.MedicalRecord;
|
|
|
import com.diagbot.entity.QcType;
|
|
@@ -42,26 +43,6 @@ public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
|
|
|
private TZDBConn tzDBConn = new TZDBConn();
|
|
|
|
|
|
- /**
|
|
|
- * 终末质控-同步前一天的入院记录
|
|
|
- */
|
|
|
- public void executeBehospital() {
|
|
|
- //String sql="select * from br_inpatientinfo where cjcxrq>=dateadd(day,-2,getdate()) and cjcxrq<=getdate()";
|
|
|
- String sql="select * from br_inpatientinfo where cjcxrq>=(select CONVERT(varchar,GETDATE()-2,23)) and cjcxrq<(select CONVERT(varchar,GETDATE(),23)) ORDER BY cjcxrq DESC";
|
|
|
- List<BehospitalInfo> behospitalInfoList = tzDBConn.getBehospitalInfo(sql);
|
|
|
- execute(behospitalInfoList);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 同步前一天的入院记录
|
|
|
- */
|
|
|
- public void executeBehospitalPast() {
|
|
|
- String sql="select * from br_inpatientinfo where cjcxrq>=dateadd(day,-2,getdate()) and cjcxrq<=getdate()";
|
|
|
- List<BehospitalInfo> behospitalInfoList = tzDBConn.getBehospitalInfo(sql);
|
|
|
- execute(behospitalInfoList);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 通过接口更新病人住院记录信息
|
|
|
* @param list
|
|
@@ -100,10 +81,10 @@ public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
behospitalInfo.setPlacefileDate(DateUtil.parseDateTime(s.getPlacefileDate()));
|
|
|
}
|
|
|
behospitalInfoList.add(behospitalInfo);
|
|
|
-
|
|
|
});
|
|
|
|
|
|
execute(behospitalInfoList);
|
|
|
+
|
|
|
if(logSwitch){
|
|
|
behospitalInfoList.forEach(s->{
|
|
|
aMedAbnormalInfoFacade.saveAbnormalInfo("病人住院登记-正常","", JSON.toJSONString(list),"","");
|
|
@@ -121,29 +102,29 @@ public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
}
|
|
|
|
|
|
public void execute(List<BehospitalInfo> behospitalInfoList){
|
|
|
- List<BehospitalInfo> addE = Lists.newLinkedList();
|
|
|
- List<BehospitalInfo> updateE = Lists.newLinkedList();
|
|
|
+ List<BehospitalInfo> addE=Lists.newArrayList();
|
|
|
+ List<BehospitalInfo> updateE=Lists.newArrayList();
|
|
|
behospitalInfoList.stream().forEach(s -> {
|
|
|
BehospitalInfo behospitalInfo = this.getOne(new QueryWrapper<BehospitalInfo>()
|
|
|
.eq("behospital_code", s.getBehospitalCode())
|
|
|
- .eq("hospital_id", s.getHospitalId())
|
|
|
- .eq("is_deleted",IsDeleteEnum.N), false);
|
|
|
+ .eq("hospital_id", s.getHospitalId()));
|
|
|
if (behospitalInfo != null) {
|
|
|
- s.setGmtModified(new Date());
|
|
|
- s.setQcTypeId(initQcTypeId(s));
|
|
|
+ s.setIsDeleted(IsDeleteEnum.N.getKey());
|
|
|
+ s.setGmtModified(DateUtil.now());
|
|
|
updateE.add(s);
|
|
|
} else {
|
|
|
s.setGmtCreate(new Date());
|
|
|
- s.setQcTypeId(initQcTypeId(s));
|
|
|
+ s.setIsPlacefile("0");//默认为未归档状态
|
|
|
+ s.setPlacefileDate(null);//默认归档时间为空
|
|
|
addE.add(s);
|
|
|
}
|
|
|
});
|
|
|
- if(addE.size()>0){
|
|
|
- behospitalInfoService.saveBatch(addE);
|
|
|
- }
|
|
|
if(updateE.size()>0){
|
|
|
behospitalInfoService.updateBatchByKey(updateE);
|
|
|
}
|
|
|
+ if(addE.size()>0){
|
|
|
+ behospitalInfoService.saveBatch(addE);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|