Procházet zdrojové kódy

术语停用诊断依据校验

wangfeng před 4 roky
rodič
revize
b551cc1c7f

+ 144 - 0
cdssman-service/src/main/java/com/diagbot/entity/KlDiagnose.java

@@ -0,0 +1,144 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 诊断依据信息表
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2021-03-31
+ */
+public class KlDiagnose implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private LocalDateTime gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private LocalDateTime gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 疾病概念id
+     */
+    private Long conceptId;
+
+    /**
+     * 描述
+     */
+    private String description;
+
+    /**
+     * 启用状态(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 LocalDateTime getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(LocalDateTime gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+    public LocalDateTime getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(LocalDateTime 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 Long getConceptId() {
+        return conceptId;
+    }
+
+    public void setConceptId(Long conceptId) {
+        this.conceptId = conceptId;
+    }
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    @Override
+    public String toString() {
+        return "KlDiagnose{" +
+            "id=" + id +
+            ", isDeleted=" + isDeleted +
+            ", gmtCreate=" + gmtCreate +
+            ", gmtModified=" + gmtModified +
+            ", creator=" + creator +
+            ", modifier=" + modifier +
+            ", conceptId=" + conceptId +
+            ", description=" + description +
+            ", status=" + status +
+        "}";
+    }
+}

+ 274 - 0
cdssman-service/src/main/java/com/diagbot/entity/KlDiagnoseBase.java

@@ -0,0 +1,274 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 诊断依据基础表
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2021-03-31
+ */
+public class KlDiagnoseBase implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private LocalDateTime gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private LocalDateTime gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 提示概念id
+     */
+    private Long conceptId;
+
+    /**
+     * 描述
+     */
+    private String description;
+
+    /**
+     * 基础规则类型(1:等于术语本身;2:存在比较;3:主诉现病史正则;4:既往史正则)
+     */
+    private Integer type;
+
+    /**
+     * 最小域比较符
+     */
+    private String minOperator;
+
+    /**
+     * 最小域值
+     */
+    private String minValue;
+
+    /**
+     * 最小域单位
+     */
+    private String minUnit;
+
+    /**
+     * 最大域比较符
+     */
+    private String maxOperator;
+
+    /**
+     * 最大域值
+     */
+    private String maxValue;
+
+    /**
+     * 最大域单位
+     */
+    private String maxUnit;
+
+    /**
+     * 等于域比较符
+     */
+    private String eqOperator;
+
+    /**
+     * 等于域值
+     */
+    private String eqValue;
+
+    /**
+     * 等于域单位
+     */
+    private String eqUnit;
+
+    /**
+     * 启用状态(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 LocalDateTime getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(LocalDateTime gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+    public LocalDateTime getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(LocalDateTime 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 Long getConceptId() {
+        return conceptId;
+    }
+
+    public void setConceptId(Long conceptId) {
+        this.conceptId = conceptId;
+    }
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+    public String getMinOperator() {
+        return minOperator;
+    }
+
+    public void setMinOperator(String minOperator) {
+        this.minOperator = minOperator;
+    }
+    public String getMinValue() {
+        return minValue;
+    }
+
+    public void setMinValue(String minValue) {
+        this.minValue = minValue;
+    }
+    public String getMinUnit() {
+        return minUnit;
+    }
+
+    public void setMinUnit(String minUnit) {
+        this.minUnit = minUnit;
+    }
+    public String getMaxOperator() {
+        return maxOperator;
+    }
+
+    public void setMaxOperator(String maxOperator) {
+        this.maxOperator = maxOperator;
+    }
+    public String getMaxValue() {
+        return maxValue;
+    }
+
+    public void setMaxValue(String maxValue) {
+        this.maxValue = maxValue;
+    }
+    public String getMaxUnit() {
+        return maxUnit;
+    }
+
+    public void setMaxUnit(String maxUnit) {
+        this.maxUnit = maxUnit;
+    }
+    public String getEqOperator() {
+        return eqOperator;
+    }
+
+    public void setEqOperator(String eqOperator) {
+        this.eqOperator = eqOperator;
+    }
+    public String getEqValue() {
+        return eqValue;
+    }
+
+    public void setEqValue(String eqValue) {
+        this.eqValue = eqValue;
+    }
+    public String getEqUnit() {
+        return eqUnit;
+    }
+
+    public void setEqUnit(String eqUnit) {
+        this.eqUnit = eqUnit;
+    }
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    @Override
+    public String toString() {
+        return "KlDiagnoseBase{" +
+            "id=" + id +
+            ", isDeleted=" + isDeleted +
+            ", gmtCreate=" + gmtCreate +
+            ", gmtModified=" + gmtModified +
+            ", creator=" + creator +
+            ", modifier=" + modifier +
+            ", conceptId=" + conceptId +
+            ", description=" + description +
+            ", type=" + type +
+            ", minOperator=" + minOperator +
+            ", minValue=" + minValue +
+            ", minUnit=" + minUnit +
+            ", maxOperator=" + maxOperator +
+            ", maxValue=" + maxValue +
+            ", maxUnit=" + maxUnit +
+            ", eqOperator=" + eqOperator +
+            ", eqValue=" + eqValue +
+            ", eqUnit=" + eqUnit +
+            ", status=" + status +
+        "}";
+    }
+}

+ 18 - 0
cdssman-service/src/main/java/com/diagbot/facade/KlConceptFacade.java

@@ -12,6 +12,8 @@ import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.KlConcept;
 import com.diagbot.entity.KlConceptCommon;
 import com.diagbot.entity.KlConceptStatic;
+import com.diagbot.entity.KlDiagnose;
+import com.diagbot.entity.KlDiagnoseBase;
 import com.diagbot.entity.KlLexicon;
 import com.diagbot.entity.KlLibraryInfo;
 import com.diagbot.entity.KlRelation;
@@ -75,6 +77,10 @@ public class KlConceptFacade extends KlConceptServiceImpl {
     KlRuleFacade klRuleFacade;
     @Autowired
     KlRuleBaseFacade klRuleBaseFacade;
+    @Autowired
+    KlDiagnoseFacade klDiagnoseFacade;
+    @Autowired
+    KlDiagnoseBaseFacade klDiagnoseBaseFacade;
 
 
     /**
@@ -406,6 +412,18 @@ public class KlConceptFacade extends KlConceptServiceImpl {
             if (ruleBasesum > 0) {
                 throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该医学标准术语与规则维护明细存在关系!");
             }
+            //kl_diagnose
+            int diagnosesum = klDiagnoseFacade.count(new QueryWrapper<KlDiagnose>().eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .eq("concept_id", klConceptSatarOrdisaVO.getConceptId()));
+            if (diagnosesum > 0) {
+                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该医学标准术语与诊断依据维护存在关系!");
+            }
+            //kl_diagnose_base
+            int diagnoseBasesum = klDiagnoseBaseFacade.count(new QueryWrapper<KlDiagnoseBase>().eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .eq("concept_id", klConceptSatarOrdisaVO.getConceptId()));
+            if (diagnoseBasesum > 0) {
+                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该医学标准术语与诊断依据维护明细存在关系!");
+            }
         }
         UpdateWrapper<KlConcept> klLibraryUpdate = new UpdateWrapper<>();
         klLibraryUpdate.eq("is_deleted", IsDeleteEnum.N.getKey())

+ 15 - 0
cdssman-service/src/main/java/com/diagbot/facade/KlDiagnoseBaseFacade.java

@@ -0,0 +1,15 @@
+package com.diagbot.facade;
+
+import com.diagbot.entity.KlDiagnoseBase;
+import com.diagbot.service.impl.KlDiagnoseBaseServiceImpl;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-03-31 15:36
+ */
+@Component
+public class KlDiagnoseBaseFacade extends KlDiagnoseBaseServiceImpl {
+
+}

