فهرست منبع

Merge remote-tracking branch 'origin/develop' into innerDevelop

# Conflicts:
#	pom.xml
chengyao 3 سال پیش
والد
کامیت
7940cd9231
29فایلهای تغییر یافته به همراه1039 افزوده شده و 292 حذف شده
  1. 91 24
      doc/031.20210326v2.0.2/qc_initv2.0.2.sql
  2. 13 0
      doc/033.20210608v2.0.4/qc_initv2.0.4.sql
  3. 35 4
      src/main/java/com/diagbot/aggregate/LeaveHosStatisticsAggregate.java
  4. 7 0
      src/main/java/com/diagbot/config/ResourceServerConfigurer.java
  5. 7 1
      src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
  6. 1 1
      src/main/java/com/diagbot/dto/JwtDTO.java
  7. 5 4
      src/main/java/com/diagbot/dto/MedManageParamsDTO.java
  8. 6 6
      src/main/java/com/diagbot/dto/ReBeHosByDeptDTO.java
  9. 7 6
      src/main/java/com/diagbot/dto/ReBeHosDTO.java
  10. 18 4
      src/main/java/com/diagbot/dto/ReBeHosDetailByDeptDTO.java
  11. 21 4
      src/main/java/com/diagbot/dto/ReBeHosDetailDTO.java
  12. 8 1
      src/main/java/com/diagbot/dto/ReBeHosMergeDTO.java
  13. 0 20
      src/main/java/com/diagbot/entity/MedIndexResult.java
  14. 11 0
      src/main/java/com/diagbot/enums/QualityContent.java
  15. 57 41
      src/main/java/com/diagbot/facade/BehospitalInfoFacade.java
  16. 1 2
      src/main/java/com/diagbot/facade/ConsoleByDeptExportFacade.java
  17. 51 3
      src/main/java/com/diagbot/facade/ConsoleByDeptFacade.java
  18. 1 2
      src/main/java/com/diagbot/facade/ConsoleExportFacade.java
  19. 376 33
      src/main/java/com/diagbot/facade/ConsoleFacade.java
  20. 2 0
      src/main/java/com/diagbot/facade/FilterFacade.java
  21. 38 30
      src/main/java/com/diagbot/facade/SysUserFacade.java
  22. 1 1
      src/main/java/com/diagbot/vo/AnalyzeVO.java
  23. 2 0
      src/main/java/com/diagbot/vo/ReBeHosPageVO.java
  24. 0 2
      src/main/java/com/diagbot/web/BehospitalInfoController.java
  25. 1 1
      src/main/java/com/diagbot/web/SysUserController.java
  26. 1 1
      src/main/resources/bootstrap.yml
  27. 271 95
      src/main/resources/mapper/BehospitalInfoMapper.xml
  28. 7 5
      src/main/resources/mapper/MedIndexResultMapper.xml
  29. 0 1
      src/main/resources/mapper/MedicalRecordMapper.xml

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 91 - 24
doc/031.20210326v2.0.2/qc_initv2.0.2.sql


+ 13 - 0
doc/033.20210608v2.0.4/qc_initv2.0.4.sql

@@ -0,0 +1,13 @@
+use `qc`;
+
+-- 字典表加入密码正则表达式  不同的医院需要修改id为对应的医院id
+SET @id ='4';
+INSERT INTO `sys_dictionary_info` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '30', @id, '^(?=.*?[A-Z])(?=(.*[a-z]){1,})(?=(.*[\\d]){1,})(?=(.*[\\W]){1,})(?!.*\\s).{8,12}$', '2', '0', '正则表达式(至少8个字符,少于12个字符,大写字母+小写字母+数字+特殊字符)');
+
+UPDATE `sys_menu` SET `name`='31日再入院病历数' WHERE (`name`='31日再入院病人数');
+UPDATE `sys_menu` SET `name`='31日再入院病历数' WHERE (`name`='31日再入院病人数');
+UPDATE `sys_permission` SET  `name`='31日再入院病历数报表',`descritpion`='31日再入院病历数报表' WHERE (`permissionUrl`='/console/reHos31DaysPage');
+UPDATE `sys_permission` SET  `name`='31日再入院病历数报表',`descritpion`='31日再入院病历数报表(科室)' WHERE (`permissionUrl`='/consoleByDept/reHos31DaysPageByDept');
+
+
+

+ 35 - 4
src/main/java/com/diagbot/aggregate/LeaveHosStatisticsAggregate.java

@@ -1,15 +1,20 @@
 package com.diagbot.aggregate;
 
+import com.diagbot.dto.ReBeHosDTO;
 import com.diagbot.facade.BehospitalInfoFacade;
+import com.diagbot.facade.ConsoleFacade;
+import com.diagbot.util.BeanUtil;
 import com.diagbot.vo.FilterVO;
+import com.diagbot.vo.ReBeHosPageVO;
 import io.github.lvyahui8.spring.annotation.DataConsumer;
 import io.github.lvyahui8.spring.annotation.DataProvider;
 import io.github.lvyahui8.spring.annotation.InvokeParameter;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import java.util.LinkedHashMap;
-import java.util.Map;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
 
 /**
  * @Description:
@@ -20,6 +25,8 @@ import java.util.Map;
 public class LeaveHosStatisticsAggregate {
     @Autowired
     private BehospitalInfoFacade behospitalInfoFacade;
+    @Autowired
+    private ConsoleFacade consoleFacade;
 
     @DataProvider("setAllLeaveHos")
     public Map<String, Object> setAllLeaveHos(
@@ -37,7 +44,7 @@ public class LeaveHosStatisticsAggregate {
         retMap.put("新生儿人数", newBornNum);
         retMap.put("手术病人数", operationNum);
         retMap.put("非医嘱离院病人数", nonAdviceNum);
-        retMap.put("31日再入院病数", reBehospitalNum);
+        retMap.put("31日再入院病数", reBehospitalNum);
         return retMap;
 
     }
@@ -105,6 +112,30 @@ public class LeaveHosStatisticsAggregate {
      */
     @DataProvider("get31DaysBehospitalCount")
     public Integer get31DaysBehospitalCount(@InvokeParameter("filterVO") FilterVO filterVO) {
-        return behospitalInfoFacade.get31DaysBehospitalCount(filterVO);
+        ReBeHosPageVO reBeHosPageVO = new ReBeHosPageVO();
+        BeanUtil.copyProperties(filterVO,reBeHosPageVO);
+        reBeHosPageVO.setStartDate(timeTrans(filterVO.getStartDate()));
+        reBeHosPageVO.setEndDate(timeTrans(filterVO.getEndDate()));
+        reBeHosPageVO.setFlag(31);
+        List<ReBeHosDTO> records = consoleFacade.reHos31DaysPage(reBeHosPageVO).getRecords();
+        Set<String> codeList = new HashSet<>();
+        records.forEach(obj->{
+            obj.getDetails().forEach(opj->{
+                codeList.add(opj.getBehospitalCode());
+            });
+        });
+        return codeList.size();
+    }
+
+    public static Date timeTrans(String time){
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        try {
+            Date date = format.parse(time);
+            return date;
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return new Date();
+
     }
 }

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

@@ -235,7 +235,14 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/consoleByDept/medicalCheckFormKs").permitAll()
                 .antMatchers("/print/export/medicalCheckExportByDept").permitAll()
                 .antMatchers("/consoleByDept/medicalCheckTitleKs").permitAll()
+                .antMatchers("/console/qualityControl").permitAll()
+                .antMatchers("/console/export/qualityControlExport").permitAll()
+                .antMatchers("/consoleByDept/qualityControlByDept").permitAll()
+                .antMatchers("/print/export/qualityControlExportByDept").permitAll()
+                .antMatchers("/qc/behospitalInfo/getMedQualityCoList").permitAll()
+                .antMatchers("/console/saveMedicaIndicator").permitAll()
                 .antMatchers("/qc/medCheckInfo/createMedBeHospitalInfoType").permitAll()
+                .antMatchers("/qc/medCheckInfo/addMedCheckInfo").permitAll()
                 .antMatchers("/**").authenticated();
         //                .antMatchers("/**").permitAll();
     }

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

@@ -279,14 +279,20 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/consoleByDept/medicalCheckFormKs", request)
                 || matchers("/print/export/medicalCheckExportByDept", request)
                 || matchers("/consoleByDept/medicalCheckTitleKs", request)
+                || matchers("/console/qualityControl", request)
+                || matchers("/console/export/qualityControlExport", request)
+                || matchers("/consoleByDept/qualityControlByDept", request)
+                || matchers("/print/export/qualityControlExportByDept", request)
+                || matchers("/qc/behospitalInfo/getMedQualityCoList", request)
+                || matchers("/console/saveMedicaIndicator", request)
                 || matchers("/qc/medCheckInfo/createMedBeHospitalInfoType", request)
+                || matchers("/qc/medCheckInfo/addMedCheckInfo", request)
                 || matchers("/", request)) {
             return true;
         }
         return false;
     }
 
