|
@@ -5,12 +5,9 @@ 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.BasDeptInfo;
|
|
|
import com.diagbot.entity.BehospitalInfo;
|
|
|
-import com.diagbot.entity.MedicalRecord;
|
|
|
import com.diagbot.entity.QcType;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
-import com.diagbot.facade.QcAbnormalFacade;
|
|
|
import com.diagbot.facade.QcTypeFacade;
|
|
|
import com.diagbot.mapper.BehospitalInfoMapper;
|
|
|
import com.diagbot.service.impl.BehospitalInfoServiceImpl;
|
|
@@ -22,18 +19,13 @@ import com.diagbot.vo.data.ABehospitalInfoVO;
|
|
|
import com.diagbot.vo.data.ADeleteFlagVO;
|
|
|
import com.diagbot.vo.data.APlaceFileVO;
|
|
|
import com.google.common.collect.Lists;
|
|
|
-import com.sun.xml.bind.v2.TODO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
-import java.time.LocalDateTime;
|
|
|
-import java.time.format.DateTimeFormatter;
|
|
|
-import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
@Component
|
|
|
public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
@@ -180,10 +172,14 @@ public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
* @return
|
|
|
*/
|
|
|
private Long initQcTypeId(BehospitalInfo s) {
|
|
|
- // 如果是婴儿(isBaby = 1),直接返回0,不进行质控
|
|
|
- if (s.getIsBaby().equals(1)) {
|
|
|
+ // 如果是婴儿(isBaby = 1),或者为取消入院的病人,质控类型直接返回0,不进行质控
|
|
|
+ if (s.getIsCancelBehospital().equals("1")||s.getIsBaby().equals("1") || s.getName().contains("之子") || s.getName().contains("之女")) {
|
|
|
return 0L;
|
|
|
}
|
|
|
+ //如果是日间病例,质控类型直接写死返回129(日间病房(男))这个后期要改
|
|
|
+ if (s.getIsDaytime().equals("1")){
|
|
|
+ return 129L;
|
|
|
+ }
|
|
|
Long qcTypeId = Long.valueOf("0");
|
|
|
//根据科室查找对应质控类型
|
|
|
List<QcType> qcTypeList = qcTypeFacade.list(new QueryWrapper<QcType>()
|
|
@@ -289,41 +285,42 @@ public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
return RespDTO.onError(e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
- public RespDTO updatePlacefile(String endDate){
|
|
|
- try {
|
|
|
- //验证数据是否存在
|
|
|
- if(StringUtil.isBlank(endDate)){
|
|
|
- return RespDTO.onError("请输入截止时间!");
|
|
|
- }else{
|
|
|
-
|
|
|
- LocalDateTime endDateTime = LocalDateTime.parse(endDate + "T23:59:59", DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss"));
|
|
|
- QueryWrapper<BehospitalInfo> queryWrapper = new QueryWrapper();
|
|
|
- queryWrapper.eq("hospital_id", "5")
|
|
|
- .eq("is_deleted", IsDeleteEnum.N)
|
|
|
- .lt("leave_hospital_date", endDateTime);
|
|
|
-
|
|
|
- // 查询符合条件的数据,并提取 behospital_code 字段
|
|
|
- List<BehospitalInfo> behospitalInfoList = behospitalInfoMapper.selectList(queryWrapper);
|
|
|
- List<String> isPlaceFileInfoList = behospitalInfoList.stream()
|
|
|
- .map(BehospitalInfo::getBehospitalCode) // 提取 behospital_code
|
|
|
- .collect(Collectors.toList());
|
|
|
- if (isPlaceFileInfoList.isEmpty()) {
|
|
|
- return RespDTO.onError("未找到病历!");
|
|
|
- }
|
|
|
- UpdateWrapper<BehospitalInfo> updateWrapper=new UpdateWrapper<>();
|
|
|
- updateWrapper.eq("hospital_id", "5")
|
|
|
- .eq("is_deleted",IsDeleteEnum.N)
|
|
|
- .in("behospital_code", isPlaceFileInfoList)
|
|
|
- .set("is_placefile","1")
|
|
|
- .set("gmt_modified", DateUtil.now());
|
|
|
-
|
|
|
- Boolean flag=update(new BehospitalInfo(),updateWrapper);
|
|
|
- return RespDTO.onSuc(flag);
|
|
|
- }
|
|
|
- }catch (Exception e){
|
|
|
- return RespDTO.onError(e.getMessage());
|
|
|
- }
|
|
|
- }
|
|
|
+ //暂时停用
|
|
|
+// public RespDTO updatePlacefile(String endDate){
|
|
|
+// try {
|
|
|
+// //验证数据是否存在
|
|
|
+// if(StringUtil.isBlank(endDate)){
|
|
|
+// return RespDTO.onError("请输入截止时间!");
|
|
|
+// }else{
|
|
|
+//
|
|
|
+// LocalDateTime endDateTime = LocalDateTime.parse(endDate + "T23:59:59", DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss"));
|
|
|
+// QueryWrapper<BehospitalInfo> queryWrapper = new QueryWrapper();
|
|
|
+// queryWrapper.eq("hospital_id", "5")
|
|
|
+// .eq("is_deleted", IsDeleteEnum.N)
|
|
|
+// .lt("leave_hospital_date", endDateTime);
|
|
|
+//
|
|
|
+// // 查询符合条件的数据,并提取 behospital_code 字段
|
|
|
+// List<BehospitalInfo> behospitalInfoList = behospitalInfoMapper.selectList(queryWrapper);
|
|
|
+// List<String> isPlaceFileInfoList = behospitalInfoList.stream()
|
|
|
+// .map(BehospitalInfo::getBehospitalCode) // 提取 behospital_code
|
|
|
+// .collect(Collectors.toList());
|
|
|
+// if (isPlaceFileInfoList.isEmpty()) {
|
|
|
+// return RespDTO.onError("未找到病历!");
|
|
|
+// }
|
|
|
+// UpdateWrapper<BehospitalInfo> updateWrapper=new UpdateWrapper<>();
|
|
|
+// updateWrapper.eq("hospital_id", "5")
|
|
|
+// .eq("is_deleted",IsDeleteEnum.N)
|
|
|
+// .in("behospital_code", isPlaceFileInfoList)
|
|
|
+// .set("is_placefile","1")
|
|
|
+// .set("gmt_modified", DateUtil.now());
|
|
|
+//
|
|
|
+// Boolean flag=update(new BehospitalInfo(),updateWrapper);
|
|
|
+// return RespDTO.onSuc(flag);
|
|
|
+// }
|
|
|
+// }catch (Exception e){
|
|
|
+// return RespDTO.onError(e.getMessage());
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
public RespDTO sendDateInfo(String startDate, String endDate, String isLeave){
|
|
|
try {
|
|
@@ -402,6 +399,8 @@ public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
.eq("is_deleted",IsDeleteEnum.N)
|
|
|
.in("behospital_code", isPlaceFileInfoList)
|
|
|
.set("is_baby","1")
|
|
|
+ //婴儿标志为1的新生儿不进行质控
|
|
|
+ .set("qc_type_id","0")
|
|
|
.set("gmt_modified", DateUtil.now());
|
|
|
|
|
|
Boolean flag=update(new BehospitalInfo(),updateWrapper);
|