|
@@ -4,8 +4,10 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.diagbot.dto.RespDTO;
|
|
|
+import com.diagbot.entity.BehospitalInfo;
|
|
|
import com.diagbot.entity.DoctorAdvice;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
+import com.diagbot.facade.BehospitalInfoFacade;
|
|
|
import com.diagbot.service.impl.DoctorAdviceServiceImpl;
|
|
|
import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.DateUtil;
|
|
@@ -32,6 +34,8 @@ public class ADoctorAdviceFacade extends DoctorAdviceServiceImpl{
|
|
|
private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
|
|
|
@Value("${log_switch.enable}")
|
|
|
private boolean logSwitch;
|
|
|
+ @Autowired
|
|
|
+ private BehospitalInfoFacade behospitalInfoFacade;
|
|
|
|
|
|
private TZDBConn tzDBConn = new TZDBConn();
|
|
|
|
|
@@ -56,10 +60,6 @@ public class ADoctorAdviceFacade extends DoctorAdviceServiceImpl{
|
|
|
* @return
|
|
|
*/
|
|
|
public RespDTO executeDoctorAdvice(List<ADoctorAdviceVO> list) {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
try {
|
|
|
if(list!=null && list.size()>0){
|
|
|
//循环验证数据有效性
|
|
@@ -74,6 +74,7 @@ public class ADoctorAdviceFacade extends DoctorAdviceServiceImpl{
|
|
|
}
|
|
|
//初始、格式化数据
|
|
|
List<DoctorAdvice> doctorAdviceList=Lists.newArrayList();
|
|
|
+ List<String> names=Lists.newArrayList();
|
|
|
list.stream().forEach(s->{
|
|
|
DoctorAdvice doctorAdvice=new DoctorAdvice();
|
|
|
BeanUtil.copyProperties(s,doctorAdvice);
|
|
@@ -83,6 +84,7 @@ public class ADoctorAdviceFacade extends DoctorAdviceServiceImpl{
|
|
|
if(StringUtil.isNotBlank(s.getDaStopDate())){
|
|
|
doctorAdvice.setDaStopDate(DateUtil.parseDateTime(s.getDaStopDate()));
|
|
|
}
|
|
|
+ names.add(StringUtil.isNotBlank(doctorAdvice.getDoctorName())?doctorAdvice.getDoctorName():"");
|
|
|
doctorAdviceList.add(doctorAdvice);
|
|
|
});
|
|
|
execute(doctorAdviceList);
|
|
@@ -107,6 +109,7 @@ public class ADoctorAdviceFacade extends DoctorAdviceServiceImpl{
|
|
|
List<DoctorAdvice> updateE = Lists.newLinkedList();
|
|
|
if (doctorAdviceList != null && doctorAdviceList.size() > 0) {
|
|
|
doctorAdviceList.stream().forEach(s -> {
|
|
|
+ this.updateQctypeId(s);
|
|
|
DoctorAdvice doctorAdvice = this.getOne(new QueryWrapper<DoctorAdvice>()
|
|
|
.eq("doctor_advice_id", s.getDoctorAdviceId())
|
|
|
.eq("hospital_id", s.getHospitalId())
|
|
@@ -128,6 +131,22 @@ public class ADoctorAdviceFacade extends DoctorAdviceServiceImpl{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 判断是否为睡眠监测病人
|
|
|
+ * @param doctorAdviceList
|
|
|
+ */
|
|
|
+ public void updateQctypeId(DoctorAdvice doctorAdviceList){
|
|
|
+ if (doctorAdviceList.getDoctorName().equals("睡眠呼吸监测过筛试验") || doctorAdviceList.getDoctorName().equals("睡眠呼吸滴定监测")
|
|
|
+ || (doctorAdviceList.getDoctorName().equals("睡眠监测") && doctorAdviceList.getDoctorName().equals("呼吸机辅助呼吸"))){
|
|
|
+ UpdateWrapper<BehospitalInfo> updateWrapper=new UpdateWrapper<>();
|
|
|
+ updateWrapper.eq("behospital_code",doctorAdviceList.getBehospitalCode())
|
|
|
+ .eq("hospital_id", doctorAdviceList.getHospitalId())
|
|
|
+ .eq("is_deleted",IsDeleteEnum.N)
|
|
|
+ .set("qy_type_id","2");
|
|
|
+ behospitalInfoFacade.update(updateWrapper);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public RespDTO deleteFlag(ADeleteFlagVO aDeleteFlagVO){
|
|
|
try {
|
|
|
//验证数据是否存在
|