Преглед на файлове

Merge branch 'dev/20200702_1.3.7' into debug

gaodm преди 5 години
родител
ревизия
8d60813462

+ 6 - 6
doc/013.20200706v1.3.7/qc_initv1.3.7.sql

@@ -351,13 +351,13 @@ INSERT INTO `sys_permission` VALUES ('103', 'N', '1970-01-01 12:00:00', '1970-01
 
 -- ----------------------------
 
-INSERT INTO `sys_role_menu` VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '35', '用户-质控科-出院人数统计');
-INSERT INTO `sys_role_menu` VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '36', '用户-质控科-质控核查统计');
+INSERT INTO `sys_role_menu`( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`)  VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '35', '用户-质控科-出院人数统计');
+INSERT INTO `sys_role_menu`( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`)  VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '36', '用户-质控科-质控核查统计');
 
 
 -- ----------------------------
 
-INSERT INTO `sys_role_permission` VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '101', null);
-INSERT INTO `sys_role_permission` VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '1', '101', null);
-INSERT INTO `sys_role_permission` VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '102', '数据报表明细-出院人数统计');
-INSERT INTO `sys_role_permission` VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '103', '数据报表明细-质控核查统计');
+INSERT INTO `sys_role_permission` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `permission_id`, `remark`)  VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '101', null);
+INSERT INTO `sys_role_permission` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `permission_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '1', '101', null);
+INSERT INTO `sys_role_permission` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `permission_id`, `remark`)  VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '102', '数据报表明细-出院人数统计');
+INSERT INTO `sys_role_permission` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `permission_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '103', '数据报表明细-质控核查统计');

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

@@ -480,7 +480,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         List<QcModeDTO> qcModeDTOList = qcModeFacade.getMenu(pageMap);
         String menuData = JSON.toJSONString(qcModeDTOList);
 
-        Date date = qcresultInfoFacade.saveQcResult(algorithmDTO, algorithmVO, analyzeVO, pageData, menuData, analyzeVO.getIsTask());
+        Date date = qcresultInfoFacade.saveQcResult(algorithmDTO, algorithmVO, analyzeVO, pageData, menuData, analyzeVO.getIsTask(), null);
 
         // 返回提示信息
         //        List<MsgDTO> msgDTOList = getMsg(analyzeVO);

+ 17 - 12
src/main/java/com/diagbot/facade/ConsoleFacade.java

@@ -880,6 +880,7 @@ public class ConsoleFacade {
             return null;
         }
 
+        item.setDeptName("全院");
 
         //总病历数
         Integer mrNum = records
