浏览代码

统计指标优化

0027005599 2 年之前
父节点
当前提交
582df054b1

+ 2 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/entity/AfterwardsAudit.java

@@ -61,6 +61,8 @@ public class AfterwardsAudit implements Serializable {
 	@Excel(name = "主诊医师编码", width = 15)
     @ApiModelProperty(value = "主诊医师编码")
     private java.lang.String doctorId;
+
+    private String doctorLeve;
 	/**个人编号*/
 	@Excel(name = "个人编号", width = 15)
     @ApiModelProperty(value = "个人编号")

+ 2 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/entity/AfterwardsAuditDetail.java

@@ -93,6 +93,8 @@ public class AfterwardsAuditDetail implements Serializable {
 	@Excel(name = "主诊医师编码", width = 15)
     @ApiModelProperty(value = "主诊医师编码")
     private java.lang.String doctorId;
+
+    private String doctorLevel;
 	/**个人编号*/
 	@Excel(name = "个人编号", width = 15)
     @ApiModelProperty(value = "个人编号")

+ 1 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/entity/MidIncidentAuditDetail.java

@@ -91,6 +91,7 @@ public class MidIncidentAuditDetail implements Serializable {
 	@Excel(name = "主诊医师编码", width = 15)
     @ApiModelProperty(value = "主诊医师编码")
     private java.lang.String doctorId;
+    private String doctorLevel;
 	/**个人编号*/
 	@Excel(name = "个人编号", width = 15)
     @ApiModelProperty(value = "个人编号")

+ 7 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/ruleengine/FactorEnchangeFactory.java

@@ -422,7 +422,13 @@ public class FactorEnchangeFactory {
 
     public String getDesc(MedicalInsRuleInfo medicalInsRuleInfo, Map<String, Object> itemMap) {
         String desc = medicalInsRuleInfo.getViolationDesc();
-        Object descObject = redisTemplate.opsForHash().get(Constant.PROJECT_VOLIDATION_DESC_KEY + medicalInsRuleInfo.getId(), itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY).toString());
+        Object descObject = null;
+        if(!"2".equals(medicalInsRuleInfo.getSearchType())) {
+            descObject = redisTemplate.opsForHash().get(Constant.PROJECT_VOLIDATION_DESC_KEY + medicalInsRuleInfo.getId(), itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY).toString());
+        }else{
+            Integer ruleProjectId = (Integer) itemMap.get(SystemEventAttrConstant.MEDICAL_INS_RULE_PROJECT_ID);
+            descObject = redisTemplate.opsForHash().get(Constant.PROJECT_VOLIDATION_DESC_KEY + medicalInsRuleInfo.getId(), ruleProjectId.toString());
+        }
         log.info("ruleId:{} code:{} desc:{}", medicalInsRuleInfo.getId(), itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY), descObject);
         if (null != descObject) {
             desc = descObject.toString();

+ 40 - 2
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/ruleengine/RuleEngine.java

@@ -6,8 +6,9 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.extern.slf4j.Slf4j;
-import net.sf.json.JSONArray;
 import org.apache.commons.lang.StringUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.constant.CommonConstant;
@@ -214,7 +215,7 @@ public class RuleEngine {
         interfRuleAttrList = ruleAttrList.stream().collect(Collectors.groupingBy(RuleAttr::getInterfName));
         initFactor();
         initRuleDaysSet();
-
+        initMedicalProjectDesc();
     }
 
     @PostConstruct
@@ -355,6 +356,42 @@ public class RuleEngine {
         }
     }
 
+    public void initMedicalProjectDesc(){
+        long count = medicalInsRuleProjectService.lambdaQuery().eq(MedicalInsRuleProject::getState,Constant.EFF_STATE).count();
+        if(count>0){
+            long pageSize = count/1000;
+            long modNum = count%1000;
+            if(modNum>0) {
+                pageSize = pageSize + 1;
+            }
+            Map<Integer,Map<String,String>> ruleAndDescMap = new HashMap<>();
+            for(long index=1;index<=pageSize;index++){
+                IPage page = new Page(index, 1000);
+                List<MedicalInsRuleProject> medicalInsRuleProjectList = medicalInsRuleProjectService.lambdaQuery().eq(MedicalInsRuleProject::getState, Constant.EFF_STATE).page(page).getRecords();
+                Map<String,String> descMap = null;
+                for(MedicalInsRuleProject medicalInsRuleProject : medicalInsRuleProjectList){
+                    MedicalInsRuleInfo medicalInsRuleInfo = allMedicalMap.get(medicalInsRuleProject.getMedicalInsRuleInfoId());
+                    if(null != medicalInsRuleInfo ) {
+                        if(ruleAndDescMap.containsKey(medicalInsRuleProject.getMedicalInsRuleInfoId())) {
+                            descMap = ruleAndDescMap.get(medicalInsRuleProject.getMedicalInsRuleInfoId());
+                            descMap.put(medicalInsRuleProject.getId().toString() , medicalInsRuleProject.getViolationDesc());
+                        }else{
+                            descMap = new HashMap<>();
+                            descMap.put(medicalInsRuleProject.getId().toString() , medicalInsRuleProject.getViolationDesc());
+                            ruleAndDescMap.put(medicalInsRuleProject.getMedicalInsRuleInfoId(), descMap);
+                        }
+
+                    }
+                }
+            }
+            for(Map.Entry<Integer, Map<String, String>> ruleEntry: ruleAndDescMap.entrySet()){
+                Integer ruleId = ruleEntry.getKey();
+                Map<String,String> ruleMap = ruleEntry.getValue();
+                redisTemplate.opsForHash().putAll(Constant.PROJECT_VOLIDATION_DESC_KEY + ruleId, ruleMap);
+            }
+        }
+    }
+
 
     public void genItemCodeAndRuleIdMapTest(String medicalProjectCode, AfterwardsAuditDetail afterwardsAuditDetail, List<MedicalInsRuleInfo> medicalInsRuleInfoList, Map<Integer, MedicalInsRuleInfo> medicalMap, Map<String, Boolean> codeDataMap) {
         try {
@@ -1134,6 +1171,7 @@ public class RuleEngine {
         afterwardsAudit.setPatientGender(afterIncidentLog.getPatientGender());
         afterwardsAudit.setPatientBirthday(afterIncidentLog.getPatientBirthday());
         afterwardsAudit.setHisid(afterIncidentLog.getHisid());
+
 //        afterwardsAudit.setBedNumber(afterIncidentLog.);
         afterwardsAuditService.save(afterwardsAudit);
         if (StringUtils.isNotBlank(afterIncidentLog.getDiagnoses())) {