소스 검색

标准术语维护-保存时更新静态知识和术语关联

zhaops 4 년 전
부모
커밋
85c9f8d318

+ 183 - 0
src/main/java/com/diagbot/entity/ConceptInfo.java

@@ -0,0 +1,183 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 静态知识标准术语表
+ * </p>
+ *
+ * @author zhaops
+ * @since 2020-08-18
+ */
+@TableName("graph_concept_info")
+public class ConceptInfo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 标准术语
+     */
+    private String name;
+
+    /**
+     * 词性
+     */
+    private String type;
+
+    /**
+     * 临床路径名称
+     */
+    private String clinicalPathwayName;
+
+    /**
+     * 注意事项名称
+     */
+    private String noticeName;
+
+    /**
+     * 启用状态(0:禁用,1:启用)
+     */
+    private Integer status;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+
+    public Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getClinicalPathwayName() {
+        return clinicalPathwayName;
+    }
+
+    public void setClinicalPathwayName(String clinicalPathwayName) {
+        this.clinicalPathwayName = clinicalPathwayName;
+    }
+
+    public String getNoticeName() {
+        return noticeName;
+    }
+
+    public void setNoticeName(String noticeName) {
+        this.noticeName = noticeName;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    @Override
+    public String toString() {
+        return "ConceptInfo{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", name=" + name +
+                ", type=" + type +
+                ", clinicalPathwayName=" + clinicalPathwayName +
+                ", noticeName=" + noticeName +
+                ", status=" + status +
+                "}";
+    }
+}

+ 36 - 0
src/main/java/com/diagbot/facade/ConceptInfoFacade.java

@@ -0,0 +1,36 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.diagbot.entity.ConceptInfo;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.service.ConceptInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/12/28 11:47
+ */
+@Component
+public class ConceptInfoFacade {
+    @Autowired
+    ConceptInfoService conceptInfoService;
+
+    /**
+     * 标准术语名称修改
+     *
+     * @param oldName
+     * @param newName
+     * @return
+     */
+    public Boolean updateName(String oldName, String newName, String labelType) {
+        UpdateWrapper<ConceptInfo> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("name", oldName)
+                .eq("type", labelType)
+                .set("name", newName);
+        conceptInfoService.update(updateWrapper);
+        return true;
+    }
+}

+ 17 - 0
src/main/java/com/diagbot/facade/DeptConfigFacade.java

@@ -1,6 +1,7 @@
 package com.diagbot.facade;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.diagbot.entity.DeptConfig;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.DeptConfigService;
@@ -37,4 +38,20 @@ public class DeptConfigFacade {
             return false;
         }
     }
+
+    /**
+     * 标准术语名称修改
+     *
+     * @param oldName
+     * @param newName
+     * @return
+     */
+    public Boolean updateUniqueName(String oldName, String newName) {
+        UpdateWrapper<DeptConfig> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("unique_name", oldName)
+                .set("unique_name", newName);
+        deptConfigService.update(updateWrapper);
+        return true;
+    }
 }

+ 17 - 0
src/main/java/com/diagbot/facade/DiseaseConfigFacade.java

@@ -1,6 +1,7 @@
 package com.diagbot.facade;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.diagbot.entity.DiseaseConfig;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.DiseaseConfigService;
@@ -37,4 +38,20 @@ public class DiseaseConfigFacade {
             return false;
         }
     }
+
+    /**
+     * 标准术语名称修改
+     *
+     * @param oldName
+     * @param newName
+     * @return
+     */
+    public Boolean updateUniqueName(String oldName, String newName) {
+        UpdateWrapper<DiseaseConfig> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("unique_name", oldName)
+                .set("unique_name", newName);
+        diseaseConfigService.update(updateWrapper);
+        return true;
+    }
 }

+ 18 - 0
src/main/java/com/diagbot/facade/DrugConfigFacade.java

