Explorar el Código

新增拉取数据后评分,病案首页反查异常处理

shiyue hace 3 años
padre
commit
8b754deffe

+ 14 - 1
src/main/java/com/diagbot/facade/ViewFacade.java

@@ -14,6 +14,7 @@ import com.diagbot.util.DateUtil;
 import com.diagbot.util.EntityUtil;
 import com.diagbot.util.ReadProperties;
 import com.diagbot.util.TZDBConn;
+import com.diagbot.vo.AnalyzeRunVO;
 import com.diagbot.vo.OldInfoVo;
 import com.diagbot.vo.data.AHomePageIngVO;
 import com.diagbot.vo.data.AHomePageVO;
@@ -83,6 +84,8 @@ public class ViewFacade {
     private ABehospitalInfoFacade aBehospitalInfoFacade;
     @Autowired
     private ABasDoctorInfoFacade aBasDoctorInfoFacade;
+    @Autowired
+    private BehospitalInfoFacade behospitalInfoFacade;
 
     private TZDBConn tzDBConn = new TZDBConn();
 
@@ -168,6 +171,7 @@ public class ViewFacade {
             String infoSql = "select * from admission_pat_regist where behospitalCode = '" + hospitalCode + "' and behospitalNum = '" + hospitalNum + "'";
             List<BehospitalInfo> behospitalInfoList = this.getInfo(infoSql);
             this.a(behospitalInfoList);
+
             return "true";
         }catch (Exception e){
             return e.getMessage();
@@ -234,7 +238,16 @@ public class ViewFacade {
                 //获取检查信息和相应的检查结果并添加修改
                 String pacsSql = "select * from CHECK_LIST where behospitalCode= '" + hospitalCode + "' and behospitalnum= '" + hospitalNum + "'";
                 this.getPacsInfo(pacsSql);
-
+                try {
+                    //拉取数据完后评分
+                    AnalyzeRunVO analyzeRunVO = new AnalyzeRunVO();
+                    analyzeRunVO.setHospitalId(Long.valueOf("35"));
+                    analyzeRunVO.setBehospitalCode(behospitalCode);
+                    analyzeRunVO.setIsPlacefile("1");
+                    behospitalInfoFacade.analyzeApi(analyzeRunVO);
+                }catch (Exception e){
+                    aMedAbnormalInfoFacade.saveAbnormalInfo("历史数据拉取完评分异常", "", "", JSON.toJSONString(s), e.getMessage());
+                }
             });
             aMedAbnormalInfoFacade.saveAbnormalInfo("历史数据拉取完成", "", "", JSON.toJSONString(behospitalInfoList), "");
         }

+ 35 - 26
src/main/java/com/diagbot/facade/data/AHomePageFacade.java

@@ -270,25 +270,30 @@ public class AHomePageFacade extends HomePageServiceImpl{
                         s.setGmtCreate(new Date());
                         addE.add(s);
                     }
