Przeglądaj źródła

余杭三院微调

licy 3 lat temu
rodzic
commit
bdced99940

+ 3 - 0
logs/mrqc-sys/mrqc-sys_debug.log

@@ -0,0 +1,3 @@
+2021-12-23 15:01:01.623 DEBUG --- [main] org.apache.ibatis.logging.LogFactory Line:105 - Logging initialized using 'class org.apache.ibatis.logging.slf4j.Slf4jImpl' adapter.
+2021-12-23 15:01:10.625 DEBUG --- [main] org.apache.ibatis.logging.LogFactory Line:105 - Logging initialized using 'class org.apache.ibatis.logging.slf4j.Slf4jImpl' adapter.
+2021-12-23 15:01:17.059 DEBUG --- [main] org.apache.ibatis.logging.LogFactory Line:105 - Logging initialized using 'class org.apache.ibatis.logging.slf4j.Slf4jImpl' adapter.

Plik diff jest za duży
+ 1647 - 0
logs/mrqc-sys/mrqc-sys_error.log


+ 18 - 0
logs/mrqc-sys/mrqc-sys_info.log

@@ -0,0 +1,18 @@
+2021-12-23 15:00:57.759 INFO  --- [main] com.diagbot.MrqcSysApplication Line:655 - The following profiles are active: local
+2021-12-23 15:01:03.701 INFO  --- [main] com.diagbot.MrqcSysApplication Line:655 - The following profiles are active: local
+2021-12-23 15:01:06.918 INFO  --- [main] io.undertow.servlet Line:364 - Initializing Spring embedded WebApplicationContext
+2021-12-23 15:01:07.364 INFO  --- [main] com.netflix.config.sources.URLConfigurationSource Line:122 - To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
+2021-12-23 15:01:07.422 INFO  --- [main] com.netflix.config.DynamicPropertyFactory Line:281 - DynamicPropertyFactory is initialized with configuration sources: com.netflix.config.ConcurrentCompositeConfiguration@3c46dcbe
+2021-12-23 15:01:07.755 INFO  --- [main] com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure Line:56  - Init DruidDataSource
+2021-12-23 15:01:10.782 INFO  --- [main] com.diagbot.MrqcSysApplication Line:655 - The following profiles are active: local
+2021-12-23 15:01:16.364 INFO  --- [main] io.undertow.servlet Line:364 - Initializing Spring embedded WebApplicationContext
+2021-12-23 15:01:16.691 INFO  --- [main] com.netflix.config.sources.URLConfigurationSource Line:122 - To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
+2021-12-23 15:01:16.732 INFO  --- [main] com.netflix.config.DynamicPropertyFactory Line:281 - DynamicPropertyFactory is initialized with configuration sources: com.netflix.config.ConcurrentCompositeConfiguration@7eb6b6b6
+2021-12-23 15:01:17.032 INFO  --- [main] com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure Line:56  - Init DruidDataSource
+2021-12-23 15:01:20.514 INFO  --- [main] io.undertow.servlet Line:364 - Initializing Spring embedded WebApplicationContext
+2021-12-23 15:01:20.806 INFO  --- [main] com.netflix.config.sources.URLConfigurationSource Line:122 - To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
+2021-12-23 15:01:20.841 INFO  --- [main] com.netflix.config.DynamicPropertyFactory Line:281 - DynamicPropertyFactory is initialized with configuration sources: com.netflix.config.ConcurrentCompositeConfiguration@244e619a
+2021-12-23 15:01:21.320 INFO  --- [main] com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure Line:56  - Init DruidDataSource
+2021-12-23 15:01:30.802 INFO  --- [main] com.alibaba.druid.pool.DruidDataSource Line:1010 - {dataSource-1} inited
+2021-12-23 15:01:39.166 INFO  --- [main] com.alibaba.druid.pool.DruidDataSource Line:1010 - {dataSource-1} inited
+2021-12-23 15:01:43.326 INFO  --- [main] com.alibaba.druid.pool.DruidDataSource Line:1010 - {dataSource-1} inited

Plik diff jest za duży
+ 18 - 0
logs/mrqc-sys/mrqc-sys_warn.log


+ 4 - 117
src/main/java/com/diagbot/facade/ViewFacade.java

