Bladeren bron

就诊类型规则匹配

0027005599 2 jaren geleden
bovenliggende
commit
6312287298

+ 5 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/Constant.java

@@ -107,6 +107,11 @@ public class Constant {
      * 门诊
      */
     public static final String TREAMENT_TYPE_OUTPATIENT = "2";
+
+    /**
+     * 门诊/住院
+     */
+    public static final String TREAMENT_TYPE_HOSP_OUTPATIENT = "3";
     /**
      * 应用本身数据库
      */

+ 17 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/common/CommonUtil.java

@@ -13,6 +13,7 @@ import org.springframework.data.redis.core.RedisTemplate;
 
 import java.time.LocalDate;
 import java.time.Period;
+import java.util.Arrays;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -187,6 +188,22 @@ public class CommonUtil {
         }
     }
 
+    /**
+     * 根据就诊类型获取对应的医保规则就诊类型数据
+     * @param treatmentType
+     * @return
+     */
+    public static List<String> getVisitTypeList(String treatmentType){
+        List<String> treatmentTypeList = null;
+        if(Constant.TREAMENT_TYPE_HOSP.equals(treatmentType)){
+            treatmentTypeList = Arrays.asList(Constant.TREAMENT_TYPE_HOSP, Constant.TREAMENT_TYPE_HOSP_OUTPATIENT);
+        }else if(Constant.TREAMENT_TYPE_OUTPATIENT.equals(treatmentType)){
+            treatmentTypeList = Arrays.asList(Constant.TREAMENT_TYPE_OUTPATIENT, Constant.TREAMENT_TYPE_HOSP_OUTPATIENT);
+        }
+        return treatmentTypeList;
+    }
+
+
 
     public static void main(String[] args) {
 //        String day = "2023-11-09 19:10:11";

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

@@ -62,8 +62,8 @@ public class AfterIncidentDetailLog implements Serializable {
 	/**就诊类别;1:住院 2:门诊*/
 	@Excel(name = "就诊类别;1:住院 2:门诊", width = 15)
     @ApiModelProperty(value = "就诊类别;1:住院 2:门诊")
-    @TableField("visit_type")
-    private java.lang.String visit_type;
+    @JSONField(name = "visit_type")
+    private java.lang.String visitType;
 	/**科室编码*/
 	@Excel(name = "科室编码", width = 15)
     @ApiModelProperty(value = "科室编码")

+ 1 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/job/AfterWaringLogJob.java

@@ -159,7 +159,7 @@ public class AfterWaringLogJob implements Job {
 //            afterIncidentDetailLog.setSingle_dose_unit();
             afterIncidentDetailLog.setVisitNo(masterAdmissionBill.getZyh());
             afterIncidentDetailLog.setRecipeNo(masterAdmissionBill.getRecipeNo());
-            afterIncidentDetailLog.setVisit_type(Constant.TREAMENT_TYPE_HOSP);
+            afterIncidentDetailLog.setVisitType(Constant.TREAMENT_TYPE_HOSP);
             afterIncidentDetailLog.setState(Constant.WATING);
             String projectType = CommonUtil.getProjectType(afterIncidentDetailLog.getMedicalProjectCode());
             afterIncidentDetailLog.setProjectType(projectType);

+ 1 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/job/AfterWaringLogTestJob.java

@@ -135,7 +135,7 @@ public class AfterWaringLogTestJob{
 //            afterIncidentDetailLog.setSingle_dose_unit();
             afterIncidentDetailLog.setVisitNo(masterAdmissionBill.getZyh());
             afterIncidentDetailLog.setRecipeNo(masterAdmissionBill.getRecipeNo());
-            afterIncidentDetailLog.setVisit_type(Constant.TREAMENT_TYPE_HOSP);
+            afterIncidentDetailLog.setVisitType(Constant.TREAMENT_TYPE_HOSP);
             afterIncidentDetailLog.setState(Constant.WATING);
             String projectType = CommonUtil.getProjectType(afterIncidentDetailLog.getMedicalProjectCode());
             afterIncidentDetailLog.setProjectType(projectType);

+ 1 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/job/OutpatientAuditLogJob.java

@@ -125,7 +125,7 @@ public class OutpatientAuditLogJob implements Job {
 //            afterIncidentDetailLog.setSingle_dose_unit();
             afterIncidentDetailLog.setVisitNo(outpatientSettleBill.getVisitNo());
             afterIncidentDetailLog.setRecipeNo(outpatientSettleBill.getRecipeNo());
-            afterIncidentDetailLog.setVisit_type(Constant.TREAMENT_TYPE_HOSP);
+            afterIncidentDetailLog.setVisitType(Constant.TREAMENT_TYPE_OUTPATIENT);
             afterIncidentDetailLog.setState(Constant.WATING);
             String projectType = CommonUtil.getProjectType(afterIncidentDetailLog.getMedicalProjectCode());
             afterIncidentDetailLog.setProjectType(projectType);

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

@@ -170,7 +170,7 @@ public class HospGetDataToRuleEngine {
         Integer days = DateTimeUtil.getDayByAgeStr(patientAge);
         midIncidentWarningVO.setPatientAgeDays(days);
         midIncidentWarningVO.setTotoal_amount(totalAmount);
-
+        List<String> treatmentTypeList = CommonUtil.getVisitTypeList(midIncidentWarningVO.getVisit_type());
         List<String> medicalDiagnoseStrList = new ArrayList<>();
         List<DiagnosesVO> diagnosesVOList = new ArrayList<>();
         if (CollectionUtil.isNotEmpty(diagnoseList)) {
@@ -196,7 +196,7 @@ public class HospGetDataToRuleEngine {
             List<Future> futureList = new ArrayList();
             for (Map<String, Object> itemMap : detailMapList) {
                 itemMap.put(Constant.MEDICAL_DIAGNOSE_CODE_KEY, medicalDiagnoseStrList);
-                List<MedicalInsRuleProject> medicalInsRuleProjectList = medicalInsRuleProjectService.getRuleProjectByMedicalProjectCode(itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY).toString(), callScenarioList);
+                List<MedicalInsRuleProject> medicalInsRuleProjectList = medicalInsRuleProjectService.getRuleProjectByMedicalProjectCode(itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY).toString(), callScenarioList, treatmentTypeList);
                 if (CollectionUtil.isEmpty(medicalInsRuleProjectList)) {
                     log.error("项目编码未匹配到对应的医保规则:{} 在规则库数据库中未检索到数据", itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY));
                 } else {

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

@@ -16,6 +16,7 @@ import org.jeecg.common.system.vo.DictModel;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.modules.medical.Constant;
 import org.jeecg.modules.medical.SystemEventAttrConstant;
+import org.jeecg.modules.medical.common.CommonUtil;
 import org.jeecg.modules.medical.entity.AdvanceWarningAudit;
 import org.jeecg.modules.medical.entity.AdvanceWarningVO;
 import org.jeecg.modules.medical.entity.AdviceDetailsVO;
@@ -648,6 +649,7 @@ public class RuleEngine {
             insertLog(midIncidentWarningVO);
             //callScenario 1=事前  2=事后  3=事前/事后 4=事中 5=事后/事中
             List<String> callScenarioList = Arrays.asList("4", "5");
+            List<String> treatmentTypeList = CommonUtil.getVisitTypeList(midIncidentWarningVO.getVisit_type());
             boolean sendFlag = false;
             List<Map<String,Object>> detailMapList = new ArrayList<>();
             for(AdviceDetailsVO adviceDetailsVO : midIncidentWarningVO.getAdvice_details()){
@@ -658,7 +660,7 @@ public class RuleEngine {
 
             for (Map<String, Object> itemMap : detailMapList) {
                 itemMap.put(Constant.MEDICAL_DIAGNOSE_CODE_KEY, medicalDiagnoseStrList);
-                List<MedicalInsRuleProject> medicalInsRuleProjectList = medicalInsRuleProjectService.getRuleProjectByMedicalProjectCode(itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY).toString(), callScenarioList);
+                List<MedicalInsRuleProject> medicalInsRuleProjectList = medicalInsRuleProjectService.getRuleProjectByMedicalProjectCode(itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY).toString(), callScenarioList, treatmentTypeList);
                 if (CollectionUtil.isEmpty(medicalInsRuleProjectList)) {
                     log.error("项目编码未匹配到对应的医保规则:{} 在规则库数据库中未检索到数据", itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY));
                 } else {
@@ -755,9 +757,10 @@ public class RuleEngine {
             midIncidentAudit.setInterfName(intefName);
             //callScenario 1=事前  2=事后  3=事前/事后 4=事中 5=事后/事中
             List<String> callScenarioList = Arrays.asList("4", "5");
+            List<String> treatmentTypeList = CommonUtil.getVisitTypeList(midIncidentWarningVO.getVisit_type());
             boolean sendFlag = false;
             for (Map<String, Object> itemMap : itemList) {
-                List<MedicalInsRuleProject> medicalInsRuleProjectList = medicalInsRuleProjectService.getRuleProjectByMedicalProjectCode(itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY).toString(), callScenarioList);
+                List<MedicalInsRuleProject> medicalInsRuleProjectList = medicalInsRuleProjectService.getRuleProjectByMedicalProjectCode(itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY).toString(), callScenarioList, treatmentTypeList);
                 if (CollectionUtil.isEmpty(medicalInsRuleProjectList)) {
                     log.error("项目编码未匹配到对应的医保规则:{} 在规则库数据库中未检索到数据", itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY));
                 } else {
@@ -827,7 +830,8 @@ public class RuleEngine {
             JSONObject itemMap = JSON.parseObject(jsonStr);
             //callScenario 1=事前  2=事后  3=事前/事后 4=事中 5=事后/事中
             List<String> callScenarioList = Arrays.asList("2", "5", "3");
-            List<MedicalInsRuleProject> medicalInsRuleProjectList = medicalInsRuleProjectService.getRuleProjectByMedicalProjectCode(itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY).toString(), callScenarioList);
+            List<String> treatmentTypeList = CommonUtil.getVisitTypeList(afterwardsAudit.getTreatmentType());
+            List<MedicalInsRuleProject> medicalInsRuleProjectList = medicalInsRuleProjectService.getRuleProjectByMedicalProjectCode(itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY).toString(), callScenarioList, treatmentTypeList);
             if (CollectionUtil.isEmpty(medicalInsRuleProjectList)) {
                 log.error("项目编码未匹配到对应的医保规则:{} 在规则库数据库中未检索到数据", itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY));
             } else {

+ 1 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/IMedicalInsRuleProjectService.java

@@ -39,6 +39,6 @@ public interface IMedicalInsRuleProjectService extends IService<MedicalInsRulePr
      * @param medicalProjectCode
      * @return
      */
-    List<MedicalInsRuleProject> getRuleProjectByMedicalProjectCode(String medicalProjectCode,List<String> callScenarioList);
+    List<MedicalInsRuleProject> getRuleProjectByMedicalProjectCode(String medicalProjectCode,List<String> callScenarioList,List<String> treatmentTypeList);
 
 }

+ 5 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/impl/MedicalInsRuleProjectServiceImpl.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.medical.service.impl;
 
+import cn.hutool.core.collection.CollectionUtil;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -626,11 +627,14 @@ public class MedicalInsRuleProjectServiceImpl extends ServiceImpl<MedicalInsRule
     }
 
     @Override
-    public List<MedicalInsRuleProject> getRuleProjectByMedicalProjectCode(String medicalProjectCode, List<String> callScenarioList) {
+    public List<MedicalInsRuleProject> getRuleProjectByMedicalProjectCode(String medicalProjectCode, List<String> callScenarioList, List<String> treatmentTypeList) {
         QueryWrapper<MedicalInsRuleProject> queryWrapper = new QueryWrapper<MedicalInsRuleProject>();
         queryWrapper.eq("STATE", Constant.EFF_STATE);
         queryWrapper.isNull("search_type");
         queryWrapper.in("call_scenario", callScenarioList);
+        if (CollectionUtil.isNotEmpty(treatmentTypeList)) {
+            queryWrapper.in("treatment_type", treatmentTypeList);
+        }
         queryWrapper.last(" and INSTR('" + medicalProjectCode + "',project_code)=1");
 
         return this.list(queryWrapper);

File diff suppressed because it is too large
+ 57 - 1
jeecg-module-system/jeecg-system-start/src/test/java/org/jeecg/TestMain.java


Some files were not shown because too many files changed in this diff