Browse Source

modeId初始化完善,控制台出院人数查询条件更新,终末病历稽查表输出值改为病案号,更新入院表时更新医生姓名

wanghn 3 months ago
parent
commit
cfc475d434

+ 1 - 0
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -2100,6 +2100,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         List<BehospitalInfoDeptDTO> records = res.getRecords();
         List<BehospitalInfoDeptDTO> resRecords = new ArrayList<>();
 
+        //查询优化
         //非空判断
         if(res.getTotal() == 0){
             IPage<BehospitalInfoDeptDTO> emptyPage = new Page<>(1, 15); // 页码为1,每页10条记录

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

@@ -549,19 +549,19 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
                 modeId=Long.valueOf("25");
             }else if (medicalRecord.getRecTitle().contains("评估表")){
                 modeId=Long.valueOf("65");
-            }else if (medicalRecord.getRecTitle().contains("交班记录") ||
-                    medicalRecord.getRecTitle().contains("接班记录")){
-                modeId=Long.valueOf("4");
-            }else if (medicalRecord.getRecTitle().contains("自杀") ||
+            } else if (medicalRecord.getRecTitle().contains("自杀") ||
                     medicalRecord.getRecTitle().contains("猝死") ||
                     medicalRecord.getRecTitle().contains("冲动") ||
                     medicalRecord.getRecTitle().contains("攻击")) {
                 modeId = Long.valueOf("65");
             }
-            if(medicalRecord.getRecTitle().contains("日常病程")){
-                modeId = Long.valueOf("4");
-            }
         }
+        //modeId初始化修正
+        if(medicalRecord.getRecTitle().contains("日常病程") || medicalRecord.getRecTitle().contains("交班记录") ||
+                medicalRecord.getRecTitle().contains("接班记录")){
+            modeId = Long.valueOf("4");
+        }
+
         return modeId;
     }
 

+ 51 - 4
src/main/java/com/diagbot/facade/data/SendDataDealFacade.java

@@ -3,16 +3,14 @@ package com.diagbot.facade.data;
 
 import com.alibaba.fastjson.JSON;
 import com.diagbot.entity.*;
+import com.diagbot.facade.BasDoctorInfoFacade;
 import com.diagbot.facade.BehospitalInfoFacade;
 import com.diagbot.util.TZDBConn;
 import com.diagbot.vo.AnalyzeRunVO;
