Переглянути джерело

新增拉取更具入院时间拉取前一天的入院登记信息和判断没有出院时间的入院登记信息文书数量是否一致

shiyue 3 роки тому
батько
коміт
b3f4913920

+ 16 - 0
src/main/java/com/diagbot/facade/ViewFacade.java

@@ -99,12 +99,16 @@ public class ViewFacade {
         String lisSql = "select * from ASSAY_LIST where repDate >= '" + DateUtil.yesterdayFormate() + "' and behospitalNum is not null";
         String pacsSql = "select * from CHECK_LIST where repDate >= '" + DateUtil.yesterdayFormate() + "' and behospitalNum is not null";
         String infoSql = "select * from admission_pat_regist where leaveHospitalDate >= '" + DateUtil.yesterdayFormate() + "'";
+        String infoBeSql = "select * from admission_pat_regist where behospitalDate >= '" + DateUtil.yesterdayFormate() + "'";
 
         try {
             Long startTime = System.currentTimeMillis();
             //更新前一天出院的入院登记信息
             this.getInfo(infoSql);
 
+            //更新前一天入院的入院登记信息
+            this.getInfo(infoBeSql);
+
             //得到全部的科室信息并添加修改
             this.getDeptInfo(deptSql);
 
@@ -574,14 +578,26 @@ public class ViewFacade {
     public void execute(String date) {
         LocalDateTime now = LocalDateTime.now();
         now = now.minus(Integer.parseInt(date), ChronoUnit.DAYS);
+        //获取出院时间在date之内的病人信息
         List<BehospitalInfo> list = aBehospitalInfoFacade.list(new QueryWrapper<BehospitalInfo>()
                 .le("leave_hospital_date", DateUtil.now())
                 .ge("leave_hospital_date", now));
+        //获取无出院时间的病人信息
+        List<BehospitalInfo> infoList = aBehospitalInfoFacade.list(new QueryWrapper<BehospitalInfo>()
+                .eq("hospital_id", Long.valueOf("35"))
+                .isNull("leave_hospital_date"));
+        //获取出院时间date天之内的的病人信息
         if (list.size() > 0) {
             list.forEach(behospitalInfo -> {
                 this.IfCoincide(behospitalInfo.getBehospitalCode());
             });
         }
+        //获取无出院时间的运行质控的病人信息
+        if (infoList.size() > 0) {
+            infoList.forEach(info -> {
+                this.IfCoincide(info.getBehospitalCode());
+            });
+        }
     }
 
     /**

+ 7 - 7
src/main/java/com/diagbot/facade/data/ABehospitalInfoFacade.java

@@ -166,12 +166,12 @@ public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
      */
     private Long initQcTypeId(BehospitalInfo s) {
         Long qcTypeId = Long.valueOf("0");
-        List<MedicalRecord> list =medicalRecordFacade.list(new QueryWrapper<MedicalRecord>()
-        .eq("behospital_code",s.getBehospitalCode())
-        .eq("hospital_id",s.getHospitalId())
-        .eq("mode_id",1)
-        .eq("is_deleted",IsDeleteEnum.N));
-        if (list.size()>0){
+//        List<MedicalRecord> list =medicalRecordFacade.list(new QueryWrapper<MedicalRecord>()
+//        .eq("behospital_code",s.getBehospitalCode())
+//        .eq("hospital_id",s.getHospitalId())
+//        .eq("mode_id",1)
+//        .eq("is_deleted",IsDeleteEnum.N));
+//        if (list.size()>0){
             //先按照疾病查找对映的质控类型没有再按照科室
             List<QcType> qcTypes =qcTypeFacade.list(new QueryWrapper<QcType>()
                     .eq("name", StringUtils.isNotEmpty(s.getDiagnose())?s.getDiagnose():"")
@@ -204,7 +204,7 @@ public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
                     qcTypeId = qcType.getId();
                 }
             }
-        }
+//        }
         return qcTypeId;
     }
 

+ 22 - 0
src/main/java/com/diagbot/facade/data/AMedicalRecordFacade.java

@@ -439,6 +439,28 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
                             behospitalInfo.setQcTypeId(qcTypeId);
                             behospitalInfoList.add(behospitalInfo);
                         }
+                    }else if (modeId == Long.valueOf("33")){
+                        //33为日间病例   如果有的话qc_type_id 设置为0
+                        BehospitalInfo behospitalInfo = behospitalInfoFacade.getOne(new QueryWrapper<BehospitalInfo>()
+                                .eq("behospital_code", s.getBehospitalCode())
+                                .eq("hospital_id", s.getHospitalId()), false);
+                        if (behospitalInfo == null) {
+                            //如果不存在则取视图上查询并添加
+                            String code =s.getBehospitalCode();
+                            String hospitalCode = code.substring(0, code.indexOf("_"));
+                            String hospitalNum = code.substring(hospitalCode.length() + 1, code.length());
+                            String infoSql = "select * from admission_pat_regist where behospitalCode = '" + hospitalCode + "' and behospitalNum = '" + hospitalNum + "'";
+                            viewFacade.getInfo(infoSql);
+                            behospitalInfo = behospitalInfoFacade.getOne(new QueryWrapper<BehospitalInfo>()
+                                    .eq("behospital_code", s.getBehospitalCode())
+                                    .eq("hospital_id", s.getHospitalId()), false);
+                        }
+                        if (behospitalInfo != null){
+                            //如果病人住院信息存在,更新对应的qc_type_id
+                            Long qcTypeId = Long.valueOf("0");
+                            behospitalInfo.setQcTypeId(qcTypeId);
+                            behospitalInfoList.add(behospitalInfo);
+                        }
                     }
                     s.setModeId(modeId);
                     //新增或修改

