浏览代码

Merge branch 'dev/20210326_2.0.2' into test

# Conflicts:
#	doc/031.20210326v2.0.2/qc_initv2.0.2.sql
chengyao 4 年之前
父节点
当前提交
daadea2da0

+ 3 - 4
doc/031.20210326v2.0.2/qc_initv2.0.2.sql

@@ -302,7 +302,6 @@ CREATE TABLE `med_index_result` (
 ) ENGINE=InnoDB AUTO_INCREMENT=1207 DEFAULT CHARSET=utf8;
 
 
-DROP TABLE IF EXISTS `med_index_relevance`;
 CREATE TABLE `med_index_relevance` (
   `id` int(10) NOT NULL AUTO_INCREMENT,
   `index_result_id` int(10) DEFAULT NULL COMMENT '主缓存表id',
@@ -316,6 +315,6 @@ CREATE TABLE `med_index_relevance` (
   `gmt_modified` datetime DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
   `creator` varchar(60) DEFAULT '0' COMMENT '创建人,0表示无创建人值',
   `modifier` varchar(60) DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
-  PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=6311 DEFAULT CHARSET=utf8;
-
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `index_all` (`relevance_type`,`hospital_id`,`behospital_code`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=345204 DEFAULT CHARSET=utf8;

+ 114 - 69
src/main/java/com/diagbot/facade/ConsoleFacade.java

@@ -594,7 +594,6 @@ public class ConsoleFacade {
         return true;
     }
 
-
     /**
      * 病案指标数据保存
      *
@@ -604,30 +603,37 @@ public class ConsoleFacade {
     public void getMedicaIndicator(FilterVO filterVO){
         MedIndexResult medIndexResult = new MedIndexResult();
        List<Map<String, String>> selectOperationNumMap = behospitalInfoFacade.selectOperationNum(filterVO);
-        if(ListUtil.isNotEmpty(selectOperationNumMap)) {
-        CopyOnWriteArrayList<String> outHospitalCode = new CopyOnWriteArrayList<>();
-        CopyOnWriteArrayList<String> operationCode = new CopyOnWriteArrayList<>();
-        CopyOnWriteArrayList<String> operationPathologyCode = new CopyOnWriteArrayList<>();
-        CopyOnWriteArrayList<String> antibiosisCode = new CopyOnWriteArrayList<>();
-        Long operationFeeNum = 0L;
+            Set<String> outHospitalCode = new CopyOnWriteArraySet<>();
+            Set<String> operationCode = new CopyOnWriteArraySet<>();
+            Set<String> operationPathologyCode = new CopyOnWriteArraySet<>();
+            Set<String> antibiosisCode = new CopyOnWriteArraySet<>();
+            List<String> adviceVerify = adviceVerify(filterVO);
+            Long operationFeeNum = 0L;
             filterVO.setFlagStr("2");
             List<MedManageParamsDTO> doctorAdviceMedManageParams = behospitalInfoFacade.getMedManageParams(filterVO);
             Map<String, List<String>> adviceNum = getAdviceNum(filterVO, doctorAdviceMedManageParams);
-                for (Map<String, String> stringStringMap : selectOperationNumMap) {
-                    String behospitalCode = stringStringMap.get("behospitalCode");
-                    //出院code
-                         outHospitalCode.add(behospitalCode);
-                    if (Double.parseDouble(stringStringMap.get("operationFee"))>0){
-                        //手术code
-                        operationCode.add(behospitalCode);
-                    }
-                    if (Double.parseDouble(stringStringMap.get("operationFee"))>0 && Double.parseDouble(stringStringMap.get("pathologyFee"))>QualityContent.pathologyFee){
-                        //病理code
-                        operationPathologyCode.add(behospitalCode);
-                    }
-                    if (Double.parseDouble(stringStringMap.get("antibiosisFee"))>0){
-                        //抗菌code
-                        antibiosisCode.add(behospitalCode);
+        if(ListUtil.isNotEmpty(selectOperationNumMap)) {
+            for (Map<String, String> stringStringMap : selectOperationNumMap) {
+                String behospitalCode = stringStringMap.get("behospitalCode");
+                //出院code
+                outHospitalCode.add(behospitalCode);
+                if (Double.parseDouble(stringStringMap.get("operationFee")) > 0) {
+                    //手术code
+                    operationCode.add(behospitalCode);
+                }
+                if (Double.parseDouble(stringStringMap.get("operationFee")) > 0 && Double.parseDouble(stringStringMap.get("pathologyFee")) > QualityContent.pathologyFee) {
+                    //病理code
+                    operationPathologyCode.add(behospitalCode);
+                }
+                if (Double.parseDouble(stringStringMap.get("antibiosisFee")) > 0) {
+                    //抗菌code
+                    antibiosisCode.add(behospitalCode);
+                }
+            }
+        }
+                if(ListUtil.isNotEmpty(adviceVerify)){
+                    for (String code : adviceVerify) {
+                        outHospitalCode.add(code);
                     }
                 }
             Long startCount = Long.valueOf(outHospitalCode.size());
@@ -638,7 +644,7 @@ public class ConsoleFacade {
                         operationCode.add(s);
                     }
                 }
-                if(ListUtil.isNotEmpty(operationCode)) {
+                if(operationCode.size()>0&&operationCode!=null) {
                     operationFeeNum = Long.valueOf(operationCode.size());
                 }
                 //CT人数
@@ -661,11 +667,16 @@ public class ConsoleFacade {
                         operationPathologyCode.add(s);
                     }
                 }
-                if(ListUtil.isNotEmpty(operationPathologyCode)) {
+                if(operationPathologyCode.size()>0&&operationPathologyCode!=null) {
                     operationPathologyFeeNum = Long.valueOf(operationPathologyCode.size());
                 }
+                //细菌培养人数
+                List<String> bacterialCultureList = adviceNum.get("bacterialCulture");
+                Long bacterialCultureNum=0L;
+                if(ListUtil.isNotEmpty(bacterialCultureList)) {
+                    bacterialCultureNum = Long.valueOf(bacterialCultureList.size());
+                }
                 //抗菌药物人数
-
                 List<String> antibiosisList = adviceNum.get("antibiosis");
                 if(ListUtil.isNotEmpty(antibiosisList)) {
                     for (String s : antibiosisList) {
@@ -673,7 +684,7 @@ public class ConsoleFacade {
                     }
                 }
                 Long antibiosisFeeNum =0L;
-                if(ListUtil.isNotEmpty(antibiosisCode)) {
+                if(antibiosisCode.size()>0&&antibiosisCode!=null) {
                     antibiosisFeeNum = Long.valueOf(antibiosisCode.size());
                 }
                 //恶性肿瘤化学治疗人数
@@ -702,6 +713,10 @@ public class ConsoleFacade {
                     if (operationPathologyFeeNum != null) {
                         medIndexResult.setPathologyResult(Double.valueOf(operationPathologyFeeNum));
                     }
+                 //细菌培养人数
+                    if (bacterialCultureNum != null) {
+                        medIndexResult.setGermResult(Double.valueOf(bacterialCultureNum));
+                    }
                 //抗菌人数
                     if (antibiosisFeeNum != null ) {
                         medIndexResult.setAntibiosisResult(Double.valueOf(antibiosisFeeNum));
@@ -717,22 +732,20 @@ public class ConsoleFacade {
         MedIndexFilterVO timeVo = new MedIndexFilterVO();
         BeanUtils.copyProperties(filterVO,timeVo);
         timeTrans(timeVo);
-            List<String> rescueCode = new CopyOnWriteArrayList<>();
-            List<String> bloodCode = new CopyOnWriteArrayList<>();
+            Set<String> rescueCode = new CopyOnWriteArraySet<>();
+            Set<String> bloodCode = new CopyOnWriteArraySet<>();
         //指标二十七
 
-        //指标十七 医师查房记录
+        //指标18 医师查房记录 查询直接返回 -code需要加载
 
-        //指标十八 抢救记录
+        //指标19 抢救记录
         rescueMethods(doctorAdviceMedManageParams,medIndexResult,rescueCode);
-        //指标十九 出院患者病历2日归档
+        //指标20 出院患者病历2日归档
         getfileSecAmounts(filterVO,medIndexResult);
-        //指标十四 手术记录
+        //指标15 手术记录
         medIndexResult.setOperationCompleteResult(Double.parseDouble(operationFeeNum+""));
-        //指标十六  临床用血相关记录符合率
-        filterVO.setFlagStr("1");
-        List<MedManageParamsDTO> medManageParams = behospitalInfoFacade.getMedManageParams(filterVO);
-        bloodMethods(doctorAdviceMedManageParams, medManageParams,medIndexResult,bloodCode);
+        //指标17  临床用血相关记录符合率
+        bloodMethods(doctorAdviceMedManageParams, filterVO,medIndexResult,bloodCode);
         medIndexResult.setHospitalId(filterVO.getHospitalId());
         medIndexResult.setStartDate(filterVO.getStartDate());
         medIndexResult.setEndDate(filterVO.getEndDate());
@@ -745,7 +758,7 @@ public class ConsoleFacade {
         medIndexRelevance.setStartDate(filterVO.getStartDate());
         medIndexRelevance.setEndDate(filterVO.getEndDate());
         medIndexRelevance.setGmtCreate(new Date());
-            if(ListUtil.isNotEmpty(outHospitalCode)) {
+            if(outHospitalCode.size()>0&&outHospitalCode!=null) {
                 medIndexRelevance.setRelevanceType(4);
                 for (String Code : outHospitalCode) {
                     medIndexRelevance.setBehospitalCode(Code);
@@ -762,7 +775,7 @@ public class ConsoleFacade {
                     medIndexRelevanceFacade.save(medIndexRelevance);
                 }
             }
-            if(ListUtil.isNotEmpty(operationCode)) {
+            if(operationCode.size()>0&&operationCode!=null) {
                 medIndexRelevance.setRelevanceType(5);
                 for (String Code : operationCode) {
                     medIndexRelevance.setBehospitalCode(Code);
@@ -783,35 +796,56 @@ public class ConsoleFacade {
                 medIndexRelevanceFacade.save(medIndexRelevance);
             }
         }
-            if(ListUtil.isNotEmpty(operationPathologyCode)) {
+            if(operationPathologyCode.size()>0&&operationPathologyCode!=null) {
                 medIndexRelevance.setRelevanceType(10);
                 for (String Code : operationPathologyCode) {
                     medIndexRelevance.setBehospitalCode(Code);
                     medIndexRelevanceFacade.save(medIndexRelevance);
                 }
             }
-            if(ListUtil.isNotEmpty(operationCode)) {
+            if(ListUtil.isNotEmpty(bacterialCultureList)) {
+                medIndexRelevance.setRelevanceType(11);
+                for (String Code : bacterialCultureList) {
+                    medIndexRelevance.setBehospitalCode(Code);
+                    medIndexRelevanceFacade.save(medIndexRelevance);
+                }
+            }
+            if(antibiosisCode.size()>0&&antibiosisCode!=null) {
+                medIndexRelevance.setRelevanceType(12);
+                for (String Code : antibiosisCode) {
+                    medIndexRelevance.setBehospitalCode(Code);
+                    medIndexRelevanceFacade.save(medIndexRelevance);
+                }
+            }
+            if(ListUtil.isNotEmpty(chemotherapyMalignantTumorsList)) {
+                medIndexRelevance.setRelevanceType(13);
+                for (String Code : chemotherapyMalignantTumorsList) {
+                    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(ListUtil.isNotEmpty(bloodCode)) {
+            if(bloodCode.size()>0&&bloodCode!=null) {
                 medIndexRelevance.setRelevanceType(17);
                 for (String Code : bloodCode) {
                     medIndexRelevance.setBehospitalCode(Code);
                     medIndexRelevanceFacade.save(medIndexRelevance);
                 }
             }
-            if(ListUtil.isNotEmpty(outHospitalCode)) {
+            if(outHospitalCode.size()>0&&outHospitalCode!=null) {
                 medIndexRelevance.setRelevanceType(18);
                 for (String Code : outHospitalCode) {
                     medIndexRelevance.setBehospitalCode(Code);
                     medIndexRelevanceFacade.save(medIndexRelevance);
                 }
             }
-            if(ListUtil.isNotEmpty(rescueCode)) {
+            if(rescueCode.size()>0&&rescueCode!=null) {
                 medIndexRelevance.setRelevanceType(19);
                 for (String Code : rescueCode) {
                     medIndexRelevance.setBehospitalCode(Code);
@@ -819,7 +853,6 @@ public class ConsoleFacade {
                 }
             }
         }
-    }
     /**
      * 两数据相除得到百分比
      * @param i
@@ -908,6 +941,7 @@ public class ConsoleFacade {
         List<String> MRBehospitalCode = new CopyOnWriteArrayList<>();
         List<String> operationBehospitalCode = new CopyOnWriteArrayList<>();
         List<String> pathologyBehospitalCode = new CopyOnWriteArrayList<>();
+        List<String> bacterialCultureCode = new CopyOnWriteArrayList<>();
         List<String> antibiosisBehospitalCode = new CopyOnWriteArrayList<>();
         List<String> chemotherapyMalignantTumorsBehospitalCode = new CopyOnWriteArrayList<>();
         //无首页code
@@ -1001,6 +1035,14 @@ public class ConsoleFacade {
                                         }
                                     }
                                 }
+                                //细菌培养
+                                if (indexName.equals(QualityContent.XJPY_JCJL_FHL) || indexName.equals(QualityContent.QB)) {
+                                    if(!bacterialCultureCode.contains(behospitalCode)){
+                                        if(daItemName.contains(QualityContent.BACTERIAL_CULTURE)){
+                                            bacterialCultureCode.add(behospitalCode);
+                                        }
+                                    }
+                                }
                             }
                         }
                         //获取为长期医嘱或临时医嘱的医嘱
@@ -1034,28 +1076,21 @@ public class ConsoleFacade {
             myPool.shutdown();
 
             if(ListUtil.isEmpty(CTBehospitalCode)){
-         //       map.put("CT",Long.valueOf(0));
                 mapCode.put("CT",null);
             }else {
-        //        map.put("CT",Long.valueOf(CTBehospitalCode.size()));
                 mapCode.put("CT",CTBehospitalCode);
             }
             if(ListUtil.isEmpty(MRBehospitalCode)){
-         //       map.put("MR",Long.valueOf(0));
                 mapCode.put("MR",null);
             }else {
-       //         map.put("MR",Long.valueOf(MRBehospitalCode.size()));
                 mapCode.put("MR",MRBehospitalCode);
             }
             if(ListUtil.isEmpty(operationBehospitalCode)){
-       //         map.put("operation",Long.valueOf(0));
                 mapCode.put("operation",null);
             }else {
-       //         map.put("operation",Long.valueOf(operationBehospitalCode.size()));
                 mapCode.put("operation",operationBehospitalCode);
             }
             if(ListUtil.isEmpty(operationBehospitalCode)||ListUtil.isEmpty(operationPathologyBehospitalCode)){
-        //        map.put("operationPathology",Long.valueOf(0));
                 mapCode.put("operationPathology",null);
             }else {
                 for (String operation : operationBehospitalCode) {
@@ -1063,21 +1098,21 @@ public class ConsoleFacade {
                         operationPathologyBehospitalCode.add(operation);
                     }
                 }
-           //     map.put("operationPathology",Long.valueOf(operationPathologyBehospitalCode.size()));
                 mapCode.put("operationPathology",operationBehospitalCode);
             }
+            if(ListUtil.isEmpty(bacterialCultureCode)){
+                mapCode.put("bacterialCulture",null);
+            }else {
+                mapCode.put("bacterialCulture",bacterialCultureCode);
+            }
             if(ListUtil.isEmpty(antibiosisBehospitalCode)){
-        //        map.put("antibiosis",Long.valueOf(0));
                 mapCode.put("antibiosis",null);
             }else {
-         //       map.put("antibiosis",Long.valueOf(antibiosisBehospitalCode.size()));
                 mapCode.put("antibiosis",antibiosisBehospitalCode);
             }
             if(ListUtil.isEmpty(chemotherapyMalignantTumorsBehospitalCode)){
-          //      map.put("chemotherapyMalignantTumors",Long.valueOf(0));
                 mapCode.put("chemotherapyMalignantTumors",null);
             }else {
-       //         map.put("chemotherapyMalignantTumors",Long.valueOf(chemotherapyMalignantTumorsBehospitalCode.size()));
                 mapCode.put("chemotherapyMalignantTumors",antibiosisBehospitalCode);
             }
             return mapCode;
@@ -2925,6 +2960,7 @@ public class ConsoleFacade {
 
     //指标十八 抢救记录
     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");
         String num = null;
@@ -2934,8 +2970,9 @@ public class ConsoleFacade {
             if(rescueDo<0d){
                 num = null;
             }
+            firMap.put("num",String.valueOf(count));
         };
-        LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
+
         firMap.put("name","患者抢救记录及时完成率");
         firMap.put("notCopiedStr",StringUtils.isEmpty(num) ? "0.00%":(num+"%"));
         retList.add(firMap);
@@ -2944,6 +2981,7 @@ 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;
         if( triggeringRulesMap.containsKey("WardRoundNum") && baseIndex.containsKey("forWorkNum") && !baseIndex.get("forWorkNum").toString().equals("0")){
             double wardRoundDo = currencyCal(baseIndex.get("forWorkNum"), triggeringRulesMap.get("WardRoundNum"));
@@ -2951,8 +2989,8 @@ public class ConsoleFacade {
             if(wardRoundDo<0d){
                 num = null;
             }
+            firMap.put("num",baseIndex.get("forWorkNum").toString());
         };
-        LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
         firMap.put("name","医师查房记录完成率");
         firMap.put("notCopiedStr",StringUtils.isEmpty(num) ? "0.00%":(num+"%"));
         retList.add(firMap);
@@ -2961,6 +2999,7 @@ 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")+"";
         String num = null;
         if( triggeringRulesMap.containsKey("operationRecordNum") && StringUtils.isNotEmpty(operationFeeNum) && ! operationFeeNum.equals("0")){
@@ -2969,17 +3008,18 @@ public class ConsoleFacade {
             if(operationRecordDo<0d){
                 num = null;
             }
+            firMap.put("num",operationFeeNum);
         };
-        LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
         firMap.put("name","手术相关记录完成率");
         firMap.put("notCopiedStr",StringUtils.isEmpty(num) ? "0.00%":(num+"%"));
+
         retList.add(firMap);
         return retList;
     }
 
     //指标十六  临床用血相关记录符合率
     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");
         String num = null;
         if(StringUtils.isNotEmpty(String.valueOf(count)) &&  count != 0d){
@@ -2989,8 +3029,9 @@ public class ConsoleFacade {
             if(bloodDo<0d){
                 num = null;
             }
+            firMap.put("num",String.valueOf(count));
         }
-        LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
+
         firMap.put("name","临床用血相关记录符合率");
         firMap.put("notCopiedStr",StringUtils.isEmpty(num) ? "0.00%":(num+"%"));
         retList.add(firMap);
@@ -3010,6 +3051,7 @@ public class ConsoleFacade {
 
     //指标十九 出院患者病历2日归档
     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");
         String num = null;
@@ -3017,8 +3059,9 @@ public class ConsoleFacade {
             double retNum =count* 100/Double.parseDouble(baseIndex.get("sevenWorkNum").toString());
             double firGradeStr = Double.parseDouble(df.format(retNum));
             num = String.valueOf(firGradeStr);
+            firMap.put("num",baseIndex.get("sevenWorkNum").toString());
         }
-        LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
+
         firMap.put("name","出院患者病历2日归档率");
         firMap.put("notCopiedStr",StringUtils.isEmpty(num) ? "0.00%":(num+"%"));
         retList.add(firMap);
@@ -3109,6 +3152,7 @@ public class ConsoleFacade {
         DecimalFormat df = new DecimalFormat("0.00");
         if(indexName.equals(QualityContent.JJBLL)||indexName.equals(QualityContent.QB)) {
             //指标二十七 -甲级病历率
+        LinkedHashMap<String, String> fouMap = new LinkedHashMap<>();
             Double firRecord = 0d;
             String num4= null;
             if(StringUtils.isNotEmpty( baseIndex.get("forWorkNum").toString())){
@@ -3118,8 +3162,8 @@ 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));
             }
-            LinkedHashMap<String, String> fouMap = new LinkedHashMap<>();
             fouMap.put("name","甲级病历率");
             fouMap.put("notCopiedStr",StringUtils.isEmpty(num4) ? "0.00%":(num4+"%"));
             retList.add(fouMap);
@@ -3131,8 +3175,8 @@ public class ConsoleFacade {
     /**
      * ==============================后台维护===============================
      */
-    //指标十八 抢救记录
-    private  void rescueMethods(List<MedManageParamsDTO> medManageParams,MedIndexResult medIndexResult, List<String> rescueCode){
+    //指标19 抢救记录
+    private  void rescueMethods(List<MedManageParamsDTO> medManageParams,MedIndexResult medIndexResult, Set<String> rescueCode){
         List<MedManageParamsDTO> manageList= new ArrayList<>();
         List<String> rescueDrugList = QualityContent.RESCUEDRUGLIST;
         for (int i = 0; i < medManageParams.size(); i++) {
@@ -3146,7 +3190,6 @@ public class ConsoleFacade {
                 }
             }
         }
-
         //接受抢救的质控病历总数
         double count = manageList.stream().map(MedManageParamsDTO::getBehospitalCode).distinct().count();
         if(StringUtils.isNotEmpty(String.valueOf(count)) &&  count != 0d){
@@ -3154,8 +3197,10 @@ public class ConsoleFacade {
         }
     }
 
-    //指标十六  临床用血相关记录符合率
-    private void bloodMethods(List<MedManageParamsDTO> doctorAdviceList, List<MedManageParamsDTO> medManageParams,MedIndexResult medIndexResult, List<String> bloodCode){
+    //指标17  临床用血相关记录符合率
+    private void bloodMethods(List<MedManageParamsDTO> doctorAdviceList,FilterVO filterVO,MedIndexResult medIndexResult, Set<String> bloodCode){
+        filterVO.setFlagStr("1");
+        List<MedManageParamsDTO> medManageParams = behospitalInfoFacade.getMedManageParams(filterVO);
         Set<String> manageList= new CopyOnWriteArraySet<>();
         List<String> blood_list = QualityContent.BLOODLIST;
         //lis项目存在用血住院病历号
@@ -3187,7 +3232,7 @@ public class ConsoleFacade {
     }
 
 
-    //指标十九 出院患者病历2日归档
+    //指标20 出院患者病历2日归档
     private void getfileSecAmounts(FilterVO filterVO,MedIndexResult medIndexResult){
         QueryWrapper<BehospitalInfo> query = new QueryWrapper<>();
         DecimalFormat df = new DecimalFormat("#0.00");

+ 0 - 1
src/main/java/com/diagbot/mapper/MedPacsResultMapper.java

@@ -17,6 +17,5 @@ import java.util.List;
  */
 public interface MedPacsResultMapper extends BaseMapper<MedPacsResult> {
     public List<MedPacsResultDTO> getMedPacsResults(BehospitalInfo behospitalInfo);
-
     void updateBatchByKey(List<MedPacsResult> list);
 }

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

@@ -724,7 +724,7 @@
         f3.sixWorkNum,
         f4.sevenWorkNum
         from (
-        SELECT  count(*)  as firWorkNum
+        SELECT count(DISTINCT a.behospital_code)  as firWorkNum
         FROM
         med_behospital_info a
         WHERE
@@ -740,7 +740,7 @@
         <if test="endDate != null and endDate != ''">
             <![CDATA[ AND a.leave_hospital_date <= #{lastEndDate}]]>
         </if>)f1,
-            ( SELECT count(*) AS secWorkNum
+            ( SELECT count(DISTINCT a.behospital_code) AS secWorkNum
         FROM
         med_outpatient_info a
         WHERE
@@ -755,10 +755,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>)f2,(
            select
-        count(case when  <![CDATA[m.behospital_date >= #{startDate}]]>  and  <![CDATA[m.behospital_date <= #{endDate}]]>
+        count(DISTINCT case when  <![CDATA[m.behospital_date >= #{startDate}]]>  and  <![CDATA[m.behospital_date <= #{endDate}]]>
         and m.is_placefile = 0 then m.behospital_code else null end) as thrWorkNum,
-        count(case when  <![CDATA[m.leave_hospital_date >= #{startDate}]]>  and  <![CDATA[m.leave_hospital_date <= #{endDate}]]>  and m.is_placefile = 1 then m.behospital_code else null end) as forWorkNum,
-        count(case when  <![CDATA[m.leave_hospital_date >= #{startDate}]]> and <![CDATA[m.leave_hospital_date <= #{endDate}]]> and m.is_placefile = 1 and m.level = '甲' then m.behospital_code else null end) as sixWorkNum
+        count(DISTINCT case when  <![CDATA[m.leave_hospital_date >= #{startDate}]]>  and  <![CDATA[m.leave_hospital_date <= #{endDate}]]>  and m.is_placefile = 1 then m.behospital_code else null end) as forWorkNum,
+        count(DISTINCT case when  <![CDATA[m.leave_hospital_date >= #{startDate}]]> and <![CDATA[m.leave_hospital_date <= #{endDate}]]> and m.is_placefile = 1 and m.level = '甲' then m.behospital_code else null end) as sixWorkNum
            from(
            SELECT DISTINCT a.*,b.level
             FROM
@@ -774,7 +774,7 @@
             AND a.hospital_id = #{hospitalId}
         </if>)m
             )f3,(
-        SELECT  count(*)  as sevenWorkNum
+        SELECT count(DISTINCT a.behospital_code)  as sevenWorkNum
         FROM
         med_behospital_info a
         WHERE