@@ -54,27 +54,6 @@ public class ViewFacade {
 
     private TZDBConn tzDBConn = new TZDBConn();
 
-    /**
-     * 定时任务每天晚上11点拉取历史病例
-     */
-    public void executeOldData() {
-        String deptSql = "select * from dept where deptType='临床' and station='住院' ";
-        String doctorAdviceSql = "select * from doctor_order where daStartDate >= to_date('" + DateUtil.yesterdayFormate() + "','yyyy-MM-dd')";
-
-
-        Long startTime = System.currentTimeMillis();
-        //得到全部的科室信息并添加修改
-        this.getDeptInfo(deptSql);
-        Long startTime1 = System.currentTimeMillis();
-        System.out.println("获取科室所用时间:----" + (startTime1 - startTime) + "----");
-
-
-        //得到前一天的医嘱信息并添加修改
-        this.getDoctorAdvice(doctorAdviceSql);
-        Long startTime2 = System.currentTimeMillis();
-        System.out.println("获取医嘱所用时间:----" + (startTime2 - startTime1) + "----");
-    }
-
     /**
      * 根据时间来拉取历史数据
      *
@@ -96,11 +75,7 @@ public class ViewFacade {
                 this.getRecord(recordSql);
 
                 //获取病案首页(先注释视图补全再开)
-                YhHomePageVo yhHomePageVo = new YhHomePageVo();
-                yhHomePageVo.setBehospitalCode(behospitalCode);
-                yhHomePageVo.setHospitalId("36");
-                yhHomePageVo.setDockModeType("0");
-                this.getHomePageByView(yhHomePageVo);
+                this.getHomePageByView(behospitalCode);
 
                 //获取相关医嘱信息
                 String doctorAdviceSql = "select * from his_doctor_advice where behospital_code = '" + behospitalCode + "'";
@@ -128,11 +103,7 @@ public class ViewFacade {
                 this.getRecord(recordSql);
 
                 //获取病案首页
-                YhHomePageVo yhHomePageVo = new YhHomePageVo();
-                yhHomePageVo.setBehospitalCode(behospitalCode);
-                yhHomePageVo.setHospitalId("36");
-                yhHomePageVo.setDockModeType("0");
-                this.getHomePageByView(yhHomePageVo);
+                this.getHomePageByView(behospitalCode);
 
                 //获取相关医嘱信息
                 String doctorAdviceSql = "select * from his_doctor_advice where behospital_code = '" + behospitalCode + "'";
@@ -145,13 +116,9 @@ public class ViewFacade {
     /**
      * 从试图获取病案首页(诊断和手术)
      */
-    public RespDTO<Map<String, Object>> getHomePageByView(YhHomePageVo yhHomePageVo) {
-        //保存入参
-        aMedAbnormalInfoFacade.saveAbnormalInfo("病案首页入参", "", yhHomePageVo.getBehospitalCode(), JSON.toJSONString(yhHomePageVo), "");
-        Long modeId = Long.valueOf("6");//病案首页默认为6
-        String behospitalCode = yhHomePageVo.getBehospitalCode();
-        //从视图拉取数据
+    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 opsSql = "select * from his_home_operation_info where behospital_code= '" + behospitalCode + "'";
@@ -163,15 +130,6 @@ public class ViewFacade {
         //从视图获取病案首页手术信息
         this.getHomeOperation(opsSql);
 
-
-        //根据传过来的方案编码来判断是否返回评分(1:返回评分,其他只保存数据)
-        if (yhHomePageVo.getDockModeType().equals("1")) {
-            String url = readProperties.getProcessQcUrl() + "?behospitalCode=" + behospitalCode + "&hospitalId=" + yhHomePageVo.getHospitalId() + "&modeId=" + modeId;
-            Map<String, Object> map = new HashMap<String, Object>();
-            map.put("url", url);
-            return RespDTO.onSuc(map);
-        }
-        return RespDTO.onSuc(true);
     }
 
     /**
@@ -379,75 +337,4 @@ public class ViewFacade {
         }
     }
 
-//    /**
-//     * 从webService获取文书详情信息
-//     *
-//     * @param recId
-//     */
-//    public void getRecordContent(String recId) {
-//        List<MedicalRecordContent> medicalRecordContentList = new ArrayList<>();
-//        try {
-//            String html=this.getHtml(recId);
-//            MedicalRecordContent medicalRecordContent = new MedicalRecordContent();
-//            medicalRecordContent.setRecId(recId);
-//            medicalRecordContent.setHospitalId(Long.valueOf("35"));
-//
-//            System.out.println("返回数据:" + html);
-//            medicalRecordContent.setXmlText(html);
-//            //截取rec_id後面的_次數跟接口相對潁上
-//            int inedx = medicalRecordContent.getRecId().lastIndexOf("_");
-//            medicalRecordContent.setRecId(medicalRecordContent.getRecId().substring(0,inedx));
-//            medicalRecordContentList.add(medicalRecordContent);
-//
-//            aMedicalRecordContentFacade.execute(medicalRecordContentList);
-//
-//            aMedAbnormalInfoFacade.saveAbnormalInfo("从webService获取文书详情信息正常", "", recId, JSON.toJSONString(medicalRecordContentList), "");
-//        } catch (Exception e) {
-//            aMedAbnormalInfoFacade.saveAbnormalInfo("从webService获取文书详情信息错误", "", recId, JSON.toJSONString(medicalRecordContentList), e.getMessage());
-//        }
-//    }
-//
-//
-//    public String getHtml(String recId){
-//        String url ="http://132.147.254.142:8093/DocService.asmx/GetDocsHTML";
-//        try {
-//            PostMethod postMethod = null;
-//            postMethod = new PostMethod(url);
-//            postMethod.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
-//            NameValuePair[] data ={
-////                    new NameValuePair("startTime",""),
-//                    new NameValuePair("szDocIDs",recId)
-//            };
-//            postMethod.setRequestBody(data);
-//            org.apache.commons.httpclient.HttpClient httpClient=new org.apache.commons.httpclient.HttpClient();
-//            int response =httpClient.executeMethod(postMethod);
-//            String result =postMethod.getResponseBodyAsString();
-//            String html=this.decode(result);
-//            return html;
-//        }catch (Exception e){
-////            System.out.println("请求异常"+e.getMessage());
-//            throw new RuntimeException(e.getMessage());
-//        }finally {
-//
-//        }
-//    }
-//    /**
-//     * 数值行代码转换成中文
-//     * @param result
-//     * @return
-//     */
-//    public String  decode(String result){
-//        String html=StringEscapeUtils.unescapeXml(result);
-//        String[] tmp =html.split("&#|&#|;");
-//        StringBuilder sb = new StringBuilder();
-//        for (int i = 0; i < tmp.length ; i++) {
-//            if (tmp[i].matches("\\d{5}")){
-//                sb.append((char) Integer.parseInt(tmp[i]));
-//            }else {
-//                sb.append(tmp[i]);
-//            }
-//        }
-//        return sb.toString();
-//    }
-
 }

+ 74 - 0
src/main/java/com/diagbot/task/NhTask.java

@@ -0,0 +1,74 @@
+package com.diagbot.task;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.SysTaskCron;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.SysTaskCronFacade;
+import com.diagbot.facade.ViewFacade;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.web.DataController;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.Trigger;
+import org.springframework.scheduling.TriggerContext;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.SchedulingConfigurer;
+import org.springframework.scheduling.config.ScheduledTaskRegistrar;
+import org.springframework.scheduling.support.CronTrigger;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+
+/**
+ * @author lichangyuan
+ * @create 2021-12-14 11:43
+ */
+//@Configuration      //1.主要用于标记配置类,兼备Component的效果。
+//@EnableScheduling   // 2.开启定时任务
+@Slf4j
+public class NhTask implements SchedulingConfigurer {
+
+    @Autowired
+    private SysTaskCronFacade sysTaskCronFacade;
+
+    private SysTaskCron task001 = new SysTaskCron();
+
+    @Autowired
+    private ViewFacade viewFacade;
+
+    @Override
+    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
+        taskRegistrar.addTriggerTask(new Runnable() {
+            @Override
+            public void run() {
+                //1.添加任务内容(Runnable)
+                if (null != task001
+                        && task001.getIsDeleted().equals(IsDeleteEnum.N.getKey())
+                        && task001.getIsUsed().equals(1)) {
+                    log.info("执行动态定时任务通过入院登记拉取相关视图: " + LocalDateTime.now().toLocalTime());
+                    //开始时间为昨天,结束时间为现在
+                    Date now = DateUtil.now();
+                    viewFacade.executeOldData(DateUtil.formatDateTime(DateUtil.addDate(now,-1)),DateUtil.formatDateTime(now));
+                }
+            }
+        }, new Trigger() {
+            @Override
+            public Date nextExecutionTime(TriggerContext triggerContext) {
+                //2.1 从数据库获取执行周期
+                task001 = sysTaskCronFacade.getOne(new QueryWrapper<SysTaskCron>()
+                        .eq("cron_code", "BE_INFO"), false);
+                //如果没有找到则设置每天晚上十一点执行
+                String cron = "0 0 23 * * ?";
+                //2.2 合法性校验.
+                if (null != task001 && StringUtil.isNotBlank(task001.getCron())) {
+                    cron = task001.getCron();
+                }
+                CronTrigger trigger = new CronTrigger(cron);
+                return trigger.nextExecutionTime(triggerContext);
+            }
+        });
+    }
+
+}

+ 1 - 1
src/main/java/com/diagbot/util/TZDBConn.java

@@ -236,7 +236,7 @@ public class TZDBConn {
 
 	/**
 	 * 从视图获取病案首页信息
-	 * 获取近几个月的数据
+	 *
 	 */
 	public List<HomePage> getHomePage(String sql) {
 		List<HomePage> homePageList=Lists.newLinkedList();

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

@@ -239,12 +239,7 @@ public class DataController {
         viewFacade.executeOldDataOne(behospitalCode);
     }
 
-    @ApiOperation(value = "数据引擎-定时拉去前一天历史数据")
-    @PostMapping("/sendOldData")
-    @SysLogger("sendOldData")
-    public void sendOldData(){
-        viewFacade.executeOldData();
-    }
+
     /*
     @ApiOperation(value = "数据引擎-列字段名和注释")
     @PostMapping("/getColumnZhAndCh")