+ 3 - 1
cdssman-service/src/main/java/com/diagbot/facade/KlDiagnoseFacade.java

@@ -7,6 +7,8 @@ import com.diagbot.dto.DiagnosesFindDTO;
 import com.diagbot.dto.KlDiagnoseInfoDTO;
 import com.diagbot.dto.KlDiagnoseTypeDTO;
 import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.KlDiagnose;
+import com.diagbot.service.impl.KlDiagnoseServiceImpl;
 import com.diagbot.util.RespDTOUtil;
 import com.diagbot.util.UserUtils;
 import com.diagbot.vo.DiagnosesFindVO;
@@ -28,7 +30,7 @@ import java.util.stream.Collectors;
  * @date 2021-03-23 16:54
  */
 @Component
-public class KlDiagnoseFacade {
+public class KlDiagnoseFacade extends KlDiagnoseServiceImpl {
     @Autowired
     CdssCoreClient cdssCoreClient;
     @Autowired

+ 16 - 0
cdssman-service/src/main/java/com/diagbot/mapper/KlDiagnoseBaseMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.KlDiagnoseBase;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 诊断依据基础表 Mapper 接口
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2021-03-31
+ */
+public interface KlDiagnoseBaseMapper extends BaseMapper<KlDiagnoseBase> {
+
+}

+ 16 - 0
cdssman-service/src/main/java/com/diagbot/mapper/KlDiagnoseMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.KlDiagnose;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 诊断依据信息表 Mapper 接口
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2021-03-31
+ */
+public interface KlDiagnoseMapper extends BaseMapper<KlDiagnose> {
+
+}

+ 16 - 0
cdssman-service/src/main/java/com/diagbot/service/KlDiagnoseBaseService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.KlDiagnoseBase;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 诊断依据基础表 服务类
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2021-03-31
+ */
+public interface KlDiagnoseBaseService extends IService<KlDiagnoseBase> {
+
+}

+ 16 - 0
cdssman-service/src/main/java/com/diagbot/service/KlDiagnoseService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.KlDiagnose;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 诊断依据信息表 服务类
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2021-03-31
+ */
+public interface KlDiagnoseService extends IService<KlDiagnose> {
+
+}

+ 22 - 0
cdssman-service/src/main/java/com/diagbot/service/impl/KlDiagnoseBaseServiceImpl.java

@@ -0,0 +1,22 @@
+package com.diagbot.service.impl;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.diagbot.entity.KlDiagnoseBase;
+import com.diagbot.mapper.KlDiagnoseBaseMapper;
+import com.diagbot.service.KlDiagnoseBaseService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 诊断依据基础表 服务实现类
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2021-03-31
+ */
+@Service
+@DS("med")
+public class KlDiagnoseBaseServiceImpl extends ServiceImpl<KlDiagnoseBaseMapper, KlDiagnoseBase> implements KlDiagnoseBaseService {
+
+}

+ 22 - 0
cdssman-service/src/main/java/com/diagbot/service/impl/KlDiagnoseServiceImpl.java

@@ -0,0 +1,22 @@
+package com.diagbot.service.impl;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.diagbot.entity.KlDiagnose;
+import com.diagbot.mapper.KlDiagnoseMapper;
+import com.diagbot.service.KlDiagnoseService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 诊断依据信息表 服务实现类
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2021-03-31
+ */
+@Service
+@DS("med")
+public class KlDiagnoseServiceImpl extends ServiceImpl<KlDiagnoseMapper, KlDiagnose> implements KlDiagnoseService {
+
+}

+ 28 - 0
cdssman-service/src/main/resources/mapper/KlDiagnoseBaseMapper.xml

@@ -0,0 +1,28 @@
+<?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.KlDiagnoseBaseMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.KlDiagnoseBase">
+        <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="concept_id" property="conceptId" />
+        <result column="description" property="description" />
+        <result column="type" property="type" />
+        <result column="min_operator" property="minOperator" />
+        <result column="min_value" property="minValue" />
+        <result column="min_unit" property="minUnit" />
+        <result column="max_operator" property="maxOperator" />
+        <result column="max_value" property="maxValue" />
+        <result column="max_unit" property="maxUnit" />
+        <result column="eq_operator" property="eqOperator" />
+        <result column="eq_value" property="eqValue" />
+        <result column="eq_unit" property="eqUnit" />
+        <result column="status" property="status" />
+    </resultMap>
+
+</mapper>

+ 18 - 0
cdssman-service/src/main/resources/mapper/KlDiagnoseMapper.xml

@@ -0,0 +1,18 @@
+<?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.KlDiagnoseMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.KlDiagnose">
+        <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="concept_id" property="conceptId" />
+        <result column="description" property="description" />
+        <result column="status" property="status" />
+    </resultMap>
+
+</mapper>