-                    //从病案首页同步入院登记表中的住院医生behospitalDoctor,主治医生attendingDoctor和主任医生directorDoctor和ID
-                    String behospitalDoctor= StringUtils.isEmpty(s.getBehospitalDoctor()) ? "" : s.getBehospitalDoctor();//获取住院医师姓名
-                    String attendingDoctor= StringUtils.isEmpty(s.getAttendingDoctor()) ? "" : s.getAttendingDoctor();//获取主治医师姓名
-                    String directorDoctor= StringUtils.isEmpty(s.getDirectorDoctor()) ? "" : s.getDirectorDoctor();//获取主任医师姓名
-                    String behospitalDoctorID=this.getDoctorId(behospitalDoctor);//获取住院医师id
-                    String attendingDoctorID=this.getDoctorId(attendingDoctor);//获取主治医师id
-                    String directorDoctorID=this.getDoctorId(directorDoctor);//获取主任医师id
+                    try{
+                        //从病案首页同步入院登记表中的住院医生behospitalDoctor,主治医生attendingDoctor和主任医生directorDoctor和ID
+                        String behospitalDoctor= StringUtils.isEmpty(s.getBehospitalDoctor()) ? "" : s.getBehospitalDoctor();//获取住院医师姓名
+                        String attendingDoctor= StringUtils.isEmpty(s.getAttendingDoctor()) ? "" : s.getAttendingDoctor();//获取主治医师姓名
+                        String directorDoctor= StringUtils.isEmpty(s.getDirectorDoctor()) ? "" : s.getDirectorDoctor();//获取主任医师姓名
+                        String behospitalDoctorID=this.getDoctorId(behospitalDoctor);//获取住院医师id
+                        String attendingDoctorID=this.getDoctorId(attendingDoctor);//获取主治医师id
+                        String directorDoctorID=this.getDoctorId(directorDoctor);//获取主任医师id
+
+                        UpdateWrapper<BehospitalInfo> updateWrapper=new UpdateWrapper<>();
+                        updateWrapper.eq("behospital_code",s.getBehospitalCode())
+                                .eq("hospital_id", homePage.getHospitalId())
+                                .eq("is_deleted",IsDeleteEnum.N)
+                                .set("beh_doctor_name",behospitalDoctor)
+                                .set("doctor_name",attendingDoctor)
+                                .set("director_doctor_name",directorDoctor)
+                                .set("beh_doctor_id",behospitalDoctorID)
+                                .set("doctor_id",attendingDoctorID)
+                                .set("director_doctor_id",directorDoctorID);
+                        behospitalInfoFacade.update(updateWrapper);
+                    }catch (Exception e){
+                        aMedAbnormalInfoFacade.saveAbnormalInfo("反查医师id出错","", JSON.toJSONString(homePageList),"",e.getMessage());
+                    }
 
-                    UpdateWrapper<BehospitalInfo> updateWrapper=new UpdateWrapper<>();
-                    updateWrapper.eq("behospital_code",s.getBehospitalCode())
-                            .eq("hospital_id", homePage.getHospitalId())
-                            .eq("is_deleted",IsDeleteEnum.N)
-                            .set("beh_doctor_name",behospitalDoctor)
-                            .set("doctor_name",attendingDoctor)
-                            .set("director_doctor_name",directorDoctor)
-                            .set("beh_doctor_id",behospitalDoctorID)
-                            .set("doctor_id",attendingDoctorID)
-                            .set("director_doctor_id",directorDoctorID);
-                    behospitalInfoFacade.update(updateWrapper);
                 });
 
             }
@@ -300,7 +305,7 @@ public class AHomePageFacade extends HomePageServiceImpl{
             }
         }catch (Exception e){
             log.error(e.getMessage(),e);
-            aMedAbnormalInfoFacade.saveAbnormalInfo("病案首页","", JSON.toJSONString(homePageList),"",e.getMessage());
+            aMedAbnormalInfoFacade.saveAbnormalInfo("病案首页异常","", JSON.toJSONString(homePageList),"",e.getMessage());
         }
     }
 
@@ -310,13 +315,17 @@ public class AHomePageFacade extends HomePageServiceImpl{
      * @return
      */
     public String getDoctorId(String doctorName){
-        QueryWrapper<BasDoctorInfo> queryWrapper = Wrappers.query();
-        queryWrapper.eq("name",doctorName);
-        BasDoctorInfo doctorInfo =aBasDoctorInfoFacade.getOne(queryWrapper);
-        if (doctorInfo !=null && StringUtils.isNotEmpty(doctorInfo.getDoctorId())){
-            return doctorInfo.getDoctorId();
-        }else {
-            return "-";
+        try{
+            QueryWrapper<BasDoctorInfo> queryWrapper = Wrappers.query();
+            queryWrapper.eq("name",doctorName);
+            BasDoctorInfo doctorInfo =aBasDoctorInfoFacade.getOne(queryWrapper);
+            if (doctorInfo !=null && StringUtils.isNotEmpty(doctorInfo.getDoctorId())){
+                return doctorInfo.getDoctorId();
+            }else {
+                return "-";
+            }
+        }catch (Exception e){
+            return "--";
         }
     }
 

+ 1 - 1
src/main/java/com/diagbot/web/DataController.java

@@ -251,7 +251,7 @@ public class DataController {
 
 
 
-    @ApiOperation(value = "测试")
+    @ApiOperation(value = "单独获取病案首页")
     @PostMapping("/sendOldData")
     @SysLogger("sendOldData")
     public void sendOldData(){