Browse Source

Merge branch 'dev/neo2mysql20210120' into dev/diagnose20210315

gaodm 4 years ago
parent
commit
71f61a7781

+ 7 - 0
doc/004.20210225知识库迁移到Mysql/cdss-core_init.sql

@@ -173,3 +173,10 @@ INSERT INTO `sys_dictionary_info` VALUES ('120', 'N', '1970-01-01 12:00:00', '19
 INSERT INTO `sys_dictionary_info` VALUES ('121', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '实验室检查类别根节点', '实验室检查类别根节点', '1', '408', '页面显示词性');
 INSERT INTO `sys_dictionary_info` VALUES ('121', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '实验室检查类别根节点', '实验室检查类别根节点', '1', '408', '页面显示词性');
 INSERT INTO `sys_dictionary_info` VALUES ('122', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '辅助检查类别根节点', '辅助检查类别根节点', '1', '409', '页面显示词性');
 INSERT INTO `sys_dictionary_info` VALUES ('122', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '辅助检查类别根节点', '辅助检查类别根节点', '1', '409', '页面显示词性');
 INSERT INTO `sys_dictionary_info` VALUES ('123', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '年龄', '年龄', '1', '410', '页面显示词性');
 INSERT INTO `sys_dictionary_info` VALUES ('123', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '年龄', '年龄', '1', '410', '页面显示词性');
+
+UPDATE `sys_permission` SET `id`='46', `is_deleted`='N', `gmt_create`='1970-01-01 12:00:00', `gmt_modified`='1970-01-01 12:00:00', `creator`='0', `modifier`='0', `name`='静态知识标准术语-医学术语检索-新增静态知识', `code`='FUNC000046', `permissionUrl`='/kl/conceptInfo/staticKnowledgeIndexWithoutInfo', `method`='ALL', `descritpion`='静态知识标准术语-医学术语检索-新增静态知识', `type`='0', `remark`=NULL WHERE (`id`='46');
+UPDATE `sys_permission` SET `id`='47', `is_deleted`='N', `gmt_create`='1970-01-01 12:00:00', `gmt_modified`='1970-01-01 12:00:00', `creator`='0', `modifier`='0', `name`='静态知识标准术语-获取静态知识列表', `code`='FUNC000047', `permissionUrl`='/kl/conceptInfo/getPage', `method`='ALL', `descritpion`='静态知识标准术语-获取静态知识列表', `type`='0', `remark`=NULL WHERE (`id`='47');
+UPDATE `sys_permission` SET `id`='48', `is_deleted`='N', `gmt_create`='1970-01-01 12:00:00', `gmt_modified`='1970-01-01 12:00:00', `creator`='0', `modifier`='0', `name`='静态知识标准术语-保存静态知识-新增或修改', `code`='FUNC000048', `permissionUrl`='/kl/conceptInfo/saveOrUpdateRecord', `method`='ALL', `descritpion`='静态知识标准术语-保存静态知识-新增或修改', `type`='0', `remark`=NULL WHERE (`id`='48');
+UPDATE `sys_permission` SET `id`='49', `is_deleted`='N', `gmt_create`='1970-01-01 12:00:00', `gmt_modified`='1970-01-01 12:00:00', `creator`='0', `modifier`='0', `name`='静态知识标准术语-静态知识启用禁用', `code`='FUNC000049', `permissionUrl`='/kl/conceptInfo/changeStatus', `method`='ALL', `descritpion`='静态知识标准术语-静态知识启用禁用', `type`='0', `remark`=NULL WHERE (`id`='49');
+UPDATE `sys_permission` SET `id`='50', `is_deleted`='N', `gmt_create`='1970-01-01 12:00:00', `gmt_modified`='1970-01-01 12:00:00', `creator`='0', `modifier`='0', `name`='静态知识标准术语-静态知识是否存在', `code`='FUNC000050', `permissionUrl`='/kl/conceptInfo/isExist', `method`='ALL', `descritpion`='静态知识标准术语-静态知识是否存在', `type`='0', `remark`=NULL WHERE (`id`='50');
+UPDATE `sys_permission` SET `id`='51', `is_deleted`='N', `gmt_create`='1970-01-01 12:00:00', `gmt_modified`='1970-01-01 12:00:00', `creator`='0', `modifier`='0', `name`='静态知识标准术语-根据术语id获取静态信息', `code`='FUNC000051', `permissionUrl`='/kl/conceptInfo/getRecordById', `method`='ALL', `descritpion`='静态知识标准术语-根据术语id获取静态信息', `type`='0', `remark`=NULL WHERE (`id`='51');

+ 19 - 12
src/main/java/com/diagbot/entity/KlRulePlan.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableId;
 
 
 import java.io.Serializable;
 import java.io.Serializable;
+import java.time.LocalDateTime;
 import java.util.Date;
 import java.util.Date;
 
 
 /**
 /**
@@ -48,6 +49,7 @@ public class KlRulePlan implements Serializable {
      * 修改人,如果为0则表示纪录未修改
      * 修改人,如果为0则表示纪录未修改
      */
      */
     private String modifier;
     private String modifier;
+    private String planCode;
 
 
     /**
     /**
      * 规则类型(1:开单合理性;2:高危;3:危急值;4:其他值提醒;5:其他值提醒输血;6:正常项目重复开立)
      * 规则类型(1:开单合理性;2:高危;3:危急值;4:其他值提醒;5:其他值提醒输血;6:正常项目重复开立)
@@ -71,6 +73,7 @@ public class KlRulePlan implements Serializable {
      */
      */
     private String code;
     private String code;
 
 
+    private Integer firstPlace;
     /**
     /**
      * 显示顺序
      * 显示顺序
      */
      */
@@ -78,6 +81,22 @@ public class KlRulePlan implements Serializable {
 
 
     private String remark;
     private String remark;
 
 
+    public String getPlanCode() {
+        return planCode;
+    }
+
+    public void setPlanCode(String planCode) {
+        this.planCode = planCode;
+    }
+
+    public Integer getFirstPlace() {
+        return firstPlace;
+    }
+
+    public void setFirstPlace(Integer firstPlace) {
+        this.firstPlace = firstPlace;
+    }
+
     public Integer getNumber() {
     public Integer getNumber() {
         return number;
         return number;
     }
     }
@@ -93,7 +112,6 @@ public class KlRulePlan implements Serializable {
     public void setId(Long id) {
     public void setId(Long id) {
         this.id = id;
         this.id = id;
     }
     }
-
     public String getIsDeleted() {
     public String getIsDeleted() {
         return isDeleted;
         return isDeleted;
     }
     }
@@ -101,7 +119,6 @@ public class KlRulePlan implements Serializable {
     public void setIsDeleted(String isDeleted) {
     public void setIsDeleted(String isDeleted) {
         this.isDeleted = isDeleted;
         this.isDeleted = isDeleted;
     }
     }
-
     public Date getGmtCreate() {
     public Date getGmtCreate() {
         return gmtCreate;
         return gmtCreate;
     }
     }
@@ -109,7 +126,6 @@ public class KlRulePlan implements Serializable {
     public void setGmtCreate(Date gmtCreate) {
     public void setGmtCreate(Date gmtCreate) {
         this.gmtCreate = gmtCreate;
         this.gmtCreate = gmtCreate;
     }
     }
-
     public Date getGmtModified() {
     public Date getGmtModified() {
         return gmtModified;
         return gmtModified;
     }
     }
@@ -117,7 +133,6 @@ public class KlRulePlan implements Serializable {
     public void setGmtModified(Date gmtModified) {
     public void setGmtModified(Date gmtModified) {
         this.gmtModified = gmtModified;
         this.gmtModified = gmtModified;
     }
     }
-
     public String getCreator() {
     public String getCreator() {
         return creator;
         return creator;
     }
     }
@@ -125,7 +140,6 @@ public class KlRulePlan implements Serializable {
     public void setCreator(String creator) {
     public void setCreator(String creator) {
         this.creator = creator;
         this.creator = creator;
     }
     }
-
     public String getModifier() {
     public String getModifier() {
         return modifier;
         return modifier;
     }
     }
@@ -133,7 +147,6 @@ public class KlRulePlan implements Serializable {
     public void setModifier(String modifier) {
     public void setModifier(String modifier) {
         this.modifier = modifier;
         this.modifier = modifier;
     }
     }
-
     public Long getRuleType() {
     public Long getRuleType() {
         return ruleType;
         return ruleType;
     }
     }
@@ -141,7 +154,6 @@ public class KlRulePlan implements Serializable {
     public void setRuleType(Long ruleType) {
     public void setRuleType(Long ruleType) {
         this.ruleType = ruleType;
         this.ruleType = ruleType;
     }
     }
-
     public Long getParentId() {
     public Long getParentId() {
         return parentId;
         return parentId;
     }
     }
@@ -149,7 +161,6 @@ public class KlRulePlan implements Serializable {
     public void setParentId(Long parentId) {
     public void setParentId(Long parentId) {
         this.parentId = parentId;
         this.parentId = parentId;
     }
     }
-
     public String getName() {
     public String getName() {
         return name;
         return name;
     }
     }
@@ -157,7 +168,6 @@ public class KlRulePlan implements Serializable {
     public void setName(String name) {
     public void setName(String name) {
         this.name = name;
         this.name = name;
     }
     }
-
     public Integer getType() {
     public Integer getType() {
         return type;
         return type;
     }
     }
@@ -165,7 +175,6 @@ public class KlRulePlan implements Serializable {
     public void setType(Integer type) {
     public void setType(Integer type) {
         this.type = type;
         this.type = type;
     }
     }
-
     public String getCode() {
     public String getCode() {
         return code;
         return code;
     }
     }
@@ -173,7 +182,6 @@ public class KlRulePlan implements Serializable {
     public void setCode(String code) {
     public void setCode(String code) {
         this.code = code;
         this.code = code;
     }
     }
-
     public Integer getOrderNo() {
     public Integer getOrderNo() {
         return orderNo;
         return orderNo;
     }
     }
@@ -181,7 +189,6 @@ public class KlRulePlan implements Serializable {
     public void setOrderNo(Integer orderNo) {
     public void setOrderNo(Integer orderNo) {
         this.orderNo = orderNo;
         this.orderNo = orderNo;
     }
     }
-
     public String getRemark() {
     public String getRemark() {
         return remark;
         return remark;
     }
     }

+ 2 - 1
src/main/java/com/diagbot/enums/TypeEnum.java

@@ -20,7 +20,8 @@ public enum TypeEnum implements KeyedNamed {
     vital(7, "查体"),
     vital(7, "查体"),
     transfusion(8, "输血"),
     transfusion(8, "输血"),
     age(9,"年龄"),
     age(9,"年龄"),
-    group(10, "人群");
+    group(10, "人群"),
+    lisSelf(1, "化验本身");
 
 
     @Setter
     @Setter
     private int key;
     private int key;

+ 1 - 0
src/main/java/com/diagbot/facade/KlConceptFacade.java

@@ -42,6 +42,7 @@ public class KlConceptFacade extends KlConceptServiceImpl {
 
 
         List<KlConcept> concepts = this.list(new QueryWrapper<KlConcept>()
         List<KlConcept> concepts = this.list(new QueryWrapper<KlConcept>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("lib_type", type)
                 .in("lib_name", conceptVO.getNames()));
                 .in("lib_name", conceptVO.getNames()));
 
 
         if (ListUtil.isNotEmpty(concepts)) {
         if (ListUtil.isNotEmpty(concepts)) {

+ 51 - 27
src/main/java/com/diagbot/rule/LisRule.java

@@ -141,32 +141,43 @@ public class LisRule {
         // 条件全部符合
         // 条件全部符合
         if (i == ruleBaseDTOList.size()) {
         if (i == ruleBaseDTOList.size()) {
             if (StringUtil.isNotBlank(lisOtherDTO.getName())) {
             if (StringUtil.isNotBlank(lisOtherDTO.getName())) {
-                // 诊断
-                if (ListUtil.isNotEmpty(lisOtherDTO.getDiseaseMsg())) {
-                    for (String str : lisOtherDTO.getDiseaseMsg()) {
-                        BillMsg billMsg = MsgUtil.getCommonOtherMsg(TypeEnum.lis.getName(), lisOtherDTO.getName(), str, TypeEnum.disease.getName(), lisBean);
-                        otherList.add(billMsg);
+                // 就化验本身一个条件符合
+                if (ListUtil.isEmpty(lisOtherDTO.getDiseaseMsg())
+                        && ListUtil.isEmpty(lisOtherDTO.getGroupMsg())
+                        && ListUtil.isEmpty(lisOtherDTO.getLisMsg())
+                        && ListUtil.isEmpty(lisOtherDTO.getDrugMsg())
+                ) {
+                    BillMsg billMsg = MsgUtil.getCommonOtherMsg(TypeEnum.lis.getName(),
+                            lisOtherDTO.getName(), "", TypeEnum.lisSelf.getName(), lisBean);
+                    otherList.add(billMsg);
+                } else { // 有其他条件符合
+                    // 诊断
+                    if (ListUtil.isNotEmpty(lisOtherDTO.getDiseaseMsg())) {
+                        for (String str : lisOtherDTO.getDiseaseMsg()) {
+                            BillMsg billMsg = MsgUtil.getCommonOtherMsg(TypeEnum.lis.getName(), lisOtherDTO.getName(), str, TypeEnum.disease.getName(), lisBean);
+                            otherList.add(billMsg);
+                        }
                     }
                     }
-                }
-                // 药品
-                if (ListUtil.isNotEmpty(lisOtherDTO.getDrugMsg())) {
-                    for (String str : lisOtherDTO.getDrugMsg()) {
-                        BillMsg billMsg = MsgUtil.getCommonOtherMsg(TypeEnum.lis.getName(), lisOtherDTO.getName(), str, TypeEnum.drug.getName(), lisBean);
-                        otherList.add(billMsg);
+                    // 药品
+                    if (ListUtil.isNotEmpty(lisOtherDTO.getDrugMsg())) {
+                        for (String str : lisOtherDTO.getDrugMsg()) {
+                            BillMsg billMsg = MsgUtil.getCommonOtherMsg(TypeEnum.lis.getName(), lisOtherDTO.getName(), str, TypeEnum.drug.getName(), lisBean);
+                            otherList.add(billMsg);
+                        }
                     }
                     }
-                }
-                // 人群
-                if (ListUtil.isNotEmpty(lisOtherDTO.getGroupMsg())) {
-                    for (String str : lisOtherDTO.getGroupMsg()) {
-                        BillMsg billMsg = MsgUtil.getCommonOtherMsg(TypeEnum.lis.getName(), lisOtherDTO.getName(), str, TypeEnum.group.getName(), lisBean);
-                        otherList.add(billMsg);
+                    // 人群
+                    if (ListUtil.isNotEmpty(lisOtherDTO.getGroupMsg())) {
+                        for (String str : lisOtherDTO.getGroupMsg()) {
+                            BillMsg billMsg = MsgUtil.getCommonOtherMsg(TypeEnum.lis.getName(), lisOtherDTO.getName(), str, TypeEnum.group.getName(), lisBean);
+                            otherList.add(billMsg);
+                        }
                     }
                     }
-                }
-                // 化验
-                if (ListUtil.isNotEmpty(lisOtherDTO.getLisMsg())) {
-                    for (String str : lisOtherDTO.getLisMsg()) {
-                        BillMsg billMsg = MsgUtil.getCommonOtherMsg(TypeEnum.lis.getName(), lisOtherDTO.getName(), str, TypeEnum.lis.getName(), lisBean);
-                        otherList.add(billMsg);
+                    // 化验
+                    if (ListUtil.isNotEmpty(lisOtherDTO.getLisMsg())) {
+                        for (String str : lisOtherDTO.getLisMsg()) {
+                            BillMsg billMsg = MsgUtil.getCommonOtherMsg(TypeEnum.lis.getName(), lisOtherDTO.getName(), str, TypeEnum.lis.getName(), lisBean);
+                            otherList.add(billMsg);
+                        }
                     }
                     }
                 }
                 }
             }
             }
@@ -304,10 +315,23 @@ public class LisRule {
                 Map map = null;
                 Map map = null;
                 switch (LexiconEnum.getEnum(ruleBaseDTO.getBaseLibType())) {
                 switch (LexiconEnum.getEnum(ruleBaseDTO.getBaseLibType())) {
                     case LisSubName: // 化验细项
                     case LisSubName: // 化验细项
-                        map = CoreUtil.compareLis(ruleBaseDTO, lisBean);
-                        if ((Boolean) map.get("flag") == true) {
-                            i++;
-                            msg = (String) map.get("msg");
+                        if (ruleBaseDTO.getBaseLibName().equals(lisBean.getUniqueName())) {
+                            // 化验自身 【第一个】
+                            map = CoreUtil.compareLis(ruleBaseDTO, lisBean);
+                            if (CoreUtil.getMapFlag(map)) {
+                                i++;
+                                msg = (String) map.get("msg");
+                            } else {
+                                break;
+                            }
+                        } else {
+                            // 其他化验
+                            map = CoreUtil.compareLis(ruleBaseDTO, wordCrfDTO.getLis());
+                            if (CoreUtil.getMapFlag(map)) {
+                                i++;
+                            } else {
+                                break;
+                            }
                         }
                         }
                         break;
                         break;
                     case Group: // 人群
                     case Group: // 人群

+ 5 - 3
src/main/java/com/diagbot/util/CoreUtil.java

@@ -3,6 +3,7 @@ package com.diagbot.util;
 import com.diagbot.biz.push.entity.Item;
 import com.diagbot.biz.push.entity.Item;
 import com.diagbot.biz.push.entity.Lis;
 import com.diagbot.biz.push.entity.Lis;
 import com.diagbot.dto.RuleBaseDTO;
 import com.diagbot.dto.RuleBaseDTO;
+import com.diagbot.enums.LexiconEnum;
 import com.diagbot.model.entity.BodyPart;
 import com.diagbot.model.entity.BodyPart;
 import com.diagbot.model.entity.Clinical;
 import com.diagbot.model.entity.Clinical;
 import com.diagbot.model.entity.Negative;
 import com.diagbot.model.entity.Negative;
@@ -355,13 +356,14 @@ public class CoreUtil {
             map.put("flag", flag);
             map.put("flag", flag);
             return map;
             return map;
         }
         }
-        if (StringUtil.isBlank(ruleBaseDTO.getBaseMaxValue()) && StringUtil.isBlank(ruleBaseDTO.getBaseMinValue())) {
+        // if (StringUtil.isBlank(ruleBaseDTO.getBaseMaxValue()) && StringUtil.isBlank(ruleBaseDTO.getBaseMinValue())) {
+        // 如果是体格检查结果,就用临床表现比较;如果是体格检查项目,用体征数值比较
+        if (ruleBaseDTO.getBaseLibType().equals(LexiconEnum.VitalResult.getKey())) {
             // 体征名称比较(例如:喉头水肿)
             // 体征名称比较(例如:喉头水肿)
             for (Clinical clinical : clinicals) {
             for (Clinical clinical : clinicals) {
                 if (ruleBaseDTO.getBaseLibName().equals(clinical.getStandName())) {
                 if (ruleBaseDTO.getBaseLibName().equals(clinical.getStandName())) {
-                    map.put("msg", clinical.getName());
+                    msgList.add(clinical.getName());
                     flag = true;
                     flag = true;
-                    break;
                 }
                 }
             }
             }
         } else {
         } else {

+ 3 - 0
src/main/java/com/diagbot/util/MsgUtil.java

@@ -86,6 +86,9 @@ public class MsgUtil {
                     case lis: // 化验
                     case lis: // 化验
                         msg = String.format("该患者%s,%s,请留意", content, name);
                         msg = String.format("该患者%s,%s,请留意", content, name);
                         break;
                         break;
+                    case lisSelf: // 就化验本身一个条件
+                        msg = String.format("该患者%s,请留意", content);
+                        break;
                 }
                 }
                 billMsg.setType(type);
                 billMsg.setType(type);
                 billMsg.setOrderName(lis.getName());
                 billMsg.setOrderName(lis.getName());

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

@@ -15,4 +15,6 @@ public class KlRuleMenuVO {
      * 规则类型(1:开单合理性;2:高危;3:危急值;4:其他值提醒;5:其他值提醒输血;6:正常项目重复开立)
      * 规则类型(1:开单合理性;2:高危;3:危急值;4:其他值提醒;5:其他值提醒输血;6:正常项目重复开立)
      */
      */
     private Integer ruleType;
     private Integer ruleType;
+
+    private String planCode;
 }
 }

+ 5 - 0
src/main/resources/mapper/KlRulePlanMapper.xml

@@ -10,12 +10,14 @@
         <result column="gmt_modified" property="gmtModified"/>
         <result column="gmt_modified" property="gmtModified"/>
         <result column="creator" property="creator"/>
         <result column="creator" property="creator"/>
         <result column="modifier" property="modifier"/>
         <result column="modifier" property="modifier"/>
+        <result column="plan_code" property="planCode"/>
         <result column="rule_type" property="ruleType"/>
         <result column="rule_type" property="ruleType"/>
         <result column="parent_id" property="parentId"/>
         <result column="parent_id" property="parentId"/>
         <result column="name" property="name"/>
         <result column="name" property="name"/>
         <result column="type" property="type"/>
         <result column="type" property="type"/>
         <result column="number" property="number"/>
         <result column="number" property="number"/>
         <result column="code" property="code"/>
         <result column="code" property="code"/>
+        <result column="first_place" property="firstPlace"/>
         <result column="order_no" property="orderNo"/>
         <result column="order_no" property="orderNo"/>
         <result column="remark" property="remark"/>
         <result column="remark" property="remark"/>
     </resultMap>
     </resultMap>
@@ -24,5 +26,8 @@
         <if test="ruleType!=null">
         <if test="ruleType!=null">
             and rule_type = #{ruleType}
             and rule_type = #{ruleType}
         </if>
         </if>
+        <if test="planCode!=null and planCode !=''">
+            and plan_code = #{planCode}
+        </if>
     </select>
     </select>
 </mapper>
 </mapper>