zhanghang 4 年之前
父節點
當前提交
f99c154054
共有 2 個文件被更改,包括 128 次插入20 次删除
  1. 5 3
      src/main/java/com/diagbot/enums/QualityContent.java
  2. 123 17
      src/main/java/com/diagbot/facade/ConsoleFacade.java

+ 5 - 3
src/main/java/com/diagbot/enums/QualityContent.java

@@ -76,7 +76,10 @@ public class QualityContent {
     public static final String LAST = "前一次";
     public static final String COUNTERMAND = "取消";
     public static final String PAUSE = "暂停";
-    public static final String PATHOLOGY = "病理";
+    /**
+     * 病理判断
+     */
+    public static String[][] BL_LIST = {{"病理"}};
 
     /**
      * 医嘱CT相关
@@ -88,8 +91,7 @@ public class QualityContent {
      * 医嘱手术相关
      */
     public static String[][] OPERATION_LIST={
-            {"手术"},
-            {"手术A"}
+            {"手术"}
     };
     public static String[][] OPERATION_ARG={
             {"非手术"},

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

@@ -22,6 +22,7 @@ import com.google.common.collect.Lists;
 import io.github.lvyahui8.spring.aggregate.facade.DataBeanAggregateQueryFacade;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.ibatis.annotations.Param;
+import org.apache.poi.ss.formula.functions.Na;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
@@ -448,21 +449,26 @@ public class ConsoleFacade {
             }
             if (QualityContent.NEED_MEDICAL_ADVICE.contains(indexName)) {
                 filterVO.setFlagStr("2");
-                List<MedManageParamsDTO> doctorAdviceMedManageParams = behospitalInfoFacade.getMedManageParams(filterVO);
-                Map<String, Integer> operationPathologyNumMap = getOperationPathologyNum(filterVO, doctorAdviceMedManageParams);
+     //           List<MedManageParamsDTO> doctorAdviceMedManageParams = behospitalInfoFacade.getMedManageParams(filterVO);
+     //           Map<String, Integer> operationPathologyNumMap = getOperationPathologyNum(filterVO, doctorAdviceMedManageParams);
+                Map<String, Long> adviceNum = getAdviceNum(filterVO);
                 //手术人数
                 Long operationFeeNum = selectOperationNumMap.get("operationFee");
-                Integer operationNum = operationPathologyNumMap.get(QualityContent.NO_RECORD_OPERATION);
-                operationFeeNum = operationFeeNum + operationNum;
-                Map<String, Long> longMap = getCTNum(doctorAdviceMedManageParams);
+          //      Integer operationNum = operationPathologyNumMap.get(QualityContent.NO_RECORD_OPERATION);
+                Long operation = adviceNum.get("operation");
+                operationFeeNum = operationFeeNum + operation;
+         //       Map<String, Long> longMap = getCTNum(doctorAdviceMedManageParams);
                 //CT人数
-                Long CTNum = longMap.get("CT");
+         //       Long CTNum = longMap.get("CT");
+                Long CTNum = adviceNum.get("CT");
                 //MR人数
-                Long MRNum = longMap.get("MR");
+          //      Long MRNum = longMap.get("MR");
+                Long MRNum = adviceNum.get("MR");
                 //手术病理人数
                 Long operationPathologyFeeNum = selectOperationNumMap.get("operationPathologyFee");
-                Integer operationPathologyNum = operationPathologyNumMap.get(QualityContent.NO_RECORD_OPERATION_PATHOLOGY);
-                operationPathologyFeeNum = operationPathologyFeeNum + operationPathologyNum;
+         //       Integer operationPathologyNum = operationPathologyNumMap.get(QualityContent.NO_RECORD_OPERATION_PATHOLOGY);
+                Long operationPathology = adviceNum.get("operationPathology");
+                operationPathologyFeeNum = operationPathologyFeeNum + operationPathology;
                 //手术记录完成率
                 //手术完成人数为
                 if (indexName.equals(QualityContent.SSJL_24H_WCL)||indexName.equals(QualityContent.QB)) {
@@ -587,7 +593,7 @@ public class ConsoleFacade {
     /**
      * 医嘱表判断无病案首页是否为手术患者
      */
-    public List<String> getOperationNum(FilterVO filterVO,List<MedManageParamsDTO> doctorAdviceMedManageParams){
+/*    public List<String> getOperationNum(FilterVO filterVO,List<MedManageParamsDTO> doctorAdviceMedManageParams){
         List<String> behospitalCodeList = adviceVerify(filterVO);
         ArrayList<String> stringList = new ArrayList<>();
         if(ListUtil.isNotEmpty(behospitalCodeList)&&behospitalCodeList.size()>0) {
@@ -613,11 +619,11 @@ public class ConsoleFacade {
             }
             }
         return stringList;
-    }
+    }*/
     /**
      * 医嘱表判断无病案首页为手术患者的前提下判断是否为病理手术患者
      */
-    public Map<String,Integer> getOperationPathologyNum(FilterVO filterVO,List<MedManageParamsDTO> doctorAdviceMedManageParams){
+/*    public Map<String,Integer> getOperationPathologyNum(FilterVO filterVO,List<MedManageParamsDTO> doctorAdviceMedManageParams){
         Map<String, Integer> map = new HashMap<>();
         List<String> operationBehospitalCode = getOperationNum(filterVO, doctorAdviceMedManageParams);
         int operationPathologyNum=0;
@@ -626,7 +632,8 @@ public class ConsoleFacade {
             for (MedManageParamsDTO doctorAdviceMedManage : doctorAdviceMedManageParams) {
                 if (doctorAdviceMedManage.getBehospitalCode().equals(behospitalCode)) {
                     String Name = doctorAdviceMedManage.getDaItemName();
-                    if (Name.contains(QualityContent.PATHOLOGY)) {
+                    Boolean condition = stairCondition(Name, QualityContent.BL_LIST);
+                    if (condition) {
                         operationPathologyNum++;
                         break ;
                     }
@@ -636,7 +643,7 @@ public class ConsoleFacade {
         map.put(QualityContent.NO_RECORD_OPERATION_PATHOLOGY,operationPathologyNum);
         map.put(QualityContent.NO_RECORD_OPERATION,operationNum);
         return map;
-    }
+    }*/
 
 
     /**
@@ -685,11 +692,111 @@ public class ConsoleFacade {
         }
         return false;
     }
+    /**
+     * 遍历医嘱信息存入相关数据
+     */
+    public Map<String,Long> getAdviceNum(FilterVO filterVO){
+        Map map = new HashMap<String,Integer>();
+        List<String> CTBehospitalCode = new ArrayList<>();
+        List<String> operationPathologyBehospitalCode = new ArrayList<>();
+        List<String> MRBehospitalCode = new ArrayList<>();
+        List<String> operationBehospitalCode = new ArrayList<>();
+        List<String> pathologyBehospitalCode = new ArrayList<>();
+        List<String> behospitalCodeList = adviceVerify(filterVO);
+        List<MedManageParamsDTO> doctorAdviceMedManageParams = behospitalInfoFacade.getMedManageParams(filterVO);
+        for (MedManageParamsDTO adviceMedManageParam : doctorAdviceMedManageParams) {
+            String daItemName = adviceMedManageParam.getDaItemName();
+            String behospitalCode = adviceMedManageParam.getBehospitalCode();
+            String doctorAdviceType = adviceMedManageParam.getDoctorAdviceType();
+            //得到与手术相关
+            if(StringUtil.isNotEmpty(daItemName)) {
+                //当code存在于无首页code集合中
+                if (behospitalCodeList.contains(behospitalCode)) {
+                    //code也不存在于以保存的code集合
+                    if(!operationBehospitalCode.contains(behospitalCode)){
+                    String[][] operationList = QualityContent.OPERATION_LIST;
+                    Boolean stair = stairCondition(daItemName, operationList);
+                    if(stair) {
+                        String[][] operationArg = QualityContent.OPERATION_ARG;
+                        Boolean levelCondition = secondLevelCondition(daItemName, operationArg);
+                        if (levelCondition) {
+                            operationBehospitalCode.add(behospitalCode);
+                        }
+                    }
+                  }
+                    if(!pathologyBehospitalCode.contains(behospitalCode)){
+                        Boolean condition = stairCondition(daItemName, QualityContent.BL_LIST);
+                        if (condition) {
+                            pathologyBehospitalCode.add(behospitalCode);
+                        }
+                    }
 
+                }
+                    //得到为临时医嘱
+                    if (StringUtil.isNotEmpty(doctorAdviceType)) {
+                        if (doctorAdviceType.equals(QualityContent.STAT_ORDER)) {
+                            if (!CTBehospitalCode.contains(behospitalCode)) {
+                                //筛选与CT相关
+                                //一级条件
+                                String[][] ctList = QualityContent.CT_LIST;
+                                Boolean stair = stairCondition(daItemName, ctList);
+                                if (stair) {
+                                    String[][] ctRegulation = QualityContent.CT_REGULATION;
+                                    Boolean levelCondition = secondLevelCondition(daItemName, ctRegulation);
+                                    if (levelCondition) {
+                                        CTBehospitalCode.add(behospitalCode);
+                                    }
+                                }
+                            }
+                            //与MR相关
+                            if (!MRBehospitalCode.contains(behospitalCode)) {
+                                String[][] mrList = QualityContent.MR_LIST;
+                                Boolean stair = stairCondition(daItemName, mrList);
+                                if (stair) {
+                                    String[][] ctRegulation = QualityContent.CT_REGULATION;
+                                    Boolean levelCondition = secondLevelCondition(daItemName, ctRegulation);
+                                    if (levelCondition) {
+                                        MRBehospitalCode.add(behospitalCode);
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+
+        for (String operation : operationBehospitalCode) {
+            if(pathologyBehospitalCode.contains(operation)){
+                operationPathologyBehospitalCode.add(operation);
+            }
+        }
+        if(ListUtil.isEmpty(CTBehospitalCode)){
+            map.put("CT",Long.valueOf(0));
+        }else {
+            map.put("CT",Long.valueOf(CTBehospitalCode.size()));
+        }
+        if(ListUtil.isEmpty(MRBehospitalCode)){
+            map.put("MR",Long.valueOf(0));
+        }else {
+            map.put("MR",Long.valueOf(MRBehospitalCode.size()));
+        }
+        if(ListUtil.isEmpty(operationBehospitalCode)){
+            map.put("MR",Long.valueOf(0));
+        }else {
+            map.put("operation",Long.valueOf(operationBehospitalCode.size()));
+        }
+        if(ListUtil.isEmpty(operationPathologyBehospitalCode)){
+            map.put("operationPathology",Long.valueOf(0));
+        }else {
+            map.put("operationPathology",Long.valueOf(operationPathologyBehospitalCode.size()));
+        }
+
+        return map;
+    }
     /**
      * 获取CT/MRI人数
      */
-    public Map<String,Long> getCTNum( List<MedManageParamsDTO> doctorAdviceMedManageParams){
+   /* public Map<String,Long> getCTNum( List<MedManageParamsDTO> doctorAdviceMedManageParams){
         Map<String, Long> map = new HashMap<>();
         List<String> codeList = new ArrayList<>();
         ArrayList<String> codeMri = new ArrayList<>();
@@ -715,7 +822,6 @@ public class ConsoleFacade {
                         }
                     }
                 }
-
         }
 
         for (MedManageParamsDTO doctorAdviceMedManageParam : doctorAdviceMedManageParams) {
@@ -753,7 +859,7 @@ public class ConsoleFacade {
         }
 
         return map;
-    }
+    }*/
 
     /**
      * 获取无病案首页抗菌药物使用人数