-import com.diagbot.vo.AnalyzeVO;
-import com.google.common.collect.Lists;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import java.util.ArrayList;
-import java.util.List;
+import java.util.*;
 
 @Component
 public class SendDataDealFacade {
@@ -35,6 +33,8 @@ public class SendDataDealFacade {
     private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
     @Autowired
     BehospitalInfoFacade behospitalInfoFacade;
+    @Autowired
+    private BasDoctorInfoFacade basDoctorInfoFacade;
 
     private TZDBConn tzDBConn = new TZDBConn();
 
@@ -85,6 +85,29 @@ public class SendDataDealFacade {
         try {
             String sql = "select * from   v_jkcdss_zy_bingrenjbxx where behospitalCode = '"+code+"'";
             behospitalInfos = tzDBConn.getBehospitalInfo(sql);
+
+            //拉取时更新各医生姓名
+            for (BehospitalInfo info : behospitalInfos) {
+                BasDoctorInfo doctorName = basDoctorInfoFacade.lambdaQuery()
+                        .eq(BasDoctorInfo::getDoctorId, info.getDoctorId())
+                        .one();
+                BasDoctorInfo directorDoctorName = basDoctorInfoFacade.lambdaQuery()
+                        .eq(BasDoctorInfo::getDoctorId, info.getDirectorDoctorId())
+                        .one();
+                BasDoctorInfo behDoctorName = basDoctorInfoFacade.lambdaQuery()
+                        .eq(BasDoctorInfo::getDoctorId, info.getBehDoctorId())
+                        .one();
+                if (doctorName != null){
+                    info.setDoctorName(doctorName.getName());
+                }
+                if (directorDoctorName != null){
+                    info.setDirectorDoctorName(directorDoctorName.getName());
+                }
+                if (behDoctorName != null){
+                    info.setBehDoctorName(behDoctorName.getName());
+                }
+            }
+
             aBehospitalInfoFacade.execute(behospitalInfos);
         } catch (Exception e) {
             aMedAbnormalInfoFacade.saveAbnormalInfo("获取病人住院登记历史数据", code, JSON.toJSONString(behospitalInfos), "", e.getMessage());
@@ -102,12 +125,36 @@ public class SendDataDealFacade {
             String sql = "select * from   v_jkcdss_zy_bingrenjbxx t where to_char(t.behospitalDate,'yyyymmdd')>= '"+startDate+" ' " +
                     " and to_char(t.behospitalDate,'yyyymmdd')<= '"+stopDate+" '";
             behospitalInfos = tzDBConn.getBehospitalInfo(sql);
+
+            //拉取时更新各医生姓名
+            for (BehospitalInfo info : behospitalInfos) {
+                BasDoctorInfo doctorName = basDoctorInfoFacade.lambdaQuery()
+                        .eq(BasDoctorInfo::getDoctorId, info.getDoctorId())
+                        .one();
+                BasDoctorInfo directorDoctorName = basDoctorInfoFacade.lambdaQuery()
+                        .eq(BasDoctorInfo::getDoctorId, info.getDirectorDoctorId())
+                        .one();
+                BasDoctorInfo behDoctorName = basDoctorInfoFacade.lambdaQuery()
+                        .eq(BasDoctorInfo::getDoctorId, info.getBehDoctorId())
+                        .one();
+                if (doctorName != null){
+                    info.setDoctorName(doctorName.getName());
+                }
+                if (directorDoctorName != null){
+                    info.setDirectorDoctorName(directorDoctorName.getName());
+                }
+                if (behDoctorName != null){
+                    info.setBehDoctorName(behDoctorName.getName());
+                }
+            }
+
             aBehospitalInfoFacade.execute(behospitalInfos);
         } catch (Exception e) {
             aMedAbnormalInfoFacade.saveAbnormalInfo("获取病人住院登记历史数据", startDate+"--"+stopDate, JSON.toJSONString(behospitalInfos), "", e.getMessage());
         }
         return behospitalInfos;
     }
+    
     /**
      * 获取病人住院登记历史数据
      */

+ 1 - 1
src/main/resources/bootstrap.yml

@@ -2,7 +2,7 @@ spring:
   application:
     name: mrqc-sys
   profiles:
-    active: local
+    active: test
   main:
     allow-bean-definition-overriding: true
 

+ 41 - 41
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -1514,7 +1514,7 @@
         med_behospital_info a
         WHERE
         a.is_deleted = 'N'
-        and a.qc_type_id != 0
+        <!--and a.qc_type_id != 0-->
         <if test="isPlacefile != null and isPlacefile != ''">
             and a.is_placefile = #{isPlacefile}
         </if>
@@ -11884,26 +11884,26 @@
         a.beh_dept_id AS deptId,
         a.beh_dept_name AS deptName,
         GROUP_CONCAT( DISTINCT a.doctor_name) as doctorName,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2658 THEN a.behospital_code else null END ) as RYJLW_24,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2686 THEN a.behospital_code else null END ) as SCBCJLW_8H,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2657 THEN a.behospital_code else null END ) as ZRSCCFW_72H,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 3010 THEN a.behospital_code else null END ) as RYHLJBCW_3D,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2655 THEN a.behospital_code else null END ) as ZRCFW_2W,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2654 THEN a.behospital_code else null END ) as ZZCFW_3W,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2852 THEN a.behospital_code else null END ) as QJJLW_6H,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2287 THEN a.behospital_code else null END ) as HZJLW_24H,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 3025 THEN a.behospital_code else null END ) as SQTLXJW,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2170 THEN a.behospital_code else null END ) as SXJLSW_24H,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2930 THEN a.behospital_code else null END ) as XHSCW_30M,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2900 THEN a.behospital_code else null END ) as SHZDCFW_24H,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2229 THEN a.behospital_code else null END ) as SHJBCW_3D,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2217 THEN a.behospital_code else null END ) as ZKJBCW_3D,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2218 THEN a.behospital_code else null END ) as ZKJLW_24,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2220 THEN a.behospital_code else null END ) as BWZHJLBCW_MD,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2486 THEN a.behospital_code else null END ) as SXHWJL,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 3063 THEN a.behospital_code else null END ) as SXPJW_24,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 3062 THEN a.behospital_code else null END ) as WJZWJL,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2495 THEN a.behospital_code else null END ) as WYWWCXJ
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2658 THEN a.file_code else null END ) as RYJLW_24,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2686 THEN a.file_code else null END ) as SCBCJLW_8H,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2657 THEN a.file_code else null END ) as ZRSCCFW_72H,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 3010 THEN a.file_code else null END ) as RYHLJBCW_3D,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2655 THEN a.file_code else null END ) as ZRCFW_2W,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2654 THEN a.file_code else null END ) as ZZCFW_3W,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2852 THEN a.file_code else null END ) as QJJLW_6H,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2287 THEN a.file_code else null END ) as HZJLW_24H,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 3025 THEN a.file_code else null END ) as SQTLXJW,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2170 THEN a.file_code else null END ) as SXJLSW_24H,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2930 THEN a.file_code else null END ) as XHSCW_30M,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2900 THEN a.file_code else null END ) as SHZDCFW_24H,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2229 THEN a.file_code else null END ) as SHJBCW_3D,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2217 THEN a.file_code else null END ) as ZKJBCW_3D,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2218 THEN a.file_code else null END ) as ZKJLW_24,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2220 THEN a.file_code else null END ) as BWZHJLBCW_MD,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2486 THEN a.file_code else null END ) as SXHWJL,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 3063 THEN a.file_code else null END ) as SXPJW_24,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 3062 THEN a.file_code else null END ) as WJZWJL,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2495 THEN a.file_code else null END ) as WYWWCXJ
         -- sum(c.cases_entry_id = 2658) as RYJLW_24,
         -- sum(c.cases_entry_id = 2686) as SCBCJLW_8H,
         -- sum(c.cases_entry_id = 2657) as ZRSCCFW_72H,