@@ -1,6 +1,8 @@
 package com.diagbot.facade;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.diagbot.entity.DiseaseConfig;
 import com.diagbot.entity.DrugConfig;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.DrugConfigService;
@@ -37,4 +39,20 @@ public class DrugConfigFacade {
             return false;
         }
     }
+
+    /**
+     * 标准术语名称修改
+     *
+     * @param oldName
+     * @param newName
+     * @return
+     */
+    public Boolean updateUniqueName(String oldName, String newName) {
+        UpdateWrapper<DrugConfig> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("unique_name", oldName)
+                .set("unique_name", newName);
+        drugConfigService.update(updateWrapper);
+        return true;
+    }
 }

+ 57 - 0
src/main/java/com/diagbot/facade/EntityInfoFacade.java

@@ -48,6 +48,8 @@ public class EntityInfoFacade {
     OperationConfigFacade operationConfigFacade;
     @Autowired
     PacsConfigFacade pacsConfigFacade;
+    @Autowired
+    ConceptInfoFacade conceptInfoFacade;
 
     @Autowired
     YiBaoDiseaseNameRepository yiBaoDiseaseNameRepository;
@@ -358,6 +360,11 @@ public class EntityInfoFacade {
             entityInfo.setIs_kl(0);
         }
 
+        //修改同时修改关联名称(静态知识、术语关联、开单合理性规则)
+        if (entityInfo.getId() != null) {
+            updateRelatedName(entityInfo);
+        }
+
         switch (entityInfo.getLabelType()) {
             case "医保疾病名称":
                 String ageRange = "";
@@ -696,4 +703,54 @@ public class EntityInfoFacade {
         }
         return true;
     }
+
+    public Boolean updateRelatedName(EntityInfo entityInfo) {
+        if (entityInfo.getId() == null) {
+            return true;
+        }
+        EntityInfo existEntity = getById(entityInfo.getId());
+        if (existEntity == null) {
+            return true;
+        }
+        //名称未修改
+        if (entityInfo.getName().equals(existEntity.getName())) {
+            return true;
+        }
+
+        //更新静态知识名称
+        if (existEntity.getIs_kl().equals(1)) {
+            conceptInfoFacade.updateName(existEntity.getName(), entityInfo.getName(), existEntity.getLabelType());
+        }
+
+        //更新术语关联名称
+        //医保疾病名称、药品通用名称、实验室检查套餐名、实验室检查名称、辅助检查名称、辅助检查子项目名称、科室、医保手术和操作名称、输血
+        switch (entityInfo.getLabelType()) {
+            case "医保疾病名称":
+                diseaseConfigFacade.updateUniqueName(existEntity.getName(), entityInfo.getName());
+                break;
+            case "药品通用名称":
+                drugConfigFacade.updateUniqueName(existEntity.getName(), entityInfo.getName());
+                break;
+            case "实验室检查套餐名":
+            case "实验室检查名称":
+                lisConfigFacade.updateUniqueName(existEntity.getName(), entityInfo.getName());
+                break;
+            case "辅助检查名称":
+            case "辅助检查子项目名称":
+                pacsConfigFacade.updateUniqueName(existEntity.getName(), entityInfo.getName());
+                break;
+            case "科室":
+                deptConfigFacade.updateUniqueName(existEntity.getName(), entityInfo.getName());
+                break;
+            case "医保手术和操作名称":
+                operationConfigFacade.updateUniqueName(existEntity.getName(), entityInfo.getName());
+                break;
+            default:
+                break;
+        }
+
+        //更新开单合理性开单项和禁忌条件名称
+        //图谱数据,保存时直接更新,无需二次更新
+        return true;
+    }
 }

+ 17 - 0
src/main/java/com/diagbot/facade/LisConfigFacade.java

@@ -1,6 +1,7 @@
 package com.diagbot.facade;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.diagbot.entity.LisConfig;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.LisConfigServiceImpl;
@@ -87,4 +88,20 @@ public class LisConfigFacade extends LisConfigServiceImpl {
             return false;
         }
     }