@@ -889,22 +890,32 @@ public class ConsoleFacade {
         if (mrNum == null || mrNum == 0) {
             return null;
         }
+        item.setMrNum(mrNum);
         //核查病历数
         Integer checkedNum = records
                 .stream()
                 .map(HomePageImproveDTO::getCheckedNum)
                 .reduce(0, Integer::sum);
-        //核查病历占比
-        Double checkedPercent = BigDecimal.valueOf(checkedNum)
-                .divide(BigDecimal.valueOf(mrNum), 4, RoundingMode.HALF_UP)
-                .doubleValue();
-        String checkedPercentStr
-                = df.format(BigDecimal.valueOf(checkedPercent).multiply(BigDecimal.valueOf(100))) + "%";
+        item.setCheckedNum(checkedNum);
+        if (mrNum != null && !mrNum.equals(0)) {
+            //核查病历占比
+            Double checkedPercent = BigDecimal.valueOf(checkedNum)
+                    .divide(BigDecimal.valueOf(mrNum), 4, RoundingMode.HALF_UP)
+                    .doubleValue();
+            String checkedPercentStr
+                    = df.format(BigDecimal.valueOf(checkedPercent).multiply(BigDecimal.valueOf(100))) + "%";
+            item.setCheckedPercent(checkedPercent);
+            item.setCheckedPercentStr(checkedPercentStr);
+        }
         //带病案首页的病历数
         Integer homePageMRNum = records
                 .stream()
                 .map(HomePageImproveDTO::getHomePageMRNum)
                 .reduce(0, Integer::sum);
+        item.setHomePageMRNum(homePageMRNum);
+        if (homePageMRNum == null || homePageMRNum.equals(0)) {
+            return item;
+        }
         //改善病历数
         Integer improveNum = records
                 .stream()
@@ -939,12 +950,6 @@ public class ConsoleFacade {
         String improveToFullPercentStr
                 = df.format(BigDecimal.valueOf(improveToFullPercent).multiply(BigDecimal.valueOf(100))) + "%";
 
-        item.setDeptName("全院");
-        item.setMrNum(mrNum);
-        item.setCheckedNum(checkedNum);
-        item.setCheckedPercent(checkedPercent);
-        item.setCheckedPercentStr(checkedPercentStr);
-        item.setHomePageMRNum(homePageMRNum);
         item.setImproveNum(improveNum);
         item.setImprovePercent(improvePercent);
         item.setImprovePercentStr(improvePercentStr);

+ 9 - 6
src/main/java/com/diagbot/facade/QcresultInfoFacade.java

@@ -79,13 +79,13 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
             throw new CommonException(CommonErrorCode.NOT_EXISTS, "该医院下该病历号不存在!");
         }
         //验证是否评估过
-        Integer cnt
-                = this.count(
+        QcresultInfo qcresultInfo
+                = this.getOne(
                 new QueryWrapper<QcresultInfo>()
                         .eq("is_deleted", IsDeleteEnum.N.getKey())
                         .eq("hospital_id", hospitalId)
-                        .eq("behospital_code", qcresultVO.getBehospitalCode()));
-        if (cnt < 1) {
+                        .eq("behospital_code", qcresultVO.getBehospitalCode()), false);
+        if (null == qcresultInfo) {
             throw new CommonException(CommonErrorCode.NOT_EXISTS, "该病历尚未评分,请先评分!");
         }
         //查询质控评分明细信息
@@ -111,7 +111,7 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
         AnalyzeVO analyzeVO = new AnalyzeVO();
         analyzeVO.setHospitalId(hospitalId);
         analyzeVO.setBehospitalCode(qcresultVO.getBehospitalCode());
-        Date date = this.saveQcResult(algorithmDTO, algorithmVO, analyzeVO, null, null, false);
+        Date date = this.saveQcResult(algorithmDTO, algorithmVO, analyzeVO, null, null, false, qcresultInfo);
         //返回参数组装
         AnalyzeDTO analyzeDTO = new AnalyzeDTO();
         analyzeDTO.setBehospitalCode(qcresultVO.getBehospitalCode());
@@ -136,7 +136,7 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
      * @return 评分的时间
      */
     public Date saveQcResult(AlgorithmDTO algorithmDTO, AlgorithmVO algorithmVO, AnalyzeVO analyzeVO,
-                             String pageData, String menuData, Boolean isTask) {
+                             String pageData, String menuData, Boolean isTask, QcresultInfo qcresultInfoOld) {
         //更新质控评分结果信息
         Long useId = 0L;
         if (!isTask) {
@@ -153,6 +153,9 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
                 .set("gmt_modified", now));
         //新增记录
         QcresultInfo qcresultInfo = new QcresultInfo();
+        if (qcresultInfoOld != null) {
+            BeanUtil.copyProperties(qcresultInfoOld, qcresultInfo);
+        }
         qcresultInfo.setBehospitalCode(analyzeVO.getBehospitalCode());
         qcresultInfo.setHospitalId(analyzeVO.getHospitalId());
         qcresultInfo.setScoreRes(algorithmDTO.getScore());

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

@@ -2865,7 +2865,7 @@
             AND a.NAME LIKE CONCAT( '%', #{qcResultShortPageVO.patName}, '%' )
         </if>
         <if test="qcResultShortPageVO.casesEntryName != null and qcResultShortPageVO.casesEntryName != ''">
-            AND d.NAME LIKE CONCAT( '%', #{qcResultShortPageVO.casesEntryName}, '%' )
+            AND d.NAME = #{qcResultShortPageVO.casesEntryName}
         </if>
         <if test="qcResultShortPageVO.doctorId != null and qcResultShortPageVO.doctorId != ''">
             AND (a.doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
@@ -2894,9 +2894,9 @@
         </if>
         )be
         left join med_check_info mci
-        on mci.is_deleted='N'
-        and be.hospital_id=mci.hospital_id
-        and be.behospital_code=mci.behospital_code
+        on mci.is_deleted = 'N'
+        and be.hospital_id = mci.hospital_id
+        and be.behospital_code = mci.behospital_code
         )tt1
         <if test="qcResultShortPageVO.casesEntryId != null and qcResultShortPageVO.casesEntryId==2511">
             ,med_medical_record tt2
@@ -3767,7 +3767,10 @@
 
     <!-- 离院病人评分详情页-->
     <select id="leaveHosMRPage" resultType="com.diagbot.dto.QcResultShortDTO">
-        SELECT DISTINCT
+        SELECT
+        t.*
+        FROM
+        (SELECT DISTINCT
         t1.hospital_id AS hospitalId,
         t1.behospital_code AS behospitalCode,
         t1.bed_code AS bedCode,
@@ -3885,19 +3888,11 @@
             AND tt3.`name` = '手术记录'
         </if>
         ) be
-        <if test="qcResultShortPageVO.checkStatus != null">
-            ,med_check_info mci
-            WHERE
-            mci.is_deleted = 'N'
-            AND be.hospital_id = mci.hospital_id
-            AND be.behospital_code = mci.behospital_code
-            AND mci.status = #{qcResultShortPageVO.checkStatus}
-        </if>
-        <if test="qcResultShortPageVO.checkStatus == null">
-            LEFT JOIN med_check_info mci ON mci.is_deleted = 'N'
-            AND be.hospital_id = mci.hospital_id
-            AND be.behospital_code = mci.behospital_code
-        </if>
+        left join med_check_info mci
+        on
+        mci.is_deleted = 'N'
+        AND be.hospital_id = mci.hospital_id
+        AND be.behospital_code = mci.behospital_code
         )t1
         <if test="qcResultShortPageVO.leaveHosType != null and qcResultShortPageVO.leaveHosType ==2">
             ,med_home_page t2
@@ -3931,6 +3926,11 @@
             AND t1.hospital_id = t2.hospital_id
             AND t1.behospital_code = t2.behospital_code
         </if>
+        )t
+        where 1=1
+        <if test="qcResultShortPageVO.checkStatus != null">
+            and t.checkStatus = #{qcResultShortPageVO.checkStatus}
+        </if>
     </select>
 
     <!-- 病案首页改善率统计(首页)-->
@@ -4123,7 +4123,7 @@
         AND a.behospital_code = c.behospital_code
         AND a.qc_type_id != 0
         AND a.is_placefile = '1'
-        AND c.`status` = 1
+        AND ifnull(c.`status`,0) = 1
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
         </if>