Ver código fonte

余杭三院:增加出院时间拉取历史数据,并且拉完数据进行评分

licy 3 anos atrás
pai
commit
260ad03f52

+ 1 - 0
src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -252,6 +252,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/qc/data/dataSupplement").permitAll()
                 .antMatchers("/qc/medCheckInfo/getDataEdit").permitAll()
                 .antMatchers("/qc/medCheckInfo/saveDataEdit").permitAll()
+                .antMatchers("/qc/data/sendLeaveHospitalDataOld").permitAll()
                 .antMatchers("/**").authenticated();
         //                .antMatchers("/**").permitAll();
     }

+ 1 - 0
src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -296,6 +296,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/qc/dataEdit/getDataEdit", request)
                 || matchers("/qc/dataEdit/saveDataEdit", request)
                 || matchers("/qc/data/dataSupplement", request)
+                || matchers("/qc/data/sendLeaveHospitalDataOld", request)
                 || matchers("/", request)) {
             return true;
         }

+ 31 - 7
src/main/java/com/diagbot/facade/ViewFacade.java

@@ -7,6 +7,8 @@ import com.diagbot.facade.data.*;
 import com.diagbot.util.DateUtil;
 import com.diagbot.util.ReadProperties;
 import com.diagbot.util.TZDBConn;
+import com.diagbot.vo.AnalyzeRunVO;
+import com.diagbot.vo.AnalyzeVO;
 import com.diagbot.vo.data.YhHomePageVo;
 
 import org.springframework.beans.factory.annotation.Autowired;
@@ -51,6 +53,8 @@ public class ViewFacade {
     private AMedicalRecordContentFacade aMedicalRecordContentFacade;
     @Autowired
     private ABehospitalInfoFacade aBehospitalInfoFacade;
+    @Autowired
+    private BehospitalInfoFacade behospitalInfoFacade;
 
     private TZDBConn tzDBConn = new TZDBConn();
 
@@ -70,11 +74,10 @@ public class ViewFacade {
                 executeOldDataOne(s.getBehospitalCode());
             });
         }
-        System.out.println("没有数据--------------------------开始时间--+" + startDate + "--结束时间--" + stopDate);
     }
 
     /**
-     * 根据住院号来拉取历史数据
+     * 根据住院号来拉取历史数据(并评分)
      *
      * @param behospitalCode
      */
@@ -90,25 +93,35 @@ public class ViewFacade {
                 String recordSql = "select * from his_medical_record where behospital_code= '" + behospitalCode + "'";
                 this.getRecord(recordSql);
 
-                //获取病案首页
+                //获取病案首页(诊断和手术)
                 this.getHomePageByView(behospitalCode);
 
                 //获取相关医嘱信息
                 String doctorAdviceSql = "select * from his_doctor_advice where behospital_code = '" + behospitalCode + "'";
                 this.getDoctorAdvice(doctorAdviceSql);
+
+                try {
+                    //拉取数据完后评分
+                    AnalyzeVO analyzeVO = new AnalyzeVO();
+                    analyzeVO.setIsTask(true);
+                    analyzeVO.setHospitalId(s.getHospitalId());
+                    analyzeVO.setBehospitalCode(s.getBehospitalCode());
+                    behospitalInfoFacade.analyze(analyzeVO);
+                } catch (Exception e) {
+                    aMedAbnormalInfoFacade.saveAbnormalInfo("历史数据拉取完评分异常", "", "", JSON.toJSONString(s), e.getMessage());
+                }
             });
         }
-        System.out.println("没有数据--------------------------住院号--+" + behospitalCode);
     }
 
     /**
-     * 从试图获取病案首页(诊断和手术)
+     * 从图获取病案首页(诊断和手术)
      */
-    public void getHomePageByView(String  behospitalCode) {
+    public void getHomePageByView(String behospitalCode) {
 
         //从视图拉取数据
         String homepageSql = "select * from his_home_page where behospital_code= '" + behospitalCode + "'";
-        String diagSql = "select * from his_home_diagnose_info where behospital_code= '" + behospitalCode+ "'";
+        String diagSql = "select * from his_home_diagnose_info where behospital_code= '" + behospitalCode + "'";
         String opsSql = "select * from his_home_operation_info where behospital_code= '" + behospitalCode + "'";
 
         //从视图获取病案首页信息
@@ -325,4 +338,15 @@ public class ViewFacade {
         }
     }
 
+    public void executeLeaveHospitalDataOld(String startDate, String stopDate) {
+        //获取入院登记表中的信息
+        String infoSql = "select * from his_behospital_info where leave_hospital_date  >= '" + startDate + "' and leave_hospital_date <= '" + stopDate + "'";
+        List<BehospitalInfo> behospitalInfoList = this.getInfo(infoSql);
+        //根据入院登记表的信息来查所需文书
+        if (behospitalInfoList.size() > 0) {
+            behospitalInfoList.forEach(s -> {
+                executeOldDataOne(s.getBehospitalCode());
+            });
+        }
+    }
 }

+ 6 - 1
src/main/java/com/diagbot/task/NhTask.java

@@ -50,7 +50,12 @@ public class NhTask implements SchedulingConfigurer {
                     log.info("执行动态定时任务通过入院登记拉取相关视图: " + LocalDateTime.now().toLocalTime());
                     //开始时间为昨天,结束时间为现在
                     Date now = DateUtil.now();
-                    viewFacade.executeOldData(DateUtil.formatDateTime(DateUtil.addDate(now,-1)),DateUtil.formatDateTime(now));
+                    String yesterday=DateUtil.formatDateTime(DateUtil.addDate(now,-1));
+                    String today=DateUtil.formatDateTime(now);
+                    //补录入院登记
+//                    viewFacade.registration(yesterday,today);
+                    //补录文书以及其他
+//                    viewFacade.execute(yesterday,today);
                 }
             }
         }, new Trigger() {

+ 7 - 0
src/main/java/com/diagbot/web/DataController.java

@@ -239,6 +239,13 @@ public class DataController {
         viewFacade.executeOldDataOne(behospitalCode);
     }
 
+    @ApiOperation(value = "数据引擎-历史数据拉取(出院时间)")
+    @PostMapping("/sendLeaveHospitalDataOld")
+    @SysLogger("sendLeaveHospitalDataOld")
+    public void sendLeaveHospitalDataOld(String startDate,String stopDate){
+        viewFacade.executeLeaveHospitalDataOld(startDate,stopDate);
+    }
+
 
     /*
     @ApiOperation(value = "数据引擎-列字段名和注释")