+
+    /**
+     * 标准术语名称修改
+     *
+     * @param oldName
+     * @param newName
+     * @return
+     */
+    public Boolean updateUniqueName(String oldName, String newName) {
+        UpdateWrapper<LisConfig> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("unique_name", oldName)
+                .set("unique_name", newName);
+        this.update(updateWrapper);
+        return true;
+    }
 }

+ 17 - 0
src/main/java/com/diagbot/facade/OperationConfigFacade.java

@@ -1,6 +1,7 @@
 package com.diagbot.facade;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.diagbot.entity.OperationConfig;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.OperationConfigService;
@@ -37,4 +38,20 @@ public class OperationConfigFacade {
             return false;
         }
     }
+
+    /**
+     * 标准术语名称修改
+     *
+     * @param oldName
+     * @param newName
+     * @return
+     */
+    public Boolean updateUniqueName(String oldName, String newName) {
+        UpdateWrapper<OperationConfig> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("unique_name", oldName)
+                .set("unique_name", newName);
+        operationConfigService.update(updateWrapper);
+        return true;
+    }
 }

+ 18 - 1
src/main/java/com/diagbot/facade/PacsConfigFacade.java

@@ -1,6 +1,7 @@
 package com.diagbot.facade;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.diagbot.entity.PacsConfig;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.PacsConfigServiceImpl;
@@ -69,4 +70,20 @@ public class PacsConfigFacade extends PacsConfigServiceImpl {
             return false;
         }
     }
-}
+
+    /**
+     * 标准术语名称修改
+     *
+     * @param oldName
+     * @param newName
+     * @return
+     */
+    public Boolean updateUniqueName(String oldName, String newName) {
+        UpdateWrapper<PacsConfig> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("unique_name", oldName)
+                .set("unique_name", newName);
+        this.update(updateWrapper);
+        return true;
+    }
+}

+ 15 - 0
src/main/java/com/diagbot/mapper/ConceptInfoMapper.java

@@ -0,0 +1,15 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.entity.ConceptInfo;
+
+/**
+ * <p>
+ * 静态知识标准术语表 Mapper 接口
+ * </p>
+ *
+ * @author zhaops
+ * @since 2020-08-18
+ */
+public interface ConceptInfoMapper extends BaseMapper<ConceptInfo> {
+}

+ 15 - 0
src/main/java/com/diagbot/service/ConceptInfoService.java

@@ -0,0 +1,15 @@
+package com.diagbot.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.entity.ConceptInfo;
+
+/**
+ * <p>
+ * 静态知识标准术语表 服务类
+ * </p>
+ *
+ * @author zhaops
+ * @since 2020-08-18
+ */
+public interface ConceptInfoService extends IService<ConceptInfo> {
+}

+ 19 - 0
src/main/java/com/diagbot/service/impl/ConceptInfoServiceImpl.java

@@ -0,0 +1,19 @@
+package com.diagbot.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.entity.ConceptInfo;
+import com.diagbot.mapper.ConceptInfoMapper;
+import com.diagbot.service.ConceptInfoService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 静态知识标准术语表 服务实现类
+ * </p>
+ *
+ * @author zhaops
+ * @since 2020-08-18
+ */
+@Service
+public class ConceptInfoServiceImpl extends ServiceImpl<ConceptInfoMapper, ConceptInfo> implements ConceptInfoService {
+}

+ 19 - 0
src/main/resources/mapper/ConceptInfoMapper.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.diagbot.mapper.ConceptInfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.ConceptInfo">
+        <id column="id" property="id" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_modified" property="gmtModified" />
+        <result column="creator" property="creator" />
+        <result column="modifier" property="modifier" />
+        <result column="name" property="name" />
+        <result column="type" property="type" />
+        <result column="clinical_pathway_name" property="clinicalPathwayName" />
+        <result column="notice_name" property="noticeName" />
+    </resultMap>
+
+</mapper>