-
     private boolean matchers(String url, HttpServletRequest request) {
         AntPathRequestMatcher matcher = new AntPathRequestMatcher(url);
         if (matcher.matches(request)) {

+ 1 - 1
src/main/java/com/diagbot/dto/JwtDTO.java

@@ -20,5 +20,5 @@ public class JwtDTO {
     //用户权限列表
     private List<SysRoleDTO> selRoles;
     //用户密码复杂度是否符合
-//    private String passwordComplexity;
+    private String passwordComplexity;
 }

+ 5 - 4
src/main/java/com/diagbot/dto/MedManageParamsDTO.java

@@ -37,10 +37,11 @@ public class MedManageParamsDTO implements Serializable {
     //医嘱状态判别
     private String daStatus;
 
-    /**
-     * 住院科室名称
-     */
-    private String behDeptName;
+    //病历标题
+    private String content;
+
+    //文书内容(blob)
+    private String rec_title;
 
 
 

+ 6 - 6
src/main/java/com/diagbot/dto/ReBeHosByDeptDTO.java

@@ -25,19 +25,19 @@ public class ReBeHosByDeptDTO {
      */
     @Excel(name = "性别", width = 10, needMerge = true, orderNum = "2")
     private String sex;
-    /**
-     * 主诊断
-     */
-    @Excel(name = "主诊断", width = 50, needMerge = true, orderNum = "3")
-    private String diagnose;
+
     /**
      * 间隔天数
      */
     @Excel(name = "间隔天数", width = 10, needMerge = true, orderNum = "4")
     private Integer diffDays;
+
+    @Excel(name = "是否有出院31天内再住院计划", width = 30, needMerge = true,  orderNum = "5")
+    private String lastAgainBehospitalPlan;//31天再入院计划(是/否)
+
     /**
      * 比较病历组
      */
-    @ExcelCollection(name = "", orderNum = "5")
+    @ExcelCollection(name = "", orderNum = "6")
     private List<ReBeHosDetailByDeptDTO> details;
 }

+ 7 - 6
src/main/java/com/diagbot/dto/ReBeHosDTO.java

@@ -25,19 +25,20 @@ public class ReBeHosDTO {
      */
     @Excel(name = "性别", width = 10, needMerge = true, orderNum = "2")
     private String sex;
-    /**
-     * 主诊断
-     */
-    @Excel(name = "主诊断", width = 50, needMerge = true, orderNum = "3")
-    private String diagnose;
+
     /**
      * 间隔天数
      */
     @Excel(name = "间隔天数", width = 10, needMerge = true, orderNum = "4")
     private Integer diffDays;
+
+
+    @Excel(name = "是否有出院31天内再住院计划", width = 30, needMerge = true,  orderNum = "5")
+    private String lastAgainBehospitalPlan;//31天再入院计划(是/否)
+
     /**
      * 比较病历组
      */
-    @ExcelCollection(name = "", orderNum = "5")
+    @ExcelCollection(name = "", orderNum = "6")
     private List<ReBeHosDetailDTO> details;
 }

+ 18 - 4
src/main/java/com/diagbot/dto/ReBeHosDetailByDeptDTO.java

@@ -25,6 +25,7 @@ public class ReBeHosDetailByDeptDTO {
      */
     @Excel(name = "病人姓名", width = 20, orderNum = "2")
     private String name;
+
     /**
      * 病历等级
      */
@@ -51,26 +52,39 @@ public class ReBeHosDetailByDeptDTO {
      */
     @Excel(name = "主管医生", width = 50, orderNum = "6")
     private String doctorName;
+
+    /**
+     * 入院诊断
+     */
+    @Excel(name = "入院诊断", width = 50, needMerge = true, orderNum = "7")
+    private String diagnose;
+
+    /**
+     * 出院诊断
+     */
+    @Excel(name = "出院诊断", width = 50, needMerge = true, orderNum = "8")
+    private String diagnoseName;
+
     /**
      * 出院日期
      */
-    @Excel(name = "出院日期", format = "yyyy-MM-dd", width = 30, orderNum = "7")
+    @Excel(name = "出院日期", format = "yyyy-MM-dd", width = 30, orderNum = "9")
     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     private Date leaveHospitalDate;
     /**
      * 入院日期
      */
-    @Excel(name = "入院日期", format = "yyyy-MM-dd", width = 30, orderNum = "8")
+    @Excel(name = "入院日期", format = "yyyy-MM-dd", width = 30, orderNum = "10")
     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     private Date behospitalDate;
     /**
      * 住院天数
      */
-    @Excel(name = "住院天数", width = 15, orderNum = "9")
+    @Excel(name = "住院天数", width = 15, orderNum = "11")
     private String behospitalDayNum;
     /**
      * 住院费用
      */
-    @Excel(name = "住院费用", width = 15, orderNum = "10")
+    @Excel(name = "住院费用", width = 15, orderNum = "12")
     private String totleFee;
 }

+ 21 - 4
src/main/java/com/diagbot/dto/ReBeHosDetailDTO.java

@@ -25,6 +25,8 @@ public class ReBeHosDetailDTO {
      */
     @Excel(name = "病人姓名", width = 20, orderNum = "2")
     private String name;
+
+
     /**
      * 病历等级
      */
@@ -44,26 +46,41 @@ public class ReBeHosDetailDTO {
      */
     @Excel(name = "科室", width = 50, orderNum = "5")
     private String behDeptName;
+
+    /**
+     * 入院诊断
+     */
+    @Excel(name = "入院诊断", width = 50, needMerge = true, orderNum = "6")
+    private String diagnose;
+
+    /**
+     * 出院诊断
+     */
+    @Excel(name = "出院诊断", width = 50, needMerge = true, orderNum = "7")
+    private String diagnoseName;
     /**
      * 出院日期
      */
-    @Excel(name = "出院日期", format = "yyyy-MM-dd", width = 30, orderNum = "6")
+    @Excel(name = "出院日期", format = "yyyy-MM-dd", width = 30, orderNum = "8")
     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     private Date leaveHospitalDate;
     /**
      * 入院日期
      */
-    @Excel(name = "入院日期", format = "yyyy-MM-dd", width = 30, orderNum = "7")
+    @Excel(name = "入院日期", format = "yyyy-MM-dd", width = 30, orderNum = "9")
     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     private Date behospitalDate;
     /**
      * 住院天数
      */
-    @Excel(name = "住院天数", width = 15, orderNum = "8")
+    @Excel(name = "住院天数", width = 15, orderNum = "10")
     private String behospitalDayNum;
     /**
      * 住院费用
      */
-    @Excel(name = "住院费用", width = 15, orderNum = "9")
+    @Excel(name = "住院费用", width = 15, orderNum = "11")
     private String totleFee;
+
+    private String age;
+
 }

+ 8 - 1
src/main/java/com/diagbot/dto/ReBeHosMergeDTO.java

@@ -15,7 +15,8 @@ import java.util.Date;
 @Setter
 public class ReBeHosMergeDTO {
     private String fileCode;
-    private String diagnose;
+    private String diagnose = "";
+    private String diagnoseName = "";//病案首页诊断
     private String name;
     private String sex;
     private String doctorName;
@@ -29,6 +30,8 @@ public class ReBeHosMergeDTO {
     private Date behospitalDate;
     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     private Date leaveHospitalDate;
+    private String lastDiagnose = "";
+    private String lastDiagnoseName = "";
     private String lastBehDeptId;
     private String lastBehDeptName;
     private String lastDoctorName;
@@ -42,6 +45,10 @@ public class ReBeHosMergeDTO {
     private Integer diffDays;
     private String totleFee;
     private String behospitalDayNum;
+    private String againBehospitalPlan;//31天再入院计划(是/否)
+    private String age;//年龄
+    private String lastAge;//年龄
     private String lastTotleFee;
     private String lastBehospitalDayNum;
+    private String lastAgainBehospitalPlan;//31天再入院计划(是/否)
 }

+ 0 - 20
src/main/java/com/diagbot/entity/MedIndexResult.java

@@ -98,11 +98,6 @@ public class MedIndexResult implements Serializable {
      */
     private Double bloodResult;
 
-    /**
-     * 医师查房记录完整率--分母
-     */
-    private Double wardRoundResult;
-
     /**
      * 患者抢救记录及时完成率--分母
      */
@@ -118,21 +113,6 @@ public class MedIndexResult implements Serializable {
      */
     private Double fileCompleteResult;
 
-    /**
-     * 不合理复制病历发生率--分母
-     */
-    private Double noCopyResult;
-
-    /**
-     * 知情同意书规范签署率--分母
-     */
-    private Double recordSignResult;
-
-    /**
-     * 甲级病历率--分母
-     */
-    private Double firRecordResult;
-
     private String startDate;
 
     private String endDate;

+ 11 - 0
src/main/java/com/diagbot/enums/QualityContent.java

@@ -155,6 +155,17 @@ public class QualityContent {
      */
     public static List<String> FOURSTR = Arrays.asList(
             "住院病案管理人员月均负担出院患者病历数", "病案编码人员月均负担出院患者病历数", "门诊病案管理人员月均负担门诊患者病历数");
+
+    // 放疗药物目录
+    public static List<String> radiotherapyDrugList = Arrays.asList(
+            "艾迪注射液", "康艾注射液", "康莱特注射液", "鸦胆子油乳注射液", "榄香烯乳注射液", "香菇多糖", "胎盘多肽注射液", "甘露聚糖肽注射液",
+            "脾多肽注射液", "E巨和粒", "欣粒生", "特尔津", "日达仙注射剂", "益比奥", "特比澳", "胸腺五肽", "古拉定","天晴甘美", "易善复", "己糖神经节苷脂钠",
+            "核糖核酸II", "参芪扶正注射液", "甘露醇注射液", "兰索拉唑", "奥西康", "卡络磺钠注射液", "维生素K1注射液", "氨甲苯酸注射液", "酚磺乙胺注射液",
+            "盐酸甲氧氯普胺注", "甲磺酸托烷司琼注射液", "伊班膦酸钠注射液", "唑来膦酸", "盐酸氨溴索注射液","氨茶碱注射液", "孟鲁司特钠片", "阿托伐他汀钙片",
+            "阿卡波糖片", "盐酸二甲双胍片", "瑞格列奈片", "格列齐特片","拉米夫定片","耐信","益血生胶囊","地榆升白片", "鲨肝醇片", "复方皂矾丸", "加巴喷丁胶囊",
+            "塞来昔布胶囊", "氨酚曲马多片", "盐酸羟考酮缓释片","硫酸吗啡缓释片", "盐酸吗啡片","复方甲氧那明胶囊","醋酸甲地孕酮分散","枸橼酸托瑞米芬片","标准桃金娘油肠溶",
+            "甲氧氯普胺片","多潘立酮片"
+    );
 }
 
 

+ 57 - 41
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -1,6 +1,7 @@
 package com.diagbot.facade;
 
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.TypeReference;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -13,31 +14,9 @@ import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.BehospitalInfoServiceImpl;
-import com.diagbot.util.BeanUtil;
-import com.diagbot.util.DateUtil;
-import com.diagbot.util.EncrypDES;
-import com.diagbot.util.EntityUtil;
-import com.diagbot.util.ExcelUtils;
-import com.diagbot.util.ListUtil;
-import com.diagbot.util.MapUtil;
-import com.diagbot.util.StringUtil;
-import com.diagbot.util.SysUserUtils;
-import com.diagbot.vo.AlgorithmVO;
-import com.diagbot.vo.AnalyzeCdsVO;
-import com.diagbot.vo.AnalyzeCodeVO;
-import com.diagbot.vo.AnalyzeRunVO;
-import com.diagbot.vo.AnalyzeVO;
-import com.diagbot.vo.BasDeptInfoVO;
-import com.diagbot.vo.BehospitalPageVO;
-import com.diagbot.vo.ExportQcresultVO;
-import com.diagbot.vo.FilterVO;
-import com.diagbot.vo.GetDetailVO;
-import com.diagbot.vo.MedrecVo;
-import com.diagbot.vo.QcResultAlgQueryVO;
-import com.diagbot.vo.QcResultAlgVO;
-import com.diagbot.vo.QueryVo;
-import com.diagbot.vo.RecordContentVO;
-import com.diagbot.vo.TaskVO;
+import com.diagbot.service.impl.StrInformedConsentServiceImpl;
+import com.diagbot.util.*;
+import com.diagbot.vo.*;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import org.apache.commons.lang3.StringUtils;
@@ -50,15 +29,8 @@ import javax.servlet.http.HttpServletResponse;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.time.LocalDateTime;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
+import java.time.format.DateTimeFormatter;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -171,6 +143,9 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
     SysHospitalSetFacade sysHospitalSetFacade;
     @Autowired
     QcCasesRelevanceEntryFacade qcCasesRelevanceEntryFacade;
+    @Autowired
+    StrInformedConsentServiceImpl strInformedConsentServiceImpl;
+
     @Autowired
     SysUserRoleFacade sysUserRoleFacade;
 
@@ -248,6 +223,13 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                 .eq("behospital_code", getDetailVO.getBehospitalCode()), false
         );
 
+        // 获取患者年龄
+        HomePage homePage = homePageFacade.getOne(new QueryWrapper<HomePage>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", getDetailVO.getHospitalId())
+                .eq("behospital_code", getDetailVO.getBehospitalCode()), false
+        );
+
         List<String> paramList = getDetailVO.getParamStr();// 参数列表
 
         if (ListUtil.isEmpty(paramList) || paramList.contains("beHospital")) {
@@ -256,6 +238,9 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                 throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该病历已删除!");
             }
             BeanUtil.copyProperties(behospitalInfo, behosDTO);
+            if(null != homePage && StringUtils.isNotEmpty(homePage.getAge()) && StringUtils.isNotEmpty(homePage.getAgeUnit())){
+                behosDTO.setAge(homePage.getAge()+homePage.getAgeUnit());
+            }
             res.put("beHospital", behosDTO);
         }
 
@@ -392,7 +377,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         List<RecordContentDTO> recordContentDTOList = medicalRecordFacade.getRecordContentFac(recordContentVO);
         String recTitle = "";
         // 解密数据
-        if (false  && encryptFlag) {
+        if (encryptFlag) {
             try {
                 EncrypDES encrypDES = new EncrypDES();
                 for (RecordContentDTO recordContentDTO : recordContentDTOList) {
@@ -674,7 +659,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         );
 
         //知情同意书
-        List<MedicalRecord> recordList = medicalRecordFacade.list(new QueryWrapper<MedicalRecord>()
+    /*    List<MedicalRecord> recordList = medicalRecordFacade.list(new QueryWrapper<MedicalRecord>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("behospital_code", analyzeVO.getBehospitalCode())
                 .eq("hospital_id", hospitalId)
@@ -682,7 +667,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                 .orderByAsc("rec_date")
         );
         List<MedicalRecordDTO> medicalRecordDTOList = BeanUtil.listCopyTo(recordList, MedicalRecordDTO.class);
-
+*/
         List<HomeDiagnoseInfo> homePageList = new ArrayList<>();
         List<HomeOperationInfo> homeOperationInfoList = new ArrayList<>();
         if (homePage != null) {
@@ -792,7 +777,6 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         //使用sql进行关联优化数据查询
         List<MedPacsResultDTO> medPacsResultList = medPacsResultFacade.getMedPacsResultList(behospitalInfoList.get(0));
 
-
         /**
          * 结构化/文书数据兼容处理
          */
@@ -993,8 +977,8 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
 
         addData("日常病程录", recMap, medrecVoList);
 
-        DataWithKey("知情同意书", medicalRecordDTOList, medrecVoList);
-        //addDataWithInnerKey("知情同意书", recMap, medrecVoList);
+        //DataWithKey("知情同意书", medicalRecordDTOList, medrecVoList);
+        addDataWithInnerKey("知情同意书", recMap, medrecVoList);
         addDataWithInnerKey("谈话告知书", recMap, medrecVoList);
 
         //==============文书====================
@@ -1049,7 +1033,6 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
      * @return
      */
     public AnalyzeDTO analyze(AnalyzeVO analyzeVO) {
-
         Long hospitalId = analyzeVO.getHospitalId();
         if (!analyzeVO.getIsTask()) {
             hospitalId = Long.parseLong(SysUserUtils.getCurrentHospitalID());
@@ -2291,6 +2274,39 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
 
         //保存
         Map<String, Object> pageMap = outputInfo.getPageData();
+        //保存解析过后的手术知情同意书
+            List<String> recIds = new ArrayList<>();
+            if(pageMap.containsKey("手术知情同意书")){
+                Object informObject = pageMap.get("手术知情同意书");
+                List<Map<String,Object>> informList= (List<Map<String,Object>>) informObject;
+                List<StrInformedConsent> strInformedConsents = new ArrayList<>();
+                if(ListUtil.isNotEmpty(informList)) {
+                    informList.forEach(obj ->
+                            {
+                                Map<String, String> strMap = new HashMap<>();
+                                strMap.put("使用植入性材料", String.valueOf(obj.get("使用植入性材料")));
+                                StrInformedConsent strInformedConsent = new StrInformedConsent();
+                                strInformedConsent.setHospitalId(analyzeVO.getHospitalId());
+                                strInformedConsent.setBehospitalCode(analyzeVO.getBehospitalCode());
+                                strInformedConsent.setRecId(String.valueOf(obj.get("记录编号")));
+                                strInformedConsent.setRecTitle(String.valueOf(obj.get("病历标题")));
+                                strInformedConsent.setRecType("知情同意书");
+                                strInformedConsent.setContent(JSONObject.toJSONString(strMap));
+                                strInformedConsent.setGmtCreate(new Date());
+                                strInformedConsents.add(strInformedConsent);
+                                recIds.add(String.valueOf(obj.get("记录编号")));
+                            }
+                    );
+                    //删除手术知情同意书历史ric_id
+                    strInformedConsentServiceImpl.remove( new QueryWrapper<StrInformedConsent>()
+                            .eq("hospital_id",analyzeVO.getHospitalId())
+                            .eq("is_deleted",IsDeleteEnum.N.getKey())
+                            .eq("behospital_code",analyzeVO.getBehospitalCode())
+                            .in("rec_id",recIds));
+                    //新增
+                    strInformedConsentServiceImpl.saveBatch(strInformedConsents);
+                }
+            }
         // 手动拼接数据【知情同意书】【谈话告知书】
         List<MedicalRecord> recordList = medicalRecordFacade.list(new QueryWrapper<MedicalRecord>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())

+ 1 - 2
src/main/java/com/diagbot/facade/ConsoleByDeptExportFacade.java

@@ -332,9 +332,8 @@ public class ConsoleByDeptExportFacade {
      * @return
      */
     public void reHos31DaysPageExportByDept(HttpServletResponse response, ReBeHosPageVO reBeHosPageVO) {
-        reBeHosPageVO.setCurrent(1L);
-        reBeHosPageVO.setSize(Long.MAX_VALUE);
         reBeHosPageVO.setSearchCount(false);
+        reBeHosPageVO.setFlag(1);
         IPage<ReBeHosByDeptDTO> page = consoleByDeptFacade.reHos31DaysPageByDept(reBeHosPageVO);
         List<ReBeHosByDeptDTO> records = page.getRecords();
         String fileName = "31天再入院统计详情.xls";

+ 51 - 3
src/main/java/com/diagbot/facade/ConsoleByDeptFacade.java

@@ -900,13 +900,25 @@ public class ConsoleByDeptFacade {
      */
     public IPage<ReBeHosByDeptDTO> reHos31DaysPageByDept(ReBeHosPageVO reBeHosPageVO) {
         filterFacade.reBeHosPageVOSet(reBeHosPageVO);
+        long size = reBeHosPageVO.getSize();
+        long current = reBeHosPageVO.getCurrent();
+        reBeHosPageVO.setCurrent(1L);
+        reBeHosPageVO.setSize(Long.MAX_VALUE);
         IPage<ReBeHosMergeDTO> page = behospitalInfoFacade.reHos31DaysPageByDept(reBeHosPageVO);
         List<ReBeHosMergeDTO> records = page.getRecords();
         IPage<ReBeHosByDeptDTO> retPage = new Page<>();
-        BeanUtil.copyProperties(page, retPage);
-        List<ReBeHosByDeptDTO> retRecords = Lists.newLinkedList();
         if (ListUtil.isNotEmpty(records)) {
-            for (ReBeHosMergeDTO record : records) {
+            List<ReBeHosByDeptDTO> retRecords = Lists.newLinkedList();
+            BeanUtil.copyProperties(page, retPage);
+            Iterator<ReBeHosMergeDTO> iterator = records.iterator();
+            while(iterator.hasNext()){
+                ReBeHosMergeDTO record = iterator.next();
+                strTrans(record);
+                Boolean flag = ConsoleFacade.isContainDiagnose(record);
+                if(!flag){
+                    iterator.remove();
+                    continue;
+                }
                 ReBeHosByDeptDTO retRecord = new ReBeHosByDeptDTO();
                 BeanUtil.copyProperties(record, retRecord);
                 List<ReBeHosDetailByDeptDTO> details = Lists.newLinkedList();
@@ -918,6 +930,8 @@ public class ConsoleByDeptFacade {
                 lastDetailRecord.setBehDeptId(record.getLastBehDeptId());
                 lastDetailRecord.setBehDeptName(record.getLastBehDeptName());
                 lastDetailRecord.setDoctorName(record.getLastDoctorName());
+                lastDetailRecord.setDiagnose(record.getLastDiagnose());
+                lastDetailRecord.setDiagnoseName(record.getLastDiagnoseName());
                 lastDetailRecord.setBehospitalCode(record.getLastBehospitalCode());
                 lastDetailRecord.setBehospitalDate(record.getLastBehospitalDate());
                 lastDetailRecord.setLeaveHospitalDate(record.getLastLeaveHospitalDate());
@@ -929,10 +943,44 @@ public class ConsoleByDeptFacade {
                 retRecord.setDetails(details);
                 retRecords.add(retRecord);
             }
+
+        if(reBeHosPageVO.getFlag()==1){
+            size = retRecords.size();
+        }
+        retPage.setSize(size);
+        retPage.setTotal(retRecords.size());
+        retPage.setCurrent(current);
+        if(0 == current){
+            current = 1;
+        }
+        int startIndex = ((int)current -1)*10;
+        int endIndex = startIndex + (int) size;
+
+        if(retRecords.size()>1){
+            if( retRecords.size()-startIndex<(int)size){
+                retRecords = retRecords.subList(startIndex,retRecords.size());
+            }else{
+                retRecords = retRecords.subList(startIndex,endIndex );
+            }
         }
         retPage.setRecords(retRecords);
+        }
         return retPage;
     }
+
+    public static void strTrans(ReBeHosMergeDTO record) {
+        String replace = record.getLastAgainBehospitalPlan();
+        if(StringUtils.isEmpty(replace)){
+            replace = "否";
+            record.setLastAgainBehospitalPlan(replace);
+            return;
+        }
+        replace = replace.replace("无", "否")
+                .replace("-", "无").replace("是一周后", "是")
+                .replace("1", "否").replace("2", "是")
+                .replace("有", "是");
+        record.setLastAgainBehospitalPlan(replace);
+    }
     /**
      * 未整改病历质控评分页-科室(内页)
      *

+ 1 - 2
src/main/java/com/diagbot/facade/ConsoleExportFacade.java

@@ -478,9 +478,8 @@ public class ConsoleExportFacade {
      * @return
      */
     public void reHos31DaysPageExport(HttpServletResponse response, ReBeHosPageVO reBeHosPageVO) {
-        reBeHosPageVO.setCurrent(1L);
-        reBeHosPageVO.setSize(Long.MAX_VALUE);
         reBeHosPageVO.setSearchCount(false);
+        reBeHosPageVO.setFlag(1);
         IPage<ReBeHosDTO> page = consoleFacade.reHos31DaysPage(reBeHosPageVO);
         List<ReBeHosDTO> records = page.getRecords();
         String fileName = "31天再入院统计详情.xls";

+ 376 - 33
src/main/java/com/diagbot/facade/ConsoleFacade.java

@@ -1,5 +1,6 @@
 package com.diagbot.facade;
 
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -420,11 +421,12 @@ public class ConsoleFacade {
         //MR
         Long mr = triggeringRulesMap.get("MR");
         //细菌培养
-        Long bacterialCulture = 0L;
+        Long bacterialCulture = triggeringRulesMap.get("bacterialCulture");
         //抗菌药物
-        Long antibiosis = 0L;
+        Long antibiosis = triggeringRulesMap.get("antibiosis");
         //恶性肿瘤化学治疗
-        Long chemotherapyMalignantTumors = 0L;
+        Long chemotherapyMalignantTumors = triggeringRulesMap.get("chemotherapyMalignantTumors");
+
         Map<String, Double> medicalRecordIndicator = medIndexResultFacade.medicalRecordIndicator(filterVO);
         Double startCount = medicalRecordIndicator.get("startCount");
         Double operationFeeNum = medicalRecordIndicator.get("operationFeeNum");
@@ -542,16 +544,23 @@ public class ConsoleFacade {
                 hashMapArrayList.add(stringStringHashMap);
             }
         }
+        //指标十四 恶性肿瘤放射治疗
+        if (indexName.equals(QualityContent.EXZL_FSZL_FHL)||indexName.equals(QualityContent.QB)) {
+            hashMapArrayList = tumorRadiationMethod(medicalRecordIndicator,hashMapArrayList,triggeringRulesMap);
+        }
 
         //指标十五 手术记录
         if (indexName.equals(QualityContent.SS_XGJL_WCL)||indexName.equals(QualityContent.QB)) {
             hashMapArrayList = operationMethod(medicalRecordIndicator,hashMapArrayList,triggeringRulesMap);
         }
 
+        //指标十六 植入物相关记录符合率
+        if (indexName.equals(QualityContent.ZRW_XGJL_WCL)||indexName.equals(QualityContent.QB)) {
+            hashMapArrayList = implantsMethod(medicalRecordIndicator,hashMapArrayList,triggeringRulesMap);
+        }
 
         //指标十七  临床用血相关记录符合率
         if (indexName.equals(QualityContent.LCYX_XGJL_WCL)||indexName.equals(QualityContent.QB)) {
-            filterVO.setFlagStr("1");
             hashMapArrayList = bloodMethod(hashMapArrayList,medicalRecordIndicator,triggeringRulesMap);
         }
 
@@ -575,8 +584,17 @@ public class ConsoleFacade {
             hashMapArrayList = fileCompleteMethod(medicalRecordIndicator,hashMapArrayList, baseIndex);
         }
 
+        //指标二十二 不合理复制病历发生率
+        if (indexName.equals(QualityContent.BHL_FZ_FSL)||indexName.equals(QualityContent.QB)) {
+            hashMapArrayList = unreasonedCopyMethod(hashMapArrayList, baseIndex, triggeringRulesMap);
+        }
+
+        //指标二十三 知情同意书规范签署率
+        if (indexName.equals(QualityContent.ZQTYS_GF_QSL)||indexName.equals(QualityContent.QB)) {
+            hashMapArrayList = contentSignMethod(hashMapArrayList, baseIndex, triggeringRulesMap);
+        }
 
-        //指标二十七 甲级率
+        //指标二十 甲级率
         if (indexName.equals(QualityContent.JJBLL)||indexName.equals(QualityContent.QB)) {
             hashMapArrayList = firMethod(hashMapArrayList,baseIndex);
         }
@@ -784,19 +802,37 @@ public class ConsoleFacade {
             Set<String> rescueCode = new CopyOnWriteArraySet<>();
             Set<String> bloodCode = new CopyOnWriteArraySet<>();
         //指标二十七
+        //指标14--恶性肿瘤放射治疗记录符合率
+        Set<String> tumorRadiationSet = tumorRadiationMethods(adviceNum, medIndexResult);
+
+        //指标15 手术记录
+        medIndexResult.setOperationCompleteResult(Double.parseDouble(operationFeeNum+""));
+
+        //指标16--植入物相关记录符合率
+        Set<String> implantsCode = implantsMethods(filterVO, medIndexResult);
+
+        //指标17  临床用血相关记录符合率
+        bloodMethods(doctorAdviceMedManageParams, filterVO,medIndexResult,bloodCode);
 
         //指标18 医师查房记录 查询直接返回 -code需要加载
 
         //指标19 抢救记录
         rescueMethods(doctorAdviceMedManageParams,medIndexResult,rescueCode);
+
         //指标20 出院患者病历2日归档
         getfileSecAmounts(filterVO,medIndexResult);
+
         //指标21 出院患者病历归档完整率
         fileCompleteMethods(filterVO,medIndexResult);
-        //指标15 手术记录
-        medIndexResult.setOperationCompleteResult(Double.parseDouble(operationFeeNum+""));
-        //指标17  临床用血相关记录符合率
-        bloodMethods(doctorAdviceMedManageParams, filterVO,medIndexResult,bloodCode);
+
+        //指标22 不合理复制病历发生率 查询直接返回
+
+        //指标23  知情同意书规范签署率 //分子通过规则
+       // contentSignMethods(contentFile,medIndexResult);
+
+        //指标24 甲级率 查询直接返回
+
+
         medIndexResult.setHospitalId(filterVO.getHospitalId());
         medIndexResult.setStartDate(filterVO.getStartDate());
         medIndexResult.setEndDate(filterVO.getEndDate());
@@ -875,34 +911,62 @@ public class ConsoleFacade {
                     medIndexRelevanceFacade.save(medIndexRelevance);
                 }
             }
-            if(operationCode.size()>0&&operationCode!=null) {
+        if(tumorRadiationSet.size()>0 && tumorRadiationSet != null) {
+            medIndexRelevance.setRelevanceType(14);
+            for (String Code : tumorRadiationSet) {
+                medIndexRelevance.setBehospitalCode(Code);
+                medIndexRelevanceFacade.save(medIndexRelevance);
+            }
+        }
+            if(operationCode.size() > 0 && operationCode != null) {
                 medIndexRelevance.setRelevanceType(15);
                 for (String Code : operationCode) {
                     medIndexRelevance.setBehospitalCode(Code);
                     medIndexRelevanceFacade.save(medIndexRelevance);
                 }
             }
-            if(bloodCode.size()>0&&bloodCode!=null) {
+        if(implantsCode.size() > 0 && implantsCode != null) {
+            medIndexRelevance.setRelevanceType(16);
+            for (String Code : implantsCode) {
+                medIndexRelevance.setBehospitalCode(Code);
+                medIndexRelevanceFacade.save(medIndexRelevance);
+            }
+        }
+            if(bloodCode.size() > 0 && bloodCode != null) {
                 medIndexRelevance.setRelevanceType(17);
                 for (String Code : bloodCode) {
                     medIndexRelevance.setBehospitalCode(Code);
                     medIndexRelevanceFacade.save(medIndexRelevance);
                 }
             }
-            if(outHospitalCode.size()>0&&outHospitalCode!=null) {
+            if(outHospitalCode.size() > 0 && outHospitalCode != null) {
                 medIndexRelevance.setRelevanceType(18);
                 for (String Code : outHospitalCode) {
                     medIndexRelevance.setBehospitalCode(Code);
                     medIndexRelevanceFacade.save(medIndexRelevance);
                 }
             }
-            if(rescueCode.size()>0&&rescueCode!=null) {
+            if(rescueCode.size() > 0 && rescueCode != null) {
                 medIndexRelevance.setRelevanceType(19);
                 for (String Code : rescueCode) {
                     medIndexRelevance.setBehospitalCode(Code);
                     medIndexRelevanceFacade.save(medIndexRelevance);
                 }
             }
+        if(outHospitalCode.size() > 0 && outHospitalCode != null) {
+            medIndexRelevance.setRelevanceType(22);
+            for (String Code : outHospitalCode) {
+                medIndexRelevance.setBehospitalCode(Code);
+                medIndexRelevanceFacade.save(medIndexRelevance);
+            }
+        }
+        if(outHospitalCode.size() > 0 && outHospitalCode != null) {
+            medIndexRelevance.setRelevanceType(23);
+            for (String Code : outHospitalCode) {
+                medIndexRelevance.setBehospitalCode(Code);
+                medIndexRelevanceFacade.save(medIndexRelevance);
+            }
+        }
         }
     /**
      * 两数据相除得到百分比
@@ -995,6 +1059,7 @@ public class ConsoleFacade {
         Set<String> bacterialCultureCode = new CopyOnWriteArraySet<>();
         Set<String> antibiosisBehospitalCode = new CopyOnWriteArraySet<>();
         Set<String> chemotherapyMalignantTumorsBehospitalCode = new CopyOnWriteArraySet<>();
+        Set<String> tumorRadiationBehospitalCode = new CopyOnWriteArraySet<>();
         //无首页code
         List<String> behospitalCodeList = adviceVerify(filterVO);
         //首页为肿瘤code
@@ -1115,6 +1180,24 @@ public class ConsoleFacade {
                                     }
                                 }
                             }
+
+                            if (indexName.equals(QualityContent.EXZL_FSZL_FHL) || indexName.equals(QualityContent.QB)) {
+                                if (ListUtil.isNotEmpty(malignancyCodeList)) {
+                                    if (malignancyCodeList.contains(behospitalCode)) {
+                                        if (!tumorRadiationBehospitalCode.contains(behospitalCode)) {
+                                            if (doctorAdviceType.equals(QualityContent.STAT_ORDER) || doctorAdviceType.equals(QualityContent.STANDING_ORDER)) {
+                                                List<String> tumorRadiationDrugList = QualityContent.radiotherapyDrugList;
+                                                for (String tumorRadiationDrug : tumorRadiationDrugList) {
+                                                    if (daItemName.contains(tumorRadiationDrug)) {
+                                                        //医嘱含有放射治疗药物
+                                                        tumorRadiationBehospitalCode.add(behospitalCode);
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
                         }
                     }
                 }
@@ -1167,6 +1250,11 @@ public class ConsoleFacade {
             }else {
                 mapCode.put("chemotherapyMalignantTumors",null);
             }
+            if(tumorRadiationBehospitalCode!=null && tumorRadiationBehospitalCode.size()>0){
+                mapCode.put("tumorRadiationSecNum",tumorRadiationBehospitalCode);
+            }else {
+                mapCode.put("tumorRadiationSecNum",null);
+            }
             return mapCode;
         }
     }
@@ -2914,13 +3002,25 @@ public class ConsoleFacade {
      */
     public IPage<ReBeHosDTO> reHos31DaysPage(ReBeHosPageVO reBeHosPageVO) {
         filterFacade.reBeHosPageVOSet(reBeHosPageVO);
+        long size = reBeHosPageVO.getSize();
+        long current = reBeHosPageVO.getCurrent();
+        reBeHosPageVO.setCurrent(1L);
+        reBeHosPageVO.setSize(Long.MAX_VALUE);
         IPage<ReBeHosMergeDTO> page = behospitalInfoFacade.reHos31DaysPage(reBeHosPageVO);
         List<ReBeHosMergeDTO> records = page.getRecords();
         IPage<ReBeHosDTO> retPage = new Page<>();
-        BeanUtil.copyProperties(page, retPage);
-        List<ReBeHosDTO> retRecords = Lists.newLinkedList();
         if (ListUtil.isNotEmpty(records)) {
-            for (ReBeHosMergeDTO record : records) {
+            BeanUtil.copyProperties(page, retPage);
+            List<ReBeHosDTO> retRecords = Lists.newLinkedList();
+            Iterator<ReBeHosMergeDTO> iterator = records.iterator();
+            while(iterator.hasNext()){
+                ReBeHosMergeDTO record = iterator.next();
+                ConsoleByDeptFacade.strTrans(record);
+                Boolean flag = isContainDiagnose(record);
+                if(!flag){
+                    iterator.remove();
+                    continue;
+                }
                 ReBeHosDTO retRecord = new ReBeHosDTO();
                 BeanUtil.copyProperties(record, retRecord);
                 List<ReBeHosDetailDTO> details = Lists.newLinkedList();
@@ -2929,6 +3029,9 @@ public class ConsoleFacade {
                 details.add(detailRecord);
                 ReBeHosDetailDTO lastDetailRecord = new ReBeHosDetailDTO();
                 lastDetailRecord.setName(record.getName());
+                lastDetailRecord.setAge(record.getLastAge());
+                lastDetailRecord.setDiagnose(record.getLastDiagnose());
+                lastDetailRecord.setDiagnoseName(record.getLastDiagnoseName());
                 lastDetailRecord.setBehDeptId(record.getLastBehDeptId());
                 lastDetailRecord.setBehDeptName(record.getLastBehDeptName());
                 lastDetailRecord.setBehospitalCode(record.getLastBehospitalCode());
@@ -2942,11 +3045,84 @@ public class ConsoleFacade {
                 retRecord.setDetails(details);
                 retRecords.add(retRecord);
             }
+            //首页返回全部数据
+        if(reBeHosPageVO.getFlag()==31){
+            retPage.setRecords(retRecords);
+            return retPage;
+        }
+        //导出操作
+        if(reBeHosPageVO.getFlag()==1){
+            size = retRecords.size();
+        }
+        retPage.setSize(size);
+        retPage.setTotal(retRecords.size());
+        retPage.setCurrent(current);
+        //数据返回索引处理
+        if(0 == current){
+            current = 1;
+        }
+        int startIndex = ((int)current -1)*10;
+        int endIndex = startIndex + (int) size;
+
+        if(retRecords.size()>1){
+            if( retRecords.size()-startIndex<(int)size){
+                retRecords = retRecords.subList(startIndex,retRecords.size());
+            }else{
+                retRecords = retRecords.subList(startIndex,endIndex );
+            }
         }
         retPage.setRecords(retRecords);
+        }
         return retPage;
     }
 
+
+   static Boolean isContainDiagnose(ReBeHosMergeDTO record){
+       // String lastDiagnoseName = replace(record.getLastDiagnoseName());本身使用,分隔
+        String diagnose =replace(record.getDiagnose());//手动分隔
+        String lastDiagnose = replace(record.getLastDiagnose());
+        record.setDiagnose(diagnose);
+        record.setLastDiagnose(lastDiagnose);
+        Set lastDiagnoseNames = strTranListMethod(record.getLastDiagnoseName());
+        Set diagnoses = strTranListMethod(record.getDiagnose());
+        long count = diagnoses.stream().filter(obj ->null != lastDiagnoseNames && null != obj && lastDiagnoseNames.contains(obj)).count();
+        if(count<=0){
+            return false;
+        }
+        return true;
+    };
+
+    static String replace(String str){
+        if(StringUtils.isEmpty(str)){
+            return null;
+        }
+        str = str.trim().replace(";", ",").replace(";", ",")
+                        .replace("、", ",").replace(",", ",")
+                        .replace("|", ",").replace(" ", ",")
+                        .replace(":", ",") .replace(":", ",");
+        if(str.startsWith(",")){
+            str = str.substring(1);
+        }
+        if(str.endsWith(",")){
+            str = str.substring(0,str.length()-1);
+        }
+
+       return str;
+    }
+    static Set strTranListMethod(String str){
+        Set<String> names = new HashSet<>();
+        if(StringUtils.isNotEmpty(str)){
+        if(str.contains(",") && str.length()>1){
+            for (String diagnoseName : str.split(",")) {
+                names.add(diagnoseName);
+            }
+        }else{
+            names.add(str);
+             }
+        }
+        return names;
+    };
+
     /**
      * 入院人数统计(首页)
      *
@@ -3010,11 +3186,63 @@ public class ConsoleFacade {
         return behospitalInfoFacade.hmImproveMRPage(qcResultShortPageVO);
     }
 
+
+    //指标十四 恶性肿瘤放射治疗
+    private List<Map<String, String>> tumorRadiationMethod(Map<String, Double> medManageParams,List<Map<String, String>> retList, Map<String, Long> triggeringRulesMap){
+        LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
+        //接受肿瘤放射治疗的质控病历总数
+        Double count = medManageParams.get("tumorRadiationResult");
+        String num = null;
+        if( null == count){
+            count = 0d;
+        }
+        if(StringUtils.isNotEmpty(String.valueOf(count)) &&  count != 0d){
+            double tumorRadiationDo = currencyCal(count, triggeringRulesMap.get("tumorRadiationNum"));//triggeringRules(filterVO)
+            num = String.valueOf(tumorRadiationDo);
+            if(tumorRadiationDo<0d){
+                num = null;
+            }
+        };
+
+        firMap.put("name","恶性肿瘤放射治疗记录符合率");
+        firMap.put("notCopiedStr",StringUtils.isEmpty(num) ? "0.00%":(num+"%"));
+        firMap.put("num",String.valueOf(count));
+        retList.add(firMap);
+        return retList;
+    }
+
+    //指标十六 植入物相关记录符合率
+    private List<Map<String, String>> implantsMethod(Map<String, Double> medManageParams,List<Map<String, String>> retList, Map<String, Long> triggeringRulesMap){
+        LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
+        //使用植入物的质控病历总数
+        Double count = medManageParams.get("implantsResult");
+        if( null == count){
+            count = 0d;
+        }
+        String num = null;
+        if(StringUtils.isNotEmpty(String.valueOf(count)) &&  count != 0d){
+            double implantsDo = currencyCal(count, triggeringRulesMap.get("implantsNum"));//triggeringRules(filterVO)
+            num = String.valueOf(implantsDo);
+            if(implantsDo<0d){
+                num = null;
+            }
+        };
+
+        firMap.put("name","植入物相关记录符合率");
+        firMap.put("notCopiedStr",StringUtils.isEmpty(num) ? "0.00%":(num+"%"));
+        firMap.put("num",String.valueOf(count));
+        retList.add(firMap);
+        return retList;
+    }
+
     //指标十八 抢救记录
     private  List<Map<String, String>> rescueMethod( Map<String, Double> medManageParams, List<Map<String, String>> retList,Map<String, Long> triggeringRulesMap){
         LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
         //接受抢救的质控病历总数
-        double count = medManageParams.get("rescue_result");
+        Double count = medManageParams.get("rescueResult");
+        if( null == count){
+            count = 0d;
+        }
         String num = null;
         if(StringUtils.isNotEmpty(String.valueOf(count)) &&  count != 0d){
             double rescueDo = currencyCal(count, triggeringRulesMap.get("rescueNum"));
@@ -3022,11 +3250,11 @@ public class ConsoleFacade {
             if(rescueDo<0d){
                 num = null;
             }
-            firMap.put("num",String.valueOf(count));
         };
 
         firMap.put("name","患者抢救记录及时完成率");
         firMap.put("notCopiedStr",StringUtils.isEmpty(num) ? "0.00%":(num+"%"));
+        firMap.put("num",String.valueOf(count));
         retList.add(firMap);
         return retList;
     };
@@ -3035,16 +3263,70 @@ public class ConsoleFacade {
     private List<Map<String, String>> WardRoundMethod( List<Map<String, String>> retList, Map<String, Object> baseIndex, Map<String, Long> triggeringRulesMap){
         LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
         String num = null;
+        Object forWorkNum = baseIndex.get("forWorkNum");
         if( triggeringRulesMap.containsKey("WardRoundNum") && baseIndex.containsKey("forWorkNum") && !baseIndex.get("forWorkNum").toString().equals("0")){
             double wardRoundDo = currencyCal(baseIndex.get("forWorkNum"), triggeringRulesMap.get("WardRoundNum"));
             num = String.valueOf(wardRoundDo);
             if(wardRoundDo<0d){
                 num = null;
             }
-            firMap.put("num",baseIndex.get("forWorkNum").toString());
         };
         firMap.put("name","医师查房记录完成率");
         firMap.put("notCopiedStr",StringUtils.isEmpty(num) ? "0.00%":(num+"%"));
+        if(null == forWorkNum){
+            firMap.put("num","0");
+        }else{
+            firMap.put("num",baseIndex.get("forWorkNum").toString());
+        }
+        retList.add(firMap);
+        return retList;
+    }
+
+
+    //指标二十二 不合理复制病历发生率
+    private List<Map<String, String>> unreasonedCopyMethod( List<Map<String, String>> retList, Map<String, Object> baseIndex, Map<String, Long> triggeringRulesMap){
+       LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
+       String num = null;
+        Object forWorkNum = baseIndex.get("forWorkNum");
+        if( triggeringRulesMap.containsKey("unreasonedCopyNum") && baseIndex.containsKey("forWorkNum") && !baseIndex.get("forWorkNum").toString().equals("0")){
+           double wardRoundDo = currencyCal(baseIndex.get("forWorkNum"), triggeringRulesMap.get("unreasonedCopyNum"));
+           num = String.valueOf(wardRoundDo);
+           if(wardRoundDo<0d){
+               num = null;
+           }
+       };
+       firMap.put("name","不合理复制病历发生率");
+       firMap.put("notCopiedStr",StringUtils.isEmpty(num) ? "0.00%":(num+"%"));
+        if(null == forWorkNum){
+            firMap.put("num","0");
+        }else{
+            firMap.put("num",baseIndex.get("forWorkNum").toString());
+        }
+       retList.add(firMap);
+        return retList;
+        };
+
+
+    //指标二十三 知情同意书规范签署率
+    private List<Map<String, String>> contentSignMethod(List<Map<String, String>> retList, Map<String, Object> baseIndex, Map<String, Long> triggeringRulesMap){
+        LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
+        Object forWorkNum = baseIndex.get("forWorkNum");
+        String num = null;
+        if( triggeringRulesMap.containsKey("InformedNum") && baseIndex.containsKey("forWorkNum") && !baseIndex.get("forWorkNum").toString().equals("0")){
+            double InformedDo = currencyCal(baseIndex.get("forWorkNum"), triggeringRulesMap.get("InformedNum"));
+            num = String.valueOf(InformedDo);
+            if(InformedDo<0d){
+                num = null;
+            }
+        }
+        firMap.put("name","知情同意书规范签署率");
+        firMap.put("notCopiedStr",StringUtils.isEmpty(num) ? "0.00%":(num+"%"));
+        if(null == forWorkNum){
+            firMap.put("num","0");
+        }else{
+            firMap.put("num",baseIndex.get("forWorkNum").toString());
+        }
+
         retList.add(firMap);
         return retList;
     }
@@ -3053,6 +3335,9 @@ public class ConsoleFacade {
     private  List<Map<String, String>> operationMethod(Map<String, Double> medManageParams, List<Map<String, String>>retList, Map<String, Long> triggeringRulesMap){
         LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
         String operationFeeNum = medManageParams.get("operationFeeNum")+"";
+        if(StringUtils.isEmpty(operationFeeNum)){
+            operationFeeNum = "0";
+        }
         String num = null;
         if( triggeringRulesMap.containsKey("operationRecordNum") && StringUtils.isNotEmpty(operationFeeNum) && ! operationFeeNum.equals("0")){
             double operationRecordDo = currencyCal(operationFeeNum, triggeringRulesMap.get("operationRecordNum"));
@@ -3060,13 +3345,13 @@ public class ConsoleFacade {
             if(operationRecordDo<0d){
                 num = null;
             }
-            firMap.put("num",operationFeeNum);
         };
         firMap.put("name","手术相关记录完成率");
         if("0.0".equals(num)){
             num = "0.00";
         }
         firMap.put("notCopiedStr",StringUtils.isEmpty(num) ? "0.00%":(num+"%"));
+        firMap.put("num",operationFeeNum);
 
         retList.add(firMap);
         return retList;
@@ -3075,7 +3360,10 @@ public class ConsoleFacade {
     //指标十六  临床用血相关记录符合率
     private  List<Map<String, String>> bloodMethod( List<Map<String, String>>retList,Map<String, Double> bloodRes,Map<String, Long> triggeringRulesMap){
         LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
-        double count = bloodRes.get("blood_result");
+        Double count = bloodRes.get("bloodResult");
+        if( null == count){
+            count = 0d;
+        }
         String num = null;
         if(StringUtils.isNotEmpty(String.valueOf(count)) &&  count != 0d){
             //指标十七
@@ -3084,11 +3372,11 @@ public class ConsoleFacade {
             if(bloodDo<0d){
                 num = null;
             }
-            firMap.put("num",String.valueOf(count));
         }
 
         firMap.put("name","临床用血相关记录符合率");
         firMap.put("notCopiedStr",StringUtils.isEmpty(num) ? "0.00%":(num+"%"));
+        firMap.put("num",String.valueOf(count));
         retList.add(firMap);
         return retList;
     }
@@ -3108,36 +3396,51 @@ public class ConsoleFacade {
     private List<Map<String, String>> getfileSecAmount(Map<String, Double> medManageParams, List<Map<String, String>>retList, Map<String, Object> baseIndex){
         LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
         DecimalFormat df = new DecimalFormat("#0.00");
-        double count = medManageParams.get("sec_file_result");
+        Double count = medManageParams.get("secFileResult");
+        Object forWorkNum = baseIndex.get("forWorkNum");
+        if( null == count){
+            count = 0d;
+        }
         String num = null;
-        if(StringUtils.isNotEmpty( baseIndex.get("sevenWorkNum").toString()) && ! baseIndex.get("sevenWorkNum").toString().equals("0") ){
-            double retNum =count* 100/Double.parseDouble(baseIndex.get("sevenWorkNum").toString());
+        if(StringUtils.isNotEmpty( baseIndex.get("forWorkNum").toString()) && ! baseIndex.get("forWorkNum").toString().equals("0") ){
+            double retNum =count* 100/Double.parseDouble(baseIndex.get("forWorkNum").toString());
             double firGradeStr = Double.parseDouble(df.format(retNum));
             num = String.valueOf(firGradeStr);
-            firMap.put("num",baseIndex.get("sevenWorkNum").toString());
+
         }
 
         firMap.put("name","出院患者病历2日归档率");
         firMap.put("notCopiedStr",StringUtils.isEmpty(num) ? "0.00%":(num+"%"));
+        if(null == forWorkNum){
+            firMap.put("num","0");
+        }else{
+            firMap.put("num",baseIndex.get("forWorkNum").toString());
+        }
         retList.add(firMap);
         return retList;
     };
 
     //指标21 --出院患者病历归档完整率
     private  List<Map<String, String>> fileCompleteMethod(Map<String, Double> medManageParams, List<Map<String, String>>retList, Map<String, Object> baseIndex){
-        DecimalFormat df = new DecimalFormat("#0.00");
         LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
-        double count = medManageParams.get("fileCompleteResult");
+        Double count = medManageParams.get("fileCompleteResult");
+        Object forWorkNum = baseIndex.get("forWorkNum");
+        if( null == count){
+            count = 0d;
+        }
         String num = null;
         if(StringUtils.isNotEmpty( baseIndex.get("forWorkNum").toString()) && ! baseIndex.get("forWorkNum").toString().equals("0") ){
-            double retNum =count* 100/Double.parseDouble(baseIndex.get("forWorkNum").toString());
-            double firGradeStr = Double.parseDouble(df.format(retNum));
-            num = String.valueOf(firGradeStr);
-            firMap.put("num",baseIndex.get("forWorkNum").toString());
+            double retNum = currencyCal( baseIndex.get("forWorkNum").toString(),count);
+            num = String.valueOf(retNum);
         }
 
         firMap.put("name","出院患者病历归档完整率");
         firMap.put("notCopiedStr",StringUtils.isEmpty(num) ? "0.00%":(num+"%"));
+        if(null == forWorkNum){
+            firMap.put("num","0");
+        }else{
+            firMap.put("num",baseIndex.get("forWorkNum").toString());
+        }
         retList.add(firMap);
         return retList;
     }
@@ -3235,10 +3538,10 @@ public class ConsoleFacade {
                 double retNum = Double.parseDouble(baseIndex.get("sixWorkNum").toString()) * 100 / firRecord;
                 double firGradeStr = Double.parseDouble(df.format(retNum));
                 num4 = String.valueOf(firGradeStr);
-                fouMap.put("num",String.valueOf(firRecord));
             }
             fouMap.put("name","甲级病历率");
             fouMap.put("notCopiedStr",StringUtils.isEmpty(num4) ? "0.00%":(num4+"%"));
+        fouMap.put("num",String.valueOf(firRecord));
             retList.add(fouMap);
         return retList;
     };
@@ -3247,6 +3550,17 @@ public class ConsoleFacade {
     /**
      * ==============================后台维护===============================
      */
+    private  Set<String> tumorRadiationMethods( Map<String, Set<String>> adviceNum,MedIndexResult medIndexResult){
+        Set<String> tumorRadiationSecNum = new CopyOnWriteArraySet<>();
+        if(adviceNum.containsKey("tumorRadiationSecNum")&& adviceNum.get("tumorRadiationSecNum") != null && adviceNum.get("tumorRadiationSecNum").size()>0){
+            tumorRadiationSecNum = adviceNum.get("tumorRadiationSecNum");
+            double count = tumorRadiationSecNum.size();
+            if(StringUtils.isNotEmpty(String.valueOf(count)) &&  count != 0d){
+                medIndexResult.setTumorRadiationResult(count);
+            }
+        }
+        return tumorRadiationSecNum;
+    }
     //指标19 抢救记录
     private  void rescueMethods(List<MedManageParamsDTO> medManageParams,MedIndexResult medIndexResult, Set<String> rescueCode){
         List<MedManageParamsDTO> manageList= new ArrayList<>();
@@ -3393,6 +3707,23 @@ public class ConsoleFacade {
         filterVO.setLastEndDate(endTime);
     };
 
+    //指标 16--植入物相关记录符合率
+    private Set<String> implantsMethods(FilterVO filterVO,MedIndexResult medIndexResult){
+        filterVO.setFlagStr("4");
+        List<MedManageParamsDTO> fileLists = behospitalInfoFacade.getMedManageParams(filterVO);
+        Set<String> collect = fileLists.parallelStream().filter(obj -> {
+            String content = obj.getContent();
+            Map contenMap = JSON.parseObject(content, Map.class);
+            return contenMap.containsKey("使用植入性材料") && StringUtils.isNotEmpty(contenMap.get("使用植入性材料").toString())
+                    && "true".equals(contenMap.get("使用植入性材料").toString());
+        }).map(MedManageParamsDTO::getBehospitalCode).collect(Collectors.toSet());
+        double count = collect.size();
+        if(StringUtils.isNotEmpty(String.valueOf(count)) &&  count != 0d){
+            medIndexResult.setImplantsResult(count);
+        }
+        return collect;
+    }
+
     //指标21 出院患者病历归档完整率
     private void fileCompleteMethods(FilterVO filterVO,MedIndexResult medIndexResult){
         filterVO.setFlagStr("3");
@@ -3403,6 +3734,18 @@ public class ConsoleFacade {
         }
     }
 
+    //指标23  知情同意书规范签署率
+//    private void contentSignMethods(List<MedManageParamsDTO>fileLists,MedIndexResult medIndexResult){
+//        Set<String> collect = fileLists.parallelStream().filter(obj -> {
+//            String content = obj.getContent();
+//            Map contenMap = JSON.parseObject(content, Map.class);
+//            return contenMap.containsKey("签署") && StringUtils.isNotEmpty(contenMap.get("签署").toString());
+//        }).map(MedManageParamsDTO::getBehospitalCode).collect(Collectors.toSet());
+//        double count = collect.size();
+//        if(StringUtils.isNotEmpty(String.valueOf(count)) &&  count != 0d){
+//            medIndexResult.setRecordSignResult(count);
+//        }
+//    }
 
 
     /**

+ 2 - 0
src/main/java/com/diagbot/facade/FilterFacade.java

@@ -518,10 +518,12 @@ public class FilterFacade {
      * @param reBeHosPageVO
      */
     public void reBeHosPageVOSet(ReBeHosPageVO reBeHosPageVO) {
+        if(null == reBeHosPageVO.getUserId() && StringUtils.isEmpty(reBeHosPageVO.getHospitalId())){
         String hospitalId = SysUserUtils.getCurrentHospitalID();
         String userId = SysUserUtils.getCurrentPrincipleID();
         reBeHosPageVO.setHospitalId(hospitalId);
         reBeHosPageVO.setUserId(Long.valueOf(userId));
+        }
     }
 
     /**

+ 38 - 30
src/main/java/com/diagbot/facade/SysUserFacade.java

@@ -39,6 +39,7 @@ import org.springframework.security.crypto.factory.PasswordEncoderFactories;
 import org.springframework.security.crypto.password.PasswordEncoder;
 import org.springframework.security.oauth2.common.OAuth2AccessToken;
 import org.springframework.stereotype.Component;
+import org.springframework.util.DigestUtils;
 
 import java.util.*;
 import java.util.stream.Collectors;
@@ -101,6 +102,8 @@ public class SysUserFacade extends SysUserServiceImpl {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
                     "请输入密码");
         }
+        //使用MD5对密码进行加密
+        String MD5Password = DigestUtils.md5DigestAsHex(password.getBytes());
         QueryWrapper<SysUser> userQueryWrapper = new QueryWrapper<>();
         userQueryWrapper.eq("username", username)
                 .eq("status", StatusEnum.Enable.getKey())
@@ -110,11 +113,11 @@ public class SysUserFacade extends SysUserServiceImpl {
             throw new CommonException(ServiceErrorCode.USER_NOT_FOUND);
         }
         PasswordEncoder passwordEncoder = PasswordEncoderFactories.createDelegatingPasswordEncoder();
-        if (!passwordEncoder.matches(password, user.getPassword())) {
+        if (!passwordEncoder.matches(MD5Password, user.getPassword())) {
             throw new CommonException(ServiceErrorCode.USER_PASSWORD_ERROR);
         }
         JWT jwt = authServiceClient.getToken("Basic dWFhLXNlcnZpY2U6MTIzNDU2",
-                "password", username, password);
+                "password", username, MD5Password);
         if (null == jwt) {
             throw new CommonException(ServiceErrorCode.GET_TOKEN_FAIL);
         }
@@ -143,22 +146,22 @@ public class SysUserFacade extends SysUserServiceImpl {
         jwtStore.setRefreshToken(jwt.getRefresh_token());
         tokenFacade.createToken(jwtStore);
         /***
-         * 未加密密码复杂度判断
+         * 未经过MD5加密密码复杂度判断
          */
-        //获取用户医院id
-//        String hospitalID = SysUserUtils.getCurrentHospitalID();
-//        Long id = user.getId();
-//        QueryWrapper<SysUserHospital> UserHospitalQueryWrapper = new QueryWrapper<>();
-//        UserHospitalQueryWrapper
-//                .eq("user_id", id)
-//                .eq("is_deleted", IsDeleteEnum.N.getKey());
-//        SysUserHospital userHospital = sysUserHospitalFacade.getOne(UserHospitalQueryWrapper, false);
-//        Long hospitalId = userHospital.getHospitalId();
-//        String idStr = String.valueOf(hospitalId);
-//        Boolean passwordRegular = passwordRegular(password,idStr);
-//        if(!passwordRegular){
-//            data.setPasswordComplexity("密码复杂度过低,请及时修改密码");
-//        }
+     //   获取用户医院id
+   //     String hospitalID = SysUserUtils.getCurrentHospitalID();
+        Long id = user.getId();
+        QueryWrapper<SysUserHospital> UserHospitalQueryWrapper = new QueryWrapper<>();
+        UserHospitalQueryWrapper
+                .eq("user_id", id)
+                .eq("is_deleted", IsDeleteEnum.N.getKey());
+        SysUserHospital userHospital = sysUserHospitalFacade.getOne(UserHospitalQueryWrapper, false);
+        Long hospitalId = userHospital.getHospitalId();
+        String idStr = String.valueOf(hospitalId);
+        Boolean passwordRegular = passwordRegular(password,idStr);
+        if(!passwordRegular){
+            data.setPasswordComplexity("未修改初始密码,请及时修改密码");
+        }
         return data;
     }
 
@@ -255,17 +258,22 @@ public class SysUserFacade extends SysUserServiceImpl {
      * @return 修改密码是否成功
      */
     public Boolean modifyPassword(String password, String modifyPassword) {
+        //使用MD5对原密码和新密码进行加密
+        String MD5Password = DigestUtils.md5DigestAsHex(password.getBytes());
+        String MD5ModifyPassword = DigestUtils.md5DigestAsHex(modifyPassword.getBytes());
         if (StringUtil.isBlank(password)) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "请输入密码");
+                    "请输入密码");
         }
         if (StringUtil.isBlank(modifyPassword)) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
                     "请输入新密码");
         }
-        if (password.equals(modifyPassword)) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "原密码和新密码不能相同");
+        //对传入的密码进行格式验证
+        String hospitalID = SysUserUtils.getCurrentHospitalID();
+        Boolean regularBoolean = passwordRegular(modifyPassword,hospitalID);
+        if(!regularBoolean){
+            throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "请输入正确格式的新密码");
         }
         String userId = SysUserUtils.getCurrentPrincipleID();
         SysUser user = this.getOne(new QueryWrapper<SysUser>()
@@ -277,15 +285,14 @@ public class SysUserFacade extends SysUserServiceImpl {
         }
         PasswordEncoder passwordEncoder
                 = PasswordEncoderFactories.createDelegatingPasswordEncoder();
-        if (!passwordEncoder.matches(password, user.getPassword())) {
+        if (!passwordEncoder.matches(MD5Password, user.getPassword())) {
             throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "原密码错误");
         }
-//        String hospitalID = SysUserUtils.getCurrentHospitalID();
-//        Boolean regularBoolean = passwordRegular(modifyPassword,hospitalID);
-//        if(!regularBoolean){
-//            throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "请输入正确格式的新密码");
-//        }
-        String entryPassword = passwordEncoder.encode(modifyPassword);
+        if (password.equals(modifyPassword)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_ERROR,
+                    "原密码和新密码不能相同");
+        }
+        String entryPassword = passwordEncoder.encode(MD5ModifyPassword);
         user.setPassword(entryPassword);
         user.setGmtModified(DateUtil.now());
         user.setModifier(userId);
@@ -299,14 +306,15 @@ public class SysUserFacade extends SysUserServiceImpl {
      * @return
      */
     public Boolean passwordRegular(String password,String hospitalId){
-        //获取字点表中存储的正则表达式   "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[$@$!%*?&])[A-Za-z\\d$@$!%*?&]{8,}"
         boolean check=true;
         Map<String, Map<String, String>> dictionaryWithKey = sysDictionaryFacade.getDictionaryWithKey();
         if(dictionaryWithKey!=null){
             Map<String, String> stringStringMap = dictionaryWithKey.get("30");
             if(stringStringMap!=null) {
                 String regular = stringStringMap.get(hospitalId);
-                check = password.matches(regular);
+                if(StringUtil.isNotEmpty(regular)) {
+                    check = password.matches(regular);
+                }
             }
         }
         return check;

+ 1 - 1
src/main/java/com/diagbot/vo/AnalyzeVO.java

@@ -28,6 +28,6 @@ public class AnalyzeVO {
     @ApiModelProperty(hidden = true)
     private Integer delStatus;
     //已核查不能再次评分校验
-    @ApiModelProperty(hidden = true)
+    @ApiModelProperty("已核查不能再次评分标志位,false表示核查与评分无关已核查也可以评分")
     private Boolean checkFlag = false;
 }

+ 2 - 0
src/main/java/com/diagbot/vo/ReBeHosPageVO.java

@@ -37,4 +37,6 @@ public class ReBeHosPageVO extends Page {
      * 是否归档(0:未归档,1:已归档)
      */
     private String isPlacefile = "1";
+
+    private int flag = 0;//1-导出操作;
 }

+ 0 - 2
src/main/java/com/diagbot/web/BehospitalInfoController.java

@@ -85,8 +85,6 @@ public class BehospitalInfoController {
     @SysLogger("analyze")
     @Transactional
     public RespDTO<AnalyzeDTO> analyze(@RequestBody AnalyzeVO analyzeVO) {
-        analyzeVO.setUseCrfCache(true);
-        analyzeVO.setCheckFlag(true);
         return RespDTO.onSuc(behospitalInfoFacade.analyze(analyzeVO));
     }
 

+ 1 - 1
src/main/java/com/diagbot/web/SysUserController.java

@@ -61,7 +61,7 @@ public class SysUserController {
 
     @ApiOperation(value = "登录获取jwt[by:gaodm]",
             notes = "username:用户名,必填<br>" +
-                    "password:密码, 必填, 默认密码:dc483e80a7a0bd9ef71d8cf973673924<br> ")
+                    "password:密码, 必填, 默认密码:a123456<br> ")
     @PostMapping("/getJwt")
     @SysLogger("getJwt")
     public RespDTO<JwtDTO> getJwt(@RequestBody UserLoginVO userLoginVO) {

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

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

+ 271 - 95
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -728,8 +728,7 @@
         f2.secWorkNum,
         f3.thrWorkNum,
         f3.forWorkNum,
-        f3.sixWorkNum,
-        f4.sevenWorkNum
+        f3.sixWorkNum
         from (
         SELECT count(DISTINCT a.behospital_code)  as firWorkNum
         FROM
@@ -780,23 +779,7 @@
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
         </if>)m
-            )f3,(
-        SELECT count(DISTINCT a.behospital_code)  as sevenWorkNum
-        FROM
-        med_behospital_info a
-        WHERE
-        a.is_deleted = 'N'
-        AND a.is_placefile = 1
-        <if test="hospitalId != null and hospitalId != ''">
-            AND a.hospital_id = #{hospitalId}
-        </if>
-        <![CDATA[AND a.qc_type_id <>0 ]]>
-        <if test="startDate != null and startDate != ''">
-            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
-        </if>
-        <if test="endDate != null and endDate != ''">
-            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
-        </if>)f4
+            )f3
     </select>
 
     <!-- 病案管理规则质控缺陷病历总数查询-->
@@ -811,6 +794,10 @@
         f3.da_status AS daStatus,
         f3.doctor_advice_type as doctorAdviceType,
         </if>
+        <if test="flagStr != null and flagStr == 4 ">
+            f5.content as content,
+            f5.rec_title as recTitle,
+        </if>
         f1.hospitalId
         from(
         SELECT DISTINCT
@@ -850,6 +837,12 @@
             AND f1.behospitalCode = f4.behospital_code
             AND f4.is_reject = 1
         </if>
+        <if test="flagStr != null and flagStr == 4">
+            join  str_informed_consent f5
+            on  f5.is_deleted = 'N'
+            AND f1.hospitalId = f5.hospital_id
+            AND f1.behospitalCode = f5.behospital_code
+        </if>
     </select>
 
 
@@ -6054,9 +6047,21 @@
         a.beh_dept_name,
         a.beh_dept_id
         FROM
-        med_behospital_info a
+        med_behospital_info a,
+        med_qcresult_info b,
+        med_qcresult_detail c,
+        qc_cases_entry d
         WHERE
         a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND d.is_deleted = 'N'
+        AND a.hospital_id = b.hospital_id
+        AND a.hospital_id = c.hospital_id
+        AND a.behospital_code = b.behospital_code
+        AND a.behospital_code = c.behospital_code
+        AND c.cases_id = d.cases_id
+        AND c.cases_entry_id = d.id
         AND TIMESTAMPDIFF(
         DAY,
         DATE( behospital_date ),
@@ -6568,18 +6573,31 @@
         a.doctor_name
         FROM
         med_behospital_info a,
-        sys_user_dept b
+        med_behospital_info a,
+        med_qcresult_info b,
+        med_qcresult_detail c,
+        qc_cases_entry d,
+        sys_user_dept e
         WHERE
         a.is_deleted = 'N'
         AND b.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND d.is_deleted = 'N'
+        AND e.is_deleted = 'N'
         AND a.hospital_id = b.hospital_id
-        AND a.beh_dept_id = b.dept_id
+        AND a.hospital_id = c.hospital_id
+        AND a.hospital_id = e.hospital_id
+        AND a.behospital_code = b.behospital_code
+        AND a.behospital_code = c.behospital_code
+        AND c.cases_id = d.cases_id
+        AND c.cases_entry_id = d.id
+        AND a.beh_dept_id = e.dept_id
         AND TIMESTAMPDIFF(
         DAY,
         DATE( behospital_date ),
         DATE( leave_hospital_date ))> 31
         <if test="userId!=null">
-            AND b.user_id = #{userId}
+            AND e.user_id = #{userId}
         </if>
         <if test="isPlacefile != null and isPlacefile != ''">
             and a.is_placefile = #{isPlacefile}
@@ -13945,6 +13963,7 @@
         SELECT
         t.fileCode,
         t.diagnose,
+        t.diagnoseName,
         t.NAME,
         t.sex,
         t.hospitalId,
@@ -13952,6 +13971,8 @@
         t.behDeptName,
         t.behospitalCode,
         t.behospitalDate,
+        t.lastDiagnose,
+        t.lastDiagnoseName,
         t.leaveHospitalDate,
         t.lastBehDeptId,
         t.lastBehDeptName,
@@ -13965,6 +13986,10 @@
         mqi_last.LEVEL AS lastLevel,
         mhp.total_fee AS totleFee,
         mhp.behospital_day_num AS behospitalDayNum,
+        mhp.again_behospital_plan AS againBehospitalPlan,
+        IF(mhp.age is null, null,CONCAT( ifnull(mhp.age,'') ,ifnull(mhp.age_unit,'') ))as age,
+        mhp_last.again_behospital_plan AS lastAgainBehospitalPlan,
+        IF(mhp_last.age is null, null,CONCAT( ifnull(mhp_last.age,'') ,ifnull(mhp_last.age_unit,'') ))as lastAge,
         mhp_last.total_fee AS lastTotleFee,
         mhp_last.behospital_day_num AS lastBehospitalDayNum
         FROM
@@ -13972,6 +13997,7 @@
         SELECT
         be.fileCode,
         be.diagnose,
+        be.diagnoseName,
         be.NAME,
         be.sex,
         be.hospitalId,
@@ -13980,6 +14006,8 @@
         be.behospitalCode,
         be.behospitalDate,
         be.leaveHospitalDate,
+        be.lastDiagnose,
+        be.lastDiagnoseName,
         be.lastBehDeptId,
         be.lastBehDeptName,
         be.lastBehospitalCode,
@@ -13991,6 +14019,7 @@
         SELECT
         r1.file_code AS fileCode,
         r1.diagnose,
+        r1.diagnose_name AS diagnoseName,
         r1.NAME,
         r1.sex,
         r1.hospital_id AS hospitalId,
@@ -13999,6 +14028,8 @@
         r1.behospital_code AS behospitalCode,
         r1.behospital_date AS behospitalDate,
         r1.leave_hospital_date AS leaveHospitalDate,
+        r2.diagnose AS lastDiagnose,
+        r2.diagnose_name AS lastDiagnoseName,
         r2.beh_dept_id AS lastBehDeptId,
         r2.beh_dept_name AS lastBehDeptName,
         r2.behospital_code AS lastBehospitalCode,
@@ -14010,20 +14041,33 @@
         SELECT
         ( @rownum := @rownum + 1 ) AS rownum,
         t1.file_code,
+        t1.behospital_code,
         t1.diagnose,
+        t1.diagnose_name,
         t1.NAME,
         t1.sex,
         t1.hospital_id,
         t1.beh_dept_id,
         t1.beh_dept_name,
-        t1.behospital_code,
         t1.behospital_date,
         t1.leave_hospital_date
-        FROM
-        (
+        FROM(
+        select
+        tt3.file_code,
+        tt3.behospital_code,
+        tt3.diagnose,
+        tt3.NAME,
+        tt3.sex,
+        tt3.hospital_id,
+        tt3.beh_dept_id,
+        tt3.beh_dept_name,
+        tt3.behospital_date,
+        tt3.leave_hospital_date,
+        GROUP_CONCAT(case when tt5.diagnose_name is not null then tt5.diagnose_name else '' end) as diagnose_name
+        FROM(
         SELECT
-        tt1.file_code,
-        tt1.diagnose,
+        tt2.file_code,
+        tt2.diagnose,
         tt2.NAME,
         tt2.sex,
         tt2.hospital_id,
@@ -14035,8 +14079,7 @@
         FROM
         (
         SELECT
-        a.file_code,
-        a.diagnose
+        a.file_code
         FROM
         med_behospital_info a
         WHERE
@@ -14073,8 +14116,7 @@
             AND a.name like concat('%', #{reBeHosPageVO.name},'%')
         </if>
         GROUP BY
-        a.file_code,
-        a.diagnose
+        a.file_code
         HAVING
         count(*)> 1
         ) tt1,
@@ -14086,7 +14128,6 @@
         </if>
         AND tt2.qc_type_id != 0
         AND tt1.file_code = tt2.file_code
-        AND tt1.diagnose = tt2.diagnose
         <if test="reBeHosPageVO.hospitalId != null and reBeHosPageVO.hospitalId != ''">
             AND tt2.hospital_id = #{reBeHosPageVO.hospitalId}
         </if>
@@ -14114,8 +14155,15 @@
         </if>
         ORDER BY
         tt1.file_code,
-        tt1.diagnose,
-        tt2.behospital_date DESC
+        tt2.behospital_date DESC)tt3
+        left join med_home_page tt4 on tt4.is_deleted = 'N'
+        AND tt3.hospital_id = tt4.hospital_id
+        AND tt3.behospital_code = tt4.behospital_code
+        LEFT JOIN med_home_diagnose_info tt5 on tt5.is_deleted = 'N'
+        AND tt4.hospital_id = tt5.hospital_id
+        AND tt4.home_page_id = tt5.home_page_id
+        GROUP by tt3.behospital_code
+        ORDER BY tt3.file_code,tt3.leave_hospital_date DESC
         ) t1,
         ( SELECT @rownum := 0 ) r
         ) r1
@@ -14123,20 +14171,33 @@
         SELECT
         ( @INDEX := @INDEX + 1 ) AS rownum,
         t1.file_code,
+        t1.behospital_code,
         t1.diagnose,
+        t1.diagnose_name,
         t1.NAME,
         t1.sex,
         t1.hospital_id,
         t1.beh_dept_id,
         t1.beh_dept_name,
-        t1.behospital_code,
         t1.behospital_date,
         t1.leave_hospital_date
-        FROM
-        (
+        FROM(
+        select
+        tt3.file_code,
+        tt3.behospital_code,
+        tt3.diagnose,
+        tt3.NAME,
+        tt3.sex,
+        tt3.hospital_id,
+        tt3.beh_dept_id,
+        tt3.beh_dept_name,
+        tt3.behospital_date,
+        tt3.leave_hospital_date,
+        GROUP_CONCAT(case when tt5.diagnose_name is not null then tt5.diagnose_name else '' end) as diagnose_name
+        FROM(
         SELECT
-        tt1.file_code,
-        tt1.diagnose,
+        tt2.file_code,
+        tt2.diagnose,
         tt2.NAME,
         tt2.sex,
         tt2.hospital_id,
@@ -14148,8 +14209,7 @@
         FROM
         (
         SELECT
-        a.file_code,
-        a.diagnose
+        a.file_code
         FROM
         med_behospital_info a
         WHERE
@@ -14186,8 +14246,7 @@
             AND a.name like concat('%', #{reBeHosPageVO.name},'%')
         </if>
         GROUP BY
-        a.file_code,
-        a.diagnose
+        a.file_code
         HAVING
         count(*)> 1
         ) tt1,
@@ -14199,7 +14258,6 @@
         </if>
         AND tt2.qc_type_id != 0
         AND tt1.file_code = tt2.file_code
-        AND tt1.diagnose = tt2.diagnose
         <if test="reBeHosPageVO.hospitalId != null and reBeHosPageVO.hospitalId != ''">
             AND tt2.hospital_id = #{reBeHosPageVO.hospitalId}
         </if>
@@ -14227,12 +14285,17 @@
         </if>
         ORDER BY
         tt1.file_code,
-        tt1.diagnose,
-        tt2.behospital_date DESC
-        ) t1,(
-        SELECT
-        @INDEX := 0
-        ) r
+        tt2.behospital_date DESC)tt3
+        left join med_home_page tt4 on tt4.is_deleted = 'N'
+        AND tt3.hospital_id = tt4.hospital_id
+        AND tt3.behospital_code = tt4.behospital_code
+        LEFT JOIN med_home_diagnose_info tt5 on tt5.is_deleted = 'N'
+        AND tt4.hospital_id = tt5.hospital_id
+        AND tt4.home_page_id = tt5.home_page_id
+        GROUP by tt3.behospital_code
+        ORDER BY tt3.file_code,tt3.leave_hospital_date DESC
+        ) t1,
+        ( SELECT @INDEX := 0 ) r
         ) r2 ON r1.file_code = r2.file_code
         AND r1.rownum = r2.rownum - 1
         ) be
@@ -14260,6 +14323,7 @@
         SELECT
         t.fileCode,
         t.diagnose,
+        t.diagnoseName,
         t.NAME,
         t.sex,
         t.hospitalId,
@@ -14270,6 +14334,8 @@
         t.behospitalCode,
         t.behospitalDate,
         t.leaveHospitalDate,
+        t.lastDiagnose,
+        t.lastDiagnoseName,
         t.lastBehDeptId,
         t.lastBehDeptName,
         t.lastDoctorName,
@@ -14281,6 +14347,8 @@
         mqi.LEVEL AS LEVEL,
         mqi_last.score_res AS lastScoreRes,
         mqi_last.LEVEL AS lastLevel,
+        mhp.again_behospital_plan AS againBehospitalPlan,
+        mhp_last.again_behospital_plan AS lastAgainBehospitalPlan,
         mhp.total_fee AS totleFee,
         mhp.behospital_day_num AS behospitalDayNum,
         mhp_last.total_fee AS lastTotleFee,
@@ -14290,6 +14358,7 @@
         SELECT
         be.fileCode,
         be.diagnose,
+        be.diagnoseName,
         be.NAME,
         be.sex,
         be.hospitalId,
@@ -14300,6 +14369,8 @@
         be.behospitalCode,
         be.behospitalDate,
         be.leaveHospitalDate,
+        be.lastDiagnose,
+        be.lastDiagnoseName,
         be.lastBehDeptId,
         be.lastBehDeptName,
         be.lastDoctorId,
@@ -14313,6 +14384,7 @@
         SELECT
         r1.file_code AS fileCode,
         r1.diagnose,
+        r1.diagnose_name AS diagnoseName,
         r1.NAME,
         r1.sex,
         r1.hospital_id AS hospitalId,
@@ -14323,6 +14395,8 @@
         r1.behospital_code AS behospitalCode,
         r1.behospital_date AS behospitalDate,
         r1.leave_hospital_date AS leaveHospitalDate,
+        r2.diagnose AS lastDiagnose,
+        r2.diagnose_name AS lastDiagnoseName,
         r2.beh_dept_id AS lastBehDeptId,
         r2.beh_dept_name AS lastBehDeptName,
         r2.behospital_code AS lastBehospitalCode,
@@ -14336,9 +14410,10 @@
         SELECT
         ( @rownum := @rownum + 1 ) AS rownum,
         t1.file_code,
-        t1.diagnose,
         t1.NAME,
         t1.sex,
+        t1.diagnose,
+        t1.diagnose_name,
         t1.doctor_id,
         t1.doctor_name,
         t1.hospital_id,
@@ -14349,9 +14424,24 @@
         t1.leave_hospital_date
         FROM
         (
+        select
+        tt3.file_code,
+        tt3.behospital_code,
+        tt3.diagnose,
+        tt3.NAME,
+        tt3.sex,
+        tt3.hospital_id,
+        tt3.beh_dept_id,
+        tt3.beh_dept_name,
+        tt3.doctor_id,
+        tt3.doctor_name,
+        tt3.behospital_date,
+        tt3.leave_hospital_date,
+        GROUP_CONCAT(case when tt5.diagnose_name is not null then tt5.diagnose_name else '' end) as diagnose_name
+        FROM(
         SELECT
         tt1.file_code,
-        tt1.diagnose,
+        tt2.diagnose,
         tt2.doctor_id,
         tt2.doctor_name,
         tt2.NAME,
@@ -14365,10 +14455,7 @@
         FROM
         (
         SELECT
-        a.file_code,
-        a.diagnose,
-        a.doctor_id,
-        a.doctor_name
+        a.file_code
         FROM
         med_behospital_info a,
         sys_user_dept c
@@ -14415,8 +14502,7 @@
             AND a.name like concat('%', #{reBeHosPageVO.name},'%')
         </if>
         GROUP BY
-        a.file_code,
-        a.diagnose
+        a.file_code
         HAVING
         count(*)> 1
         ) tt1,
@@ -14428,7 +14514,6 @@
         </if>
         AND tt2.qc_type_id != 0
         AND tt1.file_code = tt2.file_code
-        AND tt1.diagnose = tt2.diagnose
         <if test="reBeHosPageVO.hospitalId != null and reBeHosPageVO.hospitalId != ''">
             AND tt2.hospital_id = #{reBeHosPageVO.hospitalId}
         </if>
@@ -14456,8 +14541,15 @@
         </if>
         ORDER BY
         tt1.file_code,
-        tt1.diagnose,
-        tt2.behospital_date DESC
+        tt2.behospital_date DESC)tt3
+        left join med_home_page tt4 on tt4.is_deleted = 'N'
+        AND tt3.hospital_id = tt4.hospital_id
+        AND tt3.behospital_code = tt4.behospital_code
+        LEFT JOIN med_home_diagnose_info tt5 on tt5.is_deleted = 'N'
+        AND tt4.hospital_id = tt5.hospital_id
+        AND tt4.home_page_id = tt5.home_page_id
+        GROUP by tt3.behospital_code
+        ORDER BY tt3.file_code,tt3.leave_hospital_date DESC
         ) t1,
         ( SELECT @rownum := 0 ) r
         ) r1
@@ -14465,22 +14557,38 @@
         SELECT
         ( @INDEX := @INDEX + 1 ) AS rownum,
         t1.file_code,
-        t1.diagnose,
         t1.NAME,
         t1.sex,
+        t1.diagnose,
+        t1.diagnose_name,
+        t1.doctor_id,
+        t1.doctor_name,
         t1.hospital_id,
         t1.beh_dept_id,
         t1.beh_dept_name,
-        t1.doctor_id,
-        t1.doctor_name,
         t1.behospital_code,
         t1.behospital_date,
         t1.leave_hospital_date
         FROM
         (
+        select
+        tt3.file_code,
+        tt3.behospital_code,
+        tt3.diagnose,
+        tt3.NAME,
+        tt3.sex,
+        tt3.hospital_id,
+        tt3.beh_dept_id,
+        tt3.beh_dept_name,
+        tt3.doctor_id,
+        tt3.doctor_name,
+        tt3.behospital_date,
+        tt3.leave_hospital_date,
+        GROUP_CONCAT(case when tt5.diagnose_name is not null then tt5.diagnose_name else '' end) as diagnose_name
+        FROM(
         SELECT
         tt1.file_code,
-        tt1.diagnose,
+        tt2.diagnose,
         tt2.doctor_id,
         tt2.doctor_name,
         tt2.NAME,
@@ -14494,10 +14602,7 @@
         FROM
         (
         SELECT
-        a.file_code,
-        a.diagnose,
-        a.doctor_id ,
-        a.doctor_name
+        a.file_code
         FROM
         med_behospital_info a,
         sys_user_dept c
@@ -14507,14 +14612,14 @@
         AND a.hospital_id = c.hospital_id
         AND a.beh_dept_id = c.dept_id
         <if test="reBeHosPageVO.deptName != null and reBeHosPageVO.deptName != ''">
-              and a.beh_dept_name = #{reBeHosPageVO.deptName}
-        </if>
-        <if test="reBeHosPageVO.userId!=null">
-            AND c.user_id = #{reBeHosPageVO.userId}
+            and a.beh_dept_name = #{reBeHosPageVO.deptName}
         </if>
         <if test="reBeHosPageVO.isPlacefile != null and reBeHosPageVO.isPlacefile != ''">
             and a.is_placefile = #{reBeHosPageVO.isPlacefile}
         </if>
+        <if test="reBeHosPageVO.userId!=null">
+            AND c.user_id = #{reBeHosPageVO.userId}
+        </if>
         AND a.qc_type_id != 0
         AND IFNULL( a.diagnose, '' )!= ''
         AND IFNULL( a.file_code, '' )!= ''
@@ -14544,8 +14649,7 @@
             AND a.name like concat('%', #{reBeHosPageVO.name},'%')
         </if>
         GROUP BY
-        a.file_code,
-        a.diagnose
+        a.file_code
         HAVING
         count(*)> 1
         ) tt1,
@@ -14557,7 +14661,6 @@
         </if>
         AND tt2.qc_type_id != 0
         AND tt1.file_code = tt2.file_code
-        AND tt1.diagnose = tt2.diagnose
         <if test="reBeHosPageVO.hospitalId != null and reBeHosPageVO.hospitalId != ''">
             AND tt2.hospital_id = #{reBeHosPageVO.hospitalId}
         </if>
@@ -14585,12 +14688,17 @@
         </if>
         ORDER BY
         tt1.file_code,
-        tt1.diagnose,
-        tt2.behospital_date DESC
-        ) t1,(
-        SELECT
-        @INDEX := 0
-        ) r
+        tt2.behospital_date DESC)tt3
+        left join med_home_page tt4 on tt4.is_deleted = 'N'
+        AND tt3.hospital_id = tt4.hospital_id
+        AND tt3.behospital_code = tt4.behospital_code
+        LEFT JOIN med_home_diagnose_info tt5 on tt5.is_deleted = 'N'
+        AND tt4.hospital_id = tt5.hospital_id
+        AND tt4.home_page_id = tt5.home_page_id
+        GROUP by tt3.behospital_code
+        ORDER BY tt3.file_code,tt3.leave_hospital_date DESC
+        ) t1,
+        ( SELECT @INDEX := 0 ) r
         ) r2 ON r1.file_code = r2.file_code
         AND r1.rownum = r2.rownum - 1
         ) be
@@ -17715,6 +17823,33 @@
         count(
         DISTINCT
         CASE
+        WHEN a.type = 11 THEN
+        a.behospital_code
+        ELSE
+        NULL
+        END
+        ) AS 'bacterialCulture',
+        count(
+        DISTINCT
+        CASE
+        WHEN a.type = 12 THEN
+        a.behospital_code
+        ELSE
+        NULL
+        END
+        ) AS 'antibiosis',
+        count(
+        DISTINCT
+        CASE
+        WHEN a.type = 13 THEN
+        a.behospital_code
+        ELSE
+        NULL
+        END
+        ) AS 'chemotherapyMalignantTumors',
+        count(
+        DISTINCT
+        CASE
         WHEN a.type = 15 THEN
         a.behospital_code
         ELSE
@@ -17747,7 +17882,43 @@
         ELSE
         NULL
         END
-        ) AS 'rescueNum'
+        ) AS 'rescueNum',
+        count(
+        DISTINCT
+        CASE
+        WHEN a.type = 22 THEN
+        a.behospital_code
+        ELSE
+        NULL
+        END
+        ) AS 'unreasonedCopyNum',
+        count(
+        DISTINCT
+        CASE
+        WHEN a.type = 14 THEN
+        a.behospital_code
+        ELSE
+        NULL
+        END
+        ) AS 'tumorRadiationNum',
+        count(
+        DISTINCT
+        CASE
+        WHEN a.type = 16 THEN
+        a.behospital_code
+        ELSE
+        NULL
+        END
+        ) AS 'implantsNum',
+        count(
+        DISTINCT
+        CASE
+        WHEN a.type = 23 THEN
+        a.behospital_code
+        ELSE
+        NULL
+        END
+        ) AS 'InformedNum'
         FROM
         (
         SELECT
@@ -17843,8 +18014,17 @@
 
 <!--    首页恶性肿瘤-->
     <select id="malignancy" parameterType="com.diagbot.vo.FilterVO" resultType="java.util.Map">
+        select
+        a.behospital_code,
+        a.hospital_id,
+        d.diagnose_name,
+        d.diagnose_type,
+        d.icd_code
+        from(
         SELECT
-        d.behospital_code
+        d.behospital_code,
+        d.hospital_id,
+        b.home_page_id
         FROM
         (
         SELECT
@@ -17871,16 +18051,12 @@
         JOIN med_home_page b ON b.behospital_code = d.behospital_code
         AND d.hospital_id = b.hospital_id
         AND b.is_deleted = 'N'
-        AND (
-        (
-        b.outpatient_emr_diagnose LIKE '%恶性肿瘤%'
-        AND b.outpatient_emr_diagnose_code LIKE 'C%'
-        )
-        OR (
-        b.outpatient_emr_diagnose LIKE 'C%'
-        AND b.outpatient_emr_diagnose_code LIKE '%恶性肿瘤%'
-        )
-        )
+        )a join
+        med_home_diagnose_info d on a.hospital_id=d.hospital_id
+        where a.home_page_id =d.home_page_id
+        and d.is_deleted ='N'
+        and d.diagnose_name like '%恶性肿瘤%'
+        and d.icd_code like 'C%'
     </select>
 
     <!-- 获取患者年龄信息(通过出生日期和入院日期重新计算) -->

+ 7 - 5
src/main/resources/mapper/MedIndexResultMapper.xml

@@ -48,11 +48,13 @@
             COALESCE (sum(a.antibiosis_result), 0) AS 'antibiosisFeeNum',
             COALESCE (sum(a.tumor_chemistry_result),0) AS 'chemotherapyMalignantTumorsNum',
             COALESCE (sum(a.tumor_radiation_result),0) AS 'tumor_radiation_result',
-            COALESCE (sum(a.implants_result), 0) AS 'implants_result',
-            COALESCE (sum(a.blood_result), 0) AS 'blood_result',
-            COALESCE (sum(a.rescue_result), 0) AS 'rescue_result',
-            COALESCE (sum(a.sec_file_result), 0) AS 'sec_file_result',
-            COALESCE (sum(a.file_complete_result), 0) AS 'fileCompleteResult'
+            COALESCE (sum(a.implants_result), 0) AS 'implantsResult',
+            COALESCE (sum(a.blood_result), 0) AS 'bloodResult',
+            COALESCE (sum(a.rescue_result), 0) AS 'rescueResult',
+            COALESCE (sum(a.sec_file_result), 0) AS 'secFileResult',
+            COALESCE (sum(a.file_complete_result), 0) AS 'fileCompleteResult',
+            COALESCE (sum(a.tumor_radiation_result), 0) AS 'tumorRadiationResult'
+
         FROM
             med_index_result a
         WHERE

+ 0 - 1
src/main/resources/mapper/MedicalRecordMapper.xml

@@ -46,7 +46,6 @@
         and t1.rec_id = t3.rec_id
         and t1.hospital_id = #{hospitalId}
         and t1.behospital_code = #{behospitalCode}
-        and t3.xml_text != ''
     </select>
 
     <select id="getRecordCount"  resultType="java.lang.Integer">