@@ -11984,26 +11984,26 @@
         a.beh_dept_name AS deptName,
         a.doctor_name as doctorGroup,
         a.doctor_name as doctorName,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2658 THEN a.behospital_code else null END ) as RYJLW_24,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2686 THEN a.behospital_code else null END ) as SCBCJLW_8H,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2657 THEN a.behospital_code else null END ) as ZRSCCFW_72H,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 3010 THEN a.behospital_code else null END ) as RYHLJBCW_3D,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2655 THEN a.behospital_code else null END ) as ZRCFW_2W,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2654 THEN a.behospital_code else null END ) as ZZCFW_3W,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2852 THEN a.behospital_code else null END ) as QJJLW_6H,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2287 THEN a.behospital_code else null END ) as HZJLW_24H,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 3025 THEN a.behospital_code else null END ) as SQTLXJW,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2170 THEN a.behospital_code else null END ) as SXJLSW_24H,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2930 THEN a.behospital_code else null END ) as XHSCW_30M,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2900 THEN a.behospital_code else null END ) as SHZDCFW_24H,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2229 THEN a.behospital_code else null END ) as SHJBCW_3D,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2217 THEN a.behospital_code else null END ) as ZKJBCW_3D,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2218 THEN a.behospital_code else null END ) as ZKJLW_24,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2220 THEN a.behospital_code else null END ) as BWZHJLBCW_MD,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2486 THEN a.behospital_code else null END ) as SXHWJL,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 3063 THEN a.behospital_code else null END ) as SXPJW_24,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 3062 THEN a.behospital_code else null END ) as WJZWJL,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2495 THEN a.behospital_code else null END ) as WYWWCXJ
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2658 THEN a.file_code else null END ) as RYJLW_24,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2686 THEN a.file_code else null END ) as SCBCJLW_8H,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2657 THEN a.file_code else null END ) as ZRSCCFW_72H,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 3010 THEN a.file_code else null END ) as RYHLJBCW_3D,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2655 THEN a.file_code else null END ) as ZRCFW_2W,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2654 THEN a.file_code else null END ) as ZZCFW_3W,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2852 THEN a.file_code else null END ) as QJJLW_6H,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2287 THEN a.file_code else null END ) as HZJLW_24H,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 3025 THEN a.file_code else null END ) as SQTLXJW,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2170 THEN a.file_code else null END ) as SXJLSW_24H,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2930 THEN a.file_code else null END ) as XHSCW_30M,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2900 THEN a.file_code else null END ) as SHZDCFW_24H,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2229 THEN a.file_code else null END ) as SHJBCW_3D,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2217 THEN a.file_code else null END ) as ZKJBCW_3D,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2218 THEN a.file_code else null END ) as ZKJLW_24,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2220 THEN a.file_code else null END ) as BWZHJLBCW_MD,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2486 THEN a.file_code else null END ) as SXHWJL,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 3063 THEN a.file_code else null END ) as SXPJW_24,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 3062 THEN a.file_code else null END ) as WJZWJL,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2495 THEN a.file_code else null END ) as WYWWCXJ
         FROM
         med_behospital_info a,
         med_qcresult_info b,