+ 22 - 14
src/main/java/com/diagbot/web/DataController.java

@@ -258,21 +258,29 @@ public class DataController {
         viewFacade.executeHome();
     }
 
-    /*
-    @ApiOperation(value = "数据引擎-列字段名和注释")
-    @PostMapping("/getColumnZhAndCh")
-    @SysLogger("getColumnZhAndCh")
-    public RespDTO getColumnZhAndCh(){
-        aStrConsultationNoteFacade.getColumnZhAndCh();
-        return RespDTO.onSuc(true);
-    }
-    @Autowired
-    private ColumnFacade columnFacade;
-    @ApiOperation(value = "病历解析")
+//    /*
+//    @ApiOperation(value = "数据引擎-列字段名和注释")
+//    @PostMapping("/getColumnZhAndCh")
+//    @SysLogger("getColumnZhAndCh")
+//    public RespDTO getColumnZhAndCh(){
+//        aStrConsultationNoteFacade.getColumnZhAndCh();
+//        return RespDTO.onSuc(true);
+//    }
+//    @Autowired
+//    private ColumnFacade columnFacade;
+//    @ApiOperation(value = "病历解析")
+//    @PostMapping("/analyseRec")
+//    @SysLogger("analyseRec")
+//    public RespDTO analyseRec(@RequestBody AColumnVO aColumnVO){
+//        columnFacade.analyseRec(aColumnVO.getHospitalId(),aColumnVO.getModeId(),aColumnVO.getContent());
+//        return RespDTO.onSuc(true);
+//    }
+
+    @ApiOperation(value = "文书补传")
     @PostMapping("/analyseRec")
     @SysLogger("analyseRec")
-    public RespDTO analyseRec(@RequestBody AColumnVO aColumnVO){
-        columnFacade.analyseRec(aColumnVO.getHospitalId(),aColumnVO.getModeId(),aColumnVO.getContent());
+    public RespDTO analyseRec(String param){
+        viewFacade.execute(param);
         return RespDTO.onSuc(true);
-    }*/
+    }
 }

+ 3 - 3
src/main/resources/application-test.yml

@@ -59,9 +59,9 @@ spring:
     druid:
       driver-class-name: com.mysql.cj.jdbc.Driver
       platform: mysql
-      url: jdbc:mysql://127.0.0.1:3306/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
+      url: jdbc:mysql://192.168.2.237:3306/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
       username: root
-      password: root
+      password: lantone
       # 连接池的配置信息
       # 初始化大小,最小,最大
       initialSize: 5
@@ -114,7 +114,7 @@ spring:
 #    host: 192.168.2.241  #Redis服务器地址
       cache: 3 # cache索引
       token: 3 # Token索引
-    host: 192.168.1.242  #Redis服务器地址
+    host: 192.168.2.236  #Redis服务器地址
     port: 6379 # Redis服务器连接端口(本地环境端口6378,其他环境端口是6379)
     password: lantone # Redis服务器连接密码(默认为空)
     lettuce: