瀏覽代碼

初始化代码

攻心小虫 1 年之前
當前提交
939a50c155
共有 100 個文件被更改,包括 5089 次插入0 次删除
  1. 26 0
      .gitignore
  2. 288 0
      pom.xml
  3. 32 0
      src/main/java/com/diagbot/CdssCoreApplication.java
  4. 89 0
      src/main/java/com/diagbot/aggregate/DictionaryAggregate.java
  5. 174 0
      src/main/java/com/diagbot/aggregate/IndicationAggregate.java
  6. 123 0
      src/main/java/com/diagbot/aggregate/IndicationTestAggregate.java
  7. 118 0
      src/main/java/com/diagbot/aggregate/PushDisAggregate.java
  8. 119 0
      src/main/java/com/diagbot/aggregate/PushNewAggregate.java
  9. 376 0
      src/main/java/com/diagbot/aggregate/RuleAggregate.java
  10. 24 0
      src/main/java/com/diagbot/client/CRFServiceClient.java
  11. 17 0
      src/main/java/com/diagbot/client/IcssPush5ServiceClient.java
  12. 26 0
      src/main/java/com/diagbot/client/IcssPushServiceClient.java
  13. 27 0
      src/main/java/com/diagbot/client/PushNewServiceClient.java
  14. 27 0
      src/main/java/com/diagbot/client/StandConvertNewServiceClient.java
  15. 27 0
      src/main/java/com/diagbot/client/StandConvertServiceClient.java
  16. 18 0
      src/main/java/com/diagbot/client/hystrix/CRFServiceHystrix.java
  17. 11 0
      src/main/java/com/diagbot/client/hystrix/IcssPush5ServiceHystrix.java
  18. 19 0
      src/main/java/com/diagbot/client/hystrix/IcssPushServiceHystrix.java
  19. 25 0
      src/main/java/com/diagbot/client/hystrix/PushNewServiceHystrix.java
  20. 27 0
      src/main/java/com/diagbot/client/hystrix/StandConvertNewServiceHystrix.java
  21. 27 0
      src/main/java/com/diagbot/client/hystrix/StandConvertServiceHystrix.java
  22. 78 0
      src/main/java/com/diagbot/config/CacheDeleteInit.java
  23. 30 0
      src/main/java/com/diagbot/config/CorsConfiguer.java
  24. 73 0
      src/main/java/com/diagbot/config/KryoRedisSerializer.java
  25. 39 0
      src/main/java/com/diagbot/config/MybatisPlusConfigurer.java
  26. 190 0
      src/main/java/com/diagbot/config/RedisConfigurer.java
  27. 72 0
      src/main/java/com/diagbot/config/SnnpyJackson2JsonRedisSerializer.java
  28. 68 0
      src/main/java/com/diagbot/config/SwaggerConfigurer.java
  29. 223 0
      src/main/java/com/diagbot/config/mybatisLike/AbstractLikeSqlConverter.java
  30. 79 0
      src/main/java/com/diagbot/config/mybatisLike/MapLikeSqlConverter.java
  31. 160 0
      src/main/java/com/diagbot/config/mybatisLike/MybatisLikeSqlInterceptor.java
  32. 28 0
      src/main/java/com/diagbot/config/mybatisLike/ObjectLikeSqlConverter.java
  33. 26 0
      src/main/java/com/diagbot/dto/AllRulesDTO.java
  34. 19 0
      src/main/java/com/diagbot/dto/AnesthesiaInfoDTO.java
  35. 82 0
      src/main/java/com/diagbot/dto/BaseDiagnoseDTO.java
  36. 84 0
      src/main/java/com/diagbot/dto/BaseRegulationDTO.java
  37. 33 0
      src/main/java/com/diagbot/dto/BillDTO.java
  38. 44 0
      src/main/java/com/diagbot/dto/BillMsg.java
  39. 18 0
      src/main/java/com/diagbot/dto/Cn2SpellDTO.java
  40. 18 0
      src/main/java/com/diagbot/dto/Cn2SpellDetailDTO.java
  41. 36 0
      src/main/java/com/diagbot/dto/ConceptDTO.java
  42. 43 0
      src/main/java/com/diagbot/dto/ConceptDetailDTO.java
  43. 17 0
      src/main/java/com/diagbot/dto/ConceptScaleDTO.java
  44. 107 0
      src/main/java/com/diagbot/dto/ConceptScaleDetailDTO.java
  45. 18 0
      src/main/java/com/diagbot/dto/ConceptScaleSubDTO.java
  46. 16 0
      src/main/java/com/diagbot/dto/CustomDictionaryDTO.java
  47. 60 0
      src/main/java/com/diagbot/dto/DefaultExportDTO.java
  48. 20 0
      src/main/java/com/diagbot/dto/DeptInfoDTO.java
  49. 17 0
      src/main/java/com/diagbot/dto/DiagnoseDTO.java
  50. 19 0
      src/main/java/com/diagbot/dto/DiagnoseRecordDTO.java
  51. 18 0
      src/main/java/com/diagbot/dto/DiagnosesFindDTO.java
  52. 17 0
      src/main/java/com/diagbot/dto/DictionaryDTO.java
  53. 48 0
      src/main/java/com/diagbot/dto/DictionaryInfoDTO.java
  54. 15 0
      src/main/java/com/diagbot/dto/DiseaseIndexDTO.java
  55. 24 0
      src/main/java/com/diagbot/dto/DiseaseInfoDTO.java
  56. 17 0
      src/main/java/com/diagbot/dto/DiseaseItemDTO.java
  57. 33 0
      src/main/java/com/diagbot/dto/DrugInfoDTO.java
  58. 15 0
      src/main/java/com/diagbot/dto/DrugNameDTO.java
  59. 18 0
      src/main/java/com/diagbot/dto/DrugTypeCacheDTO.java
  60. 18 0
      src/main/java/com/diagbot/dto/DrugTypeDTO.java
  61. 24 0
      src/main/java/com/diagbot/dto/ExportDescDTO.java
  62. 44 0
      src/main/java/com/diagbot/dto/ExportDiagnoseDTO.java
  63. 24 0
      src/main/java/com/diagbot/dto/ExportDiagnoseNameDTO.java
  64. 18 0
      src/main/java/com/diagbot/dto/GatherDTO.java
  65. 48 0
      src/main/java/com/diagbot/dto/GetAllForRelationDTO.java
  66. 32 0
      src/main/java/com/diagbot/dto/IndexBatchDTO.java
  67. 24 0
      src/main/java/com/diagbot/dto/IndexDTO.java
  68. 27 0
      src/main/java/com/diagbot/dto/IndicationDTO.java
  69. 42 0
      src/main/java/com/diagbot/dto/IndicationExportDTO.java
  70. 33 0
      src/main/java/com/diagbot/dto/IndicationNewExportDTO.java
  71. 43 0
      src/main/java/com/diagbot/dto/KlConceptDetailDTO.java
  72. 109 0
      src/main/java/com/diagbot/dto/KlConceptScaleDTO.java
  73. 67 0
      src/main/java/com/diagbot/dto/KlConceptStaticDTO.java
  74. 93 0
      src/main/java/com/diagbot/dto/KlDiagnoseByIdDTO.java
  75. 33 0
      src/main/java/com/diagbot/dto/KlDiagnoseGroupDTO.java
  76. 48 0
      src/main/java/com/diagbot/dto/KlDiagnoseInfoDTO.java
  77. 19 0
      src/main/java/com/diagbot/dto/KlDiagnoseLibNameDTO.java
  78. 89 0
      src/main/java/com/diagbot/dto/KlDiagnoseRecordDTO.java
  79. 39 0
      src/main/java/com/diagbot/dto/KlDiagnoseRecordDetailDTO.java
  80. 29 0
      src/main/java/com/diagbot/dto/KlDiagnoseTypeDTO.java
  81. 43 0
      src/main/java/com/diagbot/dto/KlRuleByIdDTO.java
  82. 27 0
      src/main/java/com/diagbot/dto/KlRuleByIdParDTO.java
  83. 32 0
      src/main/java/com/diagbot/dto/KlRuleByIdSubDTO.java
  84. 65 0
      src/main/java/com/diagbot/dto/KlRuleInfoDTO.java
  85. 12 0
      src/main/java/com/diagbot/dto/KlRulePlanDTO.java
  86. 49 0
      src/main/java/com/diagbot/dto/KlScaleByIdDTO.java
  87. 83 0
      src/main/java/com/diagbot/dto/KlScaleDetailDTO.java
  88. 43 0
      src/main/java/com/diagbot/dto/KlScaleInfoDTO.java
  89. 38 0
      src/main/java/com/diagbot/dto/KllisDetailDTO.java
  90. 19 0
      src/main/java/com/diagbot/dto/LibConceptDTO.java
  91. 19 0
      src/main/java/com/diagbot/dto/LisCtritalDTO.java
  92. 51 0
      src/main/java/com/diagbot/dto/LisDetailDTO.java
  93. 24 0
      src/main/java/com/diagbot/dto/LisOtherDTO.java
  94. 14 0
      src/main/java/com/diagbot/dto/MatchDTO.java
  95. 35 0
      src/main/java/com/diagbot/dto/NeoPushDTO.java
  96. 19 0
      src/main/java/com/diagbot/dto/NurseInfoDTO.java
  97. 25 0
      src/main/java/com/diagbot/dto/OperationInfoDTO.java
  98. 29 0
      src/main/java/com/diagbot/dto/OtherExportDTO.java
  99. 17 0
      src/main/java/com/diagbot/dto/PacsDTO.java
  100. 0 0
      src/main/java/com/diagbot/dto/PacsOtherDTO.java

+ 26 - 0
.gitignore

@@ -0,0 +1,26 @@
+/target/
+!.mvn/wrapper/maven-wrapper.jar
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/build/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+/doc/

+ 288 - 0
pom.xml

@@ -0,0 +1,288 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.diagbot</groupId>
+    <artifactId>cdss-core</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <packaging>jar</packaging>
+
+    <name>cdss-core</name>
+    <description>CDSS核心服务</description>
+
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.2.1.RELEASE</version>
+        <relativePath/>
+    </parent>
+
+    <properties>
+        <maven.compiler.source>1.8</maven.compiler.source>
+        <maven.compiler.target>1.8</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+        <java.version>1.8</java.version>
+        <spring-cloud.version>Hoxton.RELEASE</spring-cloud.version>
+        <mybatis-plus-boot-starter.version>3.2.0</mybatis-plus-boot-starter.version>
+        <mybatis-spring-boot.version>2.1.1</mybatis-spring-boot.version>
+        <druid.version>1.1.21</druid.version>
+        <easypoi.version>4.3.0</easypoi.version>
+        <swagger.version>2.9.2</swagger.version>
+        <logstash.version>5.2</logstash.version>
+        <docker-maven-plugin.version>1.2.1</docker-maven-plugin.version>
+        <aggregator.version>1.1.3</aggregator.version>
+        <hanlp.version>portable-1.8.1</hanlp.version>
+    </properties>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.springframework.cloud</groupId>
+                <artifactId>spring-cloud-dependencies</artifactId>
+                <version>${spring-cloud.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.diagbot</groupId>
+            <artifactId>common</artifactId>
+            <version>0.0.1-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.jolokia</groupId>
+            <artifactId>jolokia-core</artifactId>
+        </dependency>
+
+        <!-- 开启web-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-tomcat</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-undertow</artifactId>
+        </dependency>
+
+        <!-- 开启feign-->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-openfeign</artifactId>
+        </dependency>
+
+        <!-- dashboard -->
+        <!-- actuator-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+        <!--hystrix-dashboard-->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
+        </dependency>
+        <!--hystrix -->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
+        </dependency>
+
+        <!--swagger-->
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+            <version>${swagger.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger-ui</artifactId>
+            <version>${swagger.version}</version>
+        </dependency>
+        <!-- easypoi -->
+        <dependency>
+            <groupId>cn.afterturn</groupId>
+            <artifactId>easypoi-spring-boot-starter</artifactId>
+            <version>${easypoi.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <optional>true</optional>
+        </dependency>
+
+        <!--redis设置-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-pool2</artifactId>
+        </dependency>
+
+        <!-- mybatis-plus begin -->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+            <version>${mybatis-plus-boot-starter.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-generator</artifactId>
+            <version>${mybatis-plus-boot-starter.version}</version>
+        </dependency>
+        <!-- mybatis-plus end -->
+
+        <!-- 阿里巴巴druid数据库连接池 -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+            <version>${druid.version}</version>
+        </dependency>
+
+        <!-- springboot整合mybatis(核心就这一个) -->
+        <!-- 注意顺序,这个一定要放在最下面 -->
+        <dependency>
+            <groupId>org.mybatis.spring.boot</groupId>
+            <artifactId>mybatis-spring-boot-starter</artifactId>
+            <version>${mybatis-spring-boot.version}</version>
+        </dependency>
+
+        <!--多数据源-->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
+            <version>3.3.1</version>
+        </dependency>
+
+        <!--database-->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+
+        <!-- 文件上传相关�?? -->
+        <dependency>
+            <groupId>commons-beanutils</groupId>
+            <artifactId>commons-beanutils</artifactId>
+            <version>1.9.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-fileupload</groupId>
+            <artifactId>commons-fileupload</artifactId>
+            <version>1.3.1</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>2.4</version>
+        </dependency>
+
+        <dependency>
+            <groupId>io.github.lvyahui8</groupId>
+            <artifactId>spring-boot-data-aggregator-starter</artifactId>
+            <version>${aggregator.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.hankcs</groupId>
+            <artifactId>hanlp</artifactId>
+            <version>${hanlp.version}</version>
+        </dependency>
+
+        <!--redis内存压缩-->
+        <dependency>
+            <groupId>org.xerial.snappy</groupId>
+            <artifactId>snappy-java</artifactId>
+            <version>1.1.8.4</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.esotericsoftware</groupId>
+            <artifactId>kryo</artifactId>
+            <version>5.2.1</version>
+        </dependency>
+
+    </dependencies>
+
+
+    <build>
+        <plugins>
+			<plugin>
+				<artifactId>maven-dependency-plugin</artifactId>
+				<executions>
+					<execution>
+						<id>copy</id>
+						<phase>package</phase>
+						<goals>
+							<goal>copy-dependencies</goal>
+						</goals>
+						<configuration>
+							<outputDirectory>${project.build.directory}/lib</outputDirectory>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<artifactId>maven-resources-plugin</artifactId>
+				<executions>
+					<execution>
+						<id>copy-resources</id>
+						<phase>package</phase>
+						<goals>
+							<goal>copy-resources</goal>
+						</goals>
+						<configuration>
+							<resources>
+								<resource>
+									<directory>src/main/resources</directory>
+								</resource>
+							</resources>
+							<outputDirectory>${project.build.directory}/resources</outputDirectory>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<artifactId>maven-jar-plugin</artifactId>
+				<configuration>
+					<excludes>
+						<exclude>mapper</exclude>
+						<exclude>*.**</exclude>
+						<exclude>**/*.xml</exclude>
+						<exclude>**/*.yml</exclude>
+					</excludes>
+					<archive>
+						<manifest>
+							<mainClass>${main-class}</mainClass>
+							<addClasspath>true</addClasspath>
+							<classpathPrefix>lib/</classpathPrefix>
+							<useUniqueVersions>false</useUniqueVersions>
+						</manifest>
+					</archive>
+					<outputDirectory>${project.build.directory}</outputDirectory>
+				</configuration>
+			</plugin>
+		</plugins>
+    </build>
+
+</project>

+ 32 - 0
src/main/java/com/diagbot/CdssCoreApplication.java

@@ -0,0 +1,32 @@
+package com.diagbot;
+
+import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration;
+import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
+import org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration;
+import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
+import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
+import org.springframework.cloud.netflix.hystrix.EnableHystrix;
+import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
+import org.springframework.cloud.openfeign.EnableFeignClients;
+
+/**
+ * @Description: 系统启动文件
+ * @author: zhoutg
+ * @time: 2018/8/7 9:26
+ */
+@EnableHystrix
+@EnableCircuitBreaker
+@EnableHystrixDashboard
+@ConfigurationPropertiesScan
+@EnableFeignClients({ "com.diagbot.client" })
+@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class, JmxAutoConfiguration.class, ThymeleafAutoConfiguration.class, DruidDataSourceAutoConfigure.class })
+public class CdssCoreApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(CdssCoreApplication.class, args);
+    }
+}

+ 89 - 0
src/main/java/com/diagbot/aggregate/DictionaryAggregate.java

@@ -0,0 +1,89 @@
+package com.diagbot.aggregate;
+
+import com.diagbot.client.PushNewServiceClient;
+import com.diagbot.dto.DictionaryDTO;
+import com.diagbot.dto.DictionaryInfoDTO;
+import com.diagbot.facade.KlDictionaryInfoFacade;
+import com.diagbot.facade.KlLexiconFacade;
+import com.diagbot.facade.KlRulePlanFacade;
+import com.diagbot.process.PushProcess;
+import com.diagbot.util.ListUtil;
+import io.github.lvyahui8.spring.annotation.DataConsumer;
+import io.github.lvyahui8.spring.annotation.DataProvider;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @Description: 获取字典类型聚合
+ * @author: zhoutg
+ * @time: 2019/10/16 13:37
+ */
+@Component
+@Slf4j
+public class DictionaryAggregate {
+
+    @Autowired
+    PushProcess pushProcess;
+    @Autowired
+    PushNewServiceClient pushNewServiceClient;
+    @Autowired
+    KlDictionaryInfoFacade klDictionaryInfoFacade;
+    @Autowired
+    KlRulePlanFacade klRulePlanFacade;
+    @Autowired
+    KlLexiconFacade klLexiconFacade;
+
+    @DataProvider("getDictionary")
+    public DictionaryDTO getDictionary(
+            @DataConsumer("getDic") List<DictionaryInfoDTO> dicList,
+            @DataConsumer("getLexicon") List<DictionaryInfoDTO> lexiconList,
+            @DataConsumer("getPlan") List<DictionaryInfoDTO> planList) {
+
+        DictionaryDTO res = new DictionaryDTO();
+        List<DictionaryInfoDTO> list = res.getList();
+
+        if (ListUtil.isNotEmpty(dicList)) {
+            list.addAll(dicList);
+        }
+        if (ListUtil.isNotEmpty(lexiconList)) {
+            list.addAll(lexiconList);
+        }
+        if (ListUtil.isNotEmpty(planList)) {
+            list.addAll(planList);
+        }
+        return res;
+    }
+
+    /**
+     * 获取字典数据
+     *
+     * @return
+     */
+    @DataProvider("getDic")
+    public List<DictionaryInfoDTO> getDic() {
+        return klDictionaryInfoFacade.getListBackCommon();
+    }
+
+    /**
+     * 获取lexicon字典数据
+     *
+     * @return
+     */
+    @DataProvider("getLexicon")
+    public List<DictionaryInfoDTO> getLexicon() {
+        return klLexiconFacade.getLexiconDic();
+    }
+
+    /**
+     * 获取rulePlan字典数据
+     *
+     * @return
+     */
+    @DataProvider("getPlan")
+    public List<DictionaryInfoDTO> getPlan() {
+        return klRulePlanFacade.getPlanDicFac();
+    }
+}

+ 174 - 0
src/main/java/com/diagbot/aggregate/IndicationAggregate.java

@@ -0,0 +1,174 @@
+package com.diagbot.aggregate;
+
+import com.diagbot.dto.IndicationDTO;
+import com.diagbot.dto.WordCrfDTO;
+import com.diagbot.facade.BillFacade;
+import com.diagbot.facade.CriticalFacade;
+import com.diagbot.facade.HighRiskFacade;
+import com.diagbot.facade.OtherTipFacade;
+import com.diagbot.util.CoreUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.IndicationPushVO;
+import io.github.lvyahui8.spring.annotation.DataConsumer;
+import io.github.lvyahui8.spring.annotation.DataProvider;
+import io.github.lvyahui8.spring.annotation.InvokeParameter;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @Description: 提醒类聚合
+ * @author: zhoutg
+ * @time: 2019/10/16 13:37
+ */
+@Component
+@Slf4j
+public class IndicationAggregate {
+
+    @Autowired
+    BillFacade billFacade;
+    @Autowired
+    HighRiskFacade highRiskFacade;
+    @Autowired
+    CriticalFacade criticalFacade;
+    @Autowired
+    OtherTipFacade otherTipFacade;
+
+    @DataProvider("indicationAll")
+    public IndicationDTO indicationAll(
+            @InvokeParameter("wordCrfDTO") WordCrfDTO wordCrfDTO,
+            @InvokeParameter("indicationPushVO") IndicationPushVO indicationPushVO,
+            @InvokeParameter("debug") Map<String, Object> debug,
+            @DataConsumer("bill") IndicationDTO billDTO,
+            @DataConsumer("highrisk") IndicationDTO highriskDTO,
+            @DataConsumer("critical") IndicationDTO criticalDTO,
+            @DataConsumer("otherTip") IndicationDTO otherDTO) {
+        IndicationDTO res = new IndicationDTO();
+        if (billDTO != null) {
+            res.setBillMsgList(billDTO.getBillMsgList());
+            debug.putAll(billDTO.getDebug()); // 调试信息
+        }
+        if (highriskDTO != null) {
+            res.setHighRiskList(highriskDTO.getHighRiskList());
+            debug.putAll(highriskDTO.getDebug()); // 调试信息
+        }
+        if (criticalDTO != null) {
+            res.setCriticalValList(criticalDTO.getCriticalValList());
+            debug.putAll(criticalDTO.getDebug()); // 调试信息
+        }
+        if (otherDTO != null) {
+            res.setOtherList(otherDTO.getOtherList());
+            debug.putAll(otherDTO.getDebug()); // 调试信息
+        }
+        res.setDebug(debug);
+        return res;
+    }
+
+    /**
+     * 开单合理性
+     *
+     * @param wordCrfDTO
+     * @param indicationPushVO
+     * @return
+     */
+    @DataProvider("bill")
+    public IndicationDTO bill(@InvokeParameter("wordCrfDTO") WordCrfDTO wordCrfDTO,
+                              @InvokeParameter("indicationPushVO") IndicationPushVO indicationPushVO) {
+        long start = System.currentTimeMillis();
+        IndicationDTO res = new IndicationDTO();
+        // 开单合理性
+        if (indicationPushVO != null && indicationPushVO.getRuleTypeList().contains("2")) {
+            try {
+                billFacade.billFac(wordCrfDTO, res);
+                CoreUtil.getDebugStr(start, "开单规则耗时", res.getDebug());
+            } catch (Exception e) {
+                String errMsg = StringUtil.isNotBlank(indicationPushVO.getIdNum()) ?
+                        "行号【" + indicationPushVO.getIdNum() + "】" : "";
+                log.error("【开单规则出错】" + errMsg, e);
+                CoreUtil.getDebugStr("【开单规则出错】", errMsg + e, res.getDebug());
+            }
+            return res;
+        }
+        return null;
+    }
+
+    /**
+     * 高风险提示
+     *
+     * @param wordCrfDTO
+     * @param indicationPushVO
+     * @return
+     */
+    @DataProvider("highrisk")
+    public IndicationDTO highrisk(@InvokeParameter("wordCrfDTO") WordCrfDTO wordCrfDTO,
+                              @InvokeParameter("indicationPushVO") IndicationPushVO indicationPushVO) {
+        long start = System.currentTimeMillis();
+        IndicationDTO res = new IndicationDTO();
+        // 高风险提示
+        if (indicationPushVO != null && indicationPushVO.getRuleTypeList().contains("3")) {
+            try {
+                highRiskFacade.highRiskFac(wordCrfDTO, res);
+                CoreUtil.getDebugStr(start, "高风险提示耗时", res.getDebug());
+            } catch (Exception e) {
+                log.error("【高风险提示出错】", e);
+                CoreUtil.getDebugStr("【高风险提示出错】", e, res.getDebug());
+            }
+            return res;
+        }
+        return null;
+    }
+
+    /**
+     * 危急值提示
+     *
+     * @param wordCrfDTO
+     * @param indicationPushVO
+     * @return
+     */
+    @DataProvider("critical")
+    public IndicationDTO critical(@InvokeParameter("wordCrfDTO") WordCrfDTO wordCrfDTO,
+                                  @InvokeParameter("indicationPushVO") IndicationPushVO indicationPushVO) {
+        long start = System.currentTimeMillis();
+        IndicationDTO res = new IndicationDTO();
+        // 危急值提示
+        if (indicationPushVO != null && indicationPushVO.getRuleTypeList().contains("1")) {
+            try {
+                criticalFacade.criticalFac(wordCrfDTO, res);
+                CoreUtil.getDebugStr(start, "危急值提示耗时", res.getDebug());
+                return res;
+            } catch (Exception e) {
+                log.error("【危急值提示出错】", e);
+                CoreUtil.getDebugStr("【危急值提示出错】", e, res.getDebug());
+            }
+        }
+        return null;
+    }
+
+    /**
+     * 其他提示
+     *
+     * @param wordCrfDTO
+     * @param indicationPushVO
+     * @return
+     */
+    @DataProvider("otherTip")
+    public IndicationDTO otherTip(@InvokeParameter("wordCrfDTO") WordCrfDTO wordCrfDTO,
+                                  @InvokeParameter("indicationPushVO") IndicationPushVO indicationPushVO) {
+        long start = System.currentTimeMillis();
+        IndicationDTO res = new IndicationDTO();
+        // 其他提示
+        if (indicationPushVO != null && indicationPushVO.getRuleTypeList().contains("4")) {
+            try {
+                otherTipFacade.otherTipFac(wordCrfDTO, res);
+                CoreUtil.getDebugStr(start, "其他值提示耗时", res.getDebug());
+                return res;
+            } catch (Exception e) {
+                log.error("【其他值提示出错】", e);
+                CoreUtil.getDebugStr("【其他值提示出错】", e, res.getDebug());
+            }
+        }
+        return null;
+    }
+}

+ 123 - 0
src/main/java/com/diagbot/aggregate/IndicationTestAggregate.java

@@ -0,0 +1,123 @@
+package com.diagbot.aggregate;
+
+import com.diagbot.facade.TestFacade;
+import com.diagbot.vo.TestLineVO;
+import io.github.lvyahui8.spring.annotation.DataConsumer;
+import io.github.lvyahui8.spring.annotation.DataProvider;
+import io.github.lvyahui8.spring.annotation.InvokeParameter;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+/**
+ * @Description: 提醒类聚合
+ * @author: zhoutg
+ * @time: 2019/10/16 13:37
+ */
+@Component
+@Slf4j
+public class IndicationTestAggregate {
+
+    @Autowired
+    TestFacade testFacade;
+
+    @DataProvider("testAll")
+    public Map<String, Map<String, Object>> testAll(
+            @InvokeParameter("mapPath") Map<String, String> mapPath,
+            @DataConsumer("t1") Map<String, Map<String, Object>> t1Map,
+            @DataConsumer("t2") Map<String, Map<String, Object>> t2Map,
+            @DataConsumer("t3") Map<String, Map<String, Object>> t3Map,
+            @DataConsumer("t4") Map<String, Map<String, Object>> t4Map) {
+        Map<String, Map<String, Object>> map = new LinkedHashMap<>();
+        if (t1Map != null) {
+            map.putAll(t1Map);
+        }
+        if (t2Map != null) {
+            map.putAll(t2Map);
+        }
+        if (t3Map != null) {
+            map.putAll(t3Map);
+        }
+        if (t4Map != null) {
+            map.putAll(t4Map);
+        }
+        return map;
+    }
+
+    @DataProvider("t1")
+    public Map<String, Object> t1(@InvokeParameter("mapPath") Map<String, String> mapPath) {
+        Map<String, Object> map = new LinkedHashMap<>();
+        MultipartFile file = null;
+
+        file = testFacade.getMulFileByPath(mapPath.get("【开单合理性_输血】"));
+        Map<String, Object> billTransfusionMap = testFacade.testIndicationTransfusion(file, new TestLineVO());
+        map.put("【开单合理性_输血】",billTransfusionMap);
+
+        file = testFacade.getMulFileByPath(mapPath.get("【危急值_化验】"));
+        Map<String, Object> criticalMapLis = testFacade.importCriticalLisExcel(file, new TestLineVO());
+        map.put("【危急值_化验】",criticalMapLis);
+
+        file = testFacade.getMulFileByPath(mapPath.get("【危急值_辅检】"));
+        Map<String, Object> criticalMapPacs = testFacade.importCriticalPacsExcel(file, new TestLineVO());
+        map.put("【危急值_辅检】",criticalMapPacs);
+
+        file = testFacade.getMulFileByPath(mapPath.get("【其他值提醒_化验】"));
+        Map<String, Object> otherLisMap = testFacade.testOtherTipLis(file, new TestLineVO());
+        map.put("【其他值提醒_化验】",otherLisMap);
+
+        file = testFacade.getMulFileByPath(mapPath.get("【其他值提醒_辅检】"));
+        Map<String, Object> otherPacsMap = testFacade.testOtherTipPacs(file, new TestLineVO());
+        map.put("【其他值提醒_辅检】",otherPacsMap);
+
+        file = testFacade.getMulFileByPath(mapPath.get("【其他值提醒_输血】"));
+        Map<String, Object> otherTransfusionMap = testFacade.testOtherTipTransfusion(file, new TestLineVO());
+        map.put("【其他值提醒_输血】",otherTransfusionMap);
+
+        file = testFacade.getMulFileByPath(mapPath.get("【检查结果与项目重复开立规则】"));
+        Map<String, Object> pacsOrderNeedlessMap = testFacade.testPacsOrderNeedlessProcess(file, new TestLineVO());
+        map.put("【检查结果与项目重复开立规则】",pacsOrderNeedlessMap);
+
+        return map;
+    }
+
+    @DataProvider("t2")
+    public Map<String, Object> t2(@InvokeParameter("mapPath") Map<String, String> mapPath) {
+        Map<String, Object> map = new LinkedHashMap<>();
+        MultipartFile file = testFacade.getMulFileByPath(mapPath.get("【高危药品】"));
+        Map<String, Object> highDrugMap = testFacade.testHighRiskDrugExcel(file, new TestLineVO());
+        map.put("【高危药品】",highDrugMap);
+        return map;
+    }
+
+    @DataProvider("t3")
+    public Map<String, Object> t3(@InvokeParameter("mapPath") Map<String, String> mapPath) {
+        Map<String, Object> map = new LinkedHashMap<>();
+        MultipartFile file = testFacade.getMulFileByPath(mapPath.get("【高危手术整合】"));
+
+        Map<String, Object> highOperationMap = testFacade.testHighRiskOperationExcel(file, new TestLineVO());
+        map.put("【高危手术】",highOperationMap);
+
+        TestLineVO testLineVO = new TestLineVO();
+        testLineVO.setGetOne(true);
+        Map<String, Object> highOperationComplexMap = testFacade.testHighRiskProcess(file, testLineVO);
+        map.put("【高危手术复杂情况】",highOperationComplexMap);
+        return map;
+    }
+
+    @DataProvider("t4")
+    public Map<String, Object> t4(@InvokeParameter("mapPath") Map<String, String> mapPath) {
+        Map<String, Object> map = new LinkedHashMap<>();
+        MultipartFile file = null;
+        file = testFacade.getMulFileByPath(mapPath.get("【开单合理性】"));
+        TestLineVO testLineVO = new TestLineVO();
+        testLineVO.setGetOne(true);
+        Map<String, Object> billMap = testFacade.importExcel(file, testLineVO);
+        map.put("【开单合理性】",billMap);
+
+        return map;
+    }
+}

+ 118 - 0
src/main/java/com/diagbot/aggregate/PushDisAggregate.java

@@ -0,0 +1,118 @@
+//package com.diagbot.aggregate;
+//
+//import com.diagbot.facade.NeoFacade;
+//import com.diagbot.util.ListUtil;
+//import com.diagbot.vo.NeoPushVO;
+//import io.github.lvyahui8.spring.annotation.DataConsumer;
+//import io.github.lvyahui8.spring.annotation.DataProvider;
+//import io.github.lvyahui8.spring.annotation.InvokeParameter;
+//import lombok.extern.slf4j.Slf4j;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.stereotype.Component;
+//
+//import java.util.ArrayList;
+//import java.util.List;
+//
+///**
+// * @Description:
+// * @author: kwz
+// * @time: 2020/10/22 15:24
+// */
+//@Component
+//@Slf4j
+//public class PushDisAggregate {
+//    @Autowired
+//    private NeoFacade neoFacade;
+//    @DataProvider("pushAll")
+//    public List<String> getDis(
+//            @InvokeParameter("pushVo") NeoPushVO pushVO,
+//            @DataConsumer("pushDisBySymptom_main") List<String> disBySm,
+//            @DataConsumer("pushDisBySymptom_other") List<String> disBySo,
+//            @DataConsumer("pushDisByVital") List<String> disByVital,
+//            @DataConsumer("pushDisByLis_nospecial") List<String> disByLis
+//    ){
+//        List<String> allPushDis = new ArrayList<>();
+//        if(ListUtil.isNotEmpty(disBySm)){
+//            disBySo.retainAll(disBySm);
+//            disByVital.retainAll(disBySm);
+//            disByLis.retainAll(disBySm);
+//            allPushDis.addAll(disBySm);
+//            allPushDis.addAll(disBySo);
+//            allPushDis.addAll(disByVital);
+//            allPushDis.addAll(disByLis);
+//        }
+//        return allPushDis;
+//    }
+//
+//    private void addDis(List<String> allPushDis, List<String> disByLis) {
+//        if (ListUtil.isNotEmpty(disByLis)) {
+//            allPushDis.addAll(disByLis);
+//        }
+//    }
+//
+//    /**
+//     * 主症状推送诊断
+//     * @param pushVO
+//     * @return
+//     */
+//    @DataProvider("pushDisBySymptom_main")
+//    public List<String> pushDisBySm(@InvokeParameter("pushVo") NeoPushVO pushVO) {
+//        List<String> pushDisBySm = neoFacade.pushDisBySymptom_main(pushVO);
+//        return pushDisBySm;
+//    }
+//
+//    /**
+//     * 其他症状推送诊断
+//     * @param pushVO
+//     * @return
+//     */
+//    @DataProvider("pushDisBySymptom_other")
+//    public List<String> pushDisBySo(@InvokeParameter("pushVo") NeoPushVO pushVO) {
+//        List<String> pushDisBySm = neoFacade.getDisBySymptom_other(pushVO);
+//        return pushDisBySm;
+//    }
+//
+//    /**
+//     * 化验特异性诊断
+//     * @param pushVO
+//     * @return
+//     */
+//    @DataProvider("pushDisBySpecialLis")
+//    public List<String> pushDisBySl(@InvokeParameter("pushVo") NeoPushVO pushVO) {
+//        List<String> pushDisBySm = neoFacade.pushDisBySpecialLis(pushVO);
+//        return pushDisBySm;
+//    }
+//
+//    /**
+//     * 辅检特异性诊断
+//     * @param pushVO
+//     * @return
+//     */
+//    @DataProvider("pushDisByPacs")
+//    public List<String> pushDisByPs(@InvokeParameter("pushVo") NeoPushVO pushVO) {
+//        List<String> pushDisBySm = neoFacade.pushDisByPacs(pushVO);
+//        return pushDisBySm;
+//    }
+//
+//    /**
+//     * 体征推送诊断
+//     * @param pushVO
+//     * @return
+//     */
+//    @DataProvider("pushDisByVital")
+//    public List<String> pushDisByVl(@InvokeParameter("pushVo") NeoPushVO pushVO) {
+//        List<String> pushDisBySm = neoFacade.getDisByVital(pushVO);
+//        return pushDisBySm;
+//    }
+//
+//    /**
+//     * 非特异性化验推送诊断
+//     * @param pushVO
+//     * @return
+//     */
+//    @DataProvider("pushDisByLis_nospecial")
+//    public List<String> pushDisByLisNo(@InvokeParameter("pushVo") NeoPushVO pushVO) {
+//        List<String> pushDisBySm = neoFacade.getDisByLis_other(pushVO);
+//        return pushDisBySm;
+//    }
+//}

+ 119 - 0
src/main/java/com/diagbot/aggregate/PushNewAggregate.java

@@ -0,0 +1,119 @@
+package com.diagbot.aggregate;
+
+import com.diagbot.client.PushNewServiceClient;
+import com.diagbot.dto.PushBaseDTO;
+import com.diagbot.dto.PushDTO;
+import com.diagbot.dto.PushNewDTO;
+import com.diagbot.dto.WordCrfDTO;
+import com.diagbot.enums.DiagnoseTypeEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.process.PushProcess;
+import com.diagbot.util.CoreUtil;
+import com.diagbot.util.ListUtil;
+import com.diagbot.vo.PushNewVO;
+import io.github.lvyahui8.spring.annotation.DataConsumer;
+import io.github.lvyahui8.spring.annotation.DataProvider;
+import io.github.lvyahui8.spring.annotation.InvokeParameter;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @Description: 提醒类聚合
+ * @author: zhoutg
+ * @time: 2019/10/16 13:37
+ */
+@Component
+@Slf4j
+public class PushNewAggregate {
+
+    @Autowired
+    PushProcess pushProcess;
+    @Autowired
+    PushNewServiceClient pushNewServiceClient;
+
+    @DataProvider("pushAll")
+    public PushDTO push(
+            @InvokeParameter("wordCrfDTO") WordCrfDTO wordCrfDTO,
+            @InvokeParameter("pushNewVO") PushNewVO pushNewVO,
+            @DataConsumer("pushBigData") PushDTO pushBigData,
+            @DataConsumer("pushDiagnose") PushDTO pushDiagnose) {
+
+        PushDTO res = new PushDTO();
+        Map<String, Object> debug = new LinkedHashMap<>();
+        Map<String, List<PushBaseDTO>> dis = new LinkedHashMap<>();
+        res.setDis(dis);
+        res.setDebug(debug);
+        if (pushDiagnose != null) {
+            if (pushDiagnose.getDis() != null) {
+                dis.putAll(pushDiagnose.getDis());
+            }
+            debug.putAll(pushDiagnose.getDebug());
+        }
+        if (pushBigData != null) {
+            if (pushBigData.getDis() != null) {
+                dis.putAll(pushBigData.getDis());
+            }
+            debug.putAll(pushBigData.getDebug());
+        }
+        return res;
+    }
+
+    /**
+     * 诊断依据推理
+     *
+     * @param wordCrfDTO
+     * @return
+     */
+    @DataProvider("pushDiagnose")
+    public PushDTO pushDiagnose(@InvokeParameter("wordCrfDTO") WordCrfDTO wordCrfDTO) {
+        PushDTO pushDTO = pushProcess.pushDiagnose(wordCrfDTO);
+        return pushDTO;
+    }
+
+    /**
+     * 大数据推理
+     *
+     * @param pushNewVO
+     * @return
+     */
+    @DataProvider("pushBigData")
+    public PushDTO pushBigData(@InvokeParameter("pushNewVO") PushNewVO pushNewVO,
+                               @InvokeParameter("wordCrfDTO") WordCrfDTO wordCrfDTO) {
+        PushDTO pushDTO = new PushDTO();
+        Map<String, List<PushBaseDTO>> dis = new LinkedHashMap<>();
+        pushDTO.setDis(dis);
+        long start = System.currentTimeMillis();
+        pushNewVO.setWordCrfDTO(wordCrfDTO);
+        try {
+            PushNewDTO pushNewDTO = pushNewServiceClient.pushNew(pushNewVO);
+            if (pushNewDTO == null || (pushNewDTO != null && pushNewDTO.getStatus().equals(-1))) {
+                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "大数据推理出错");
+            }
+            // 根据现有信息,无法推送相关疾病
+            if (pushNewDTO.getStatus().equals(1)) {
+                CoreUtil.getDebugStr("【大数据推理无诊断结果】", "无法推送相关疾病", pushDTO.getDebug());
+            } else if (pushNewDTO.getStatus().equals(0)) {
+                if (ListUtil.isNotEmpty(pushNewDTO.getDisease())) {
+                    List<PushBaseDTO> pushBaseDTOList = pushNewDTO.getDisease().stream().map(r -> {
+                        PushBaseDTO pushBaseDTO = new PushBaseDTO();
+                        pushBaseDTO.setName(r);
+                        return pushBaseDTO;
+                    }).collect(Collectors.toList());
+                    dis.put(DiagnoseTypeEnum.bigDataPush.getName(), pushBaseDTOList);
+                }
+            }
+        } catch (Exception e) {
+            log.error("【大数据推理出错】", e);
+            CoreUtil.getDebugStr("【大数据推理出错】", "大数据推理出错", pushDTO.getDebug());
+        }
+        CoreUtil.getDebugStr(start, "推送诊断耗时_大数据", pushDTO.getDebug());
+        return pushDTO;
+    }
+}

+ 376 - 0
src/main/java/com/diagbot/aggregate/RuleAggregate.java

@@ -0,0 +1,376 @@
+package com.diagbot.aggregate;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.AllRulesDTO;
+import com.diagbot.dto.RuleBaseDTO;
+import com.diagbot.dto.RuleBaseInitDTO;
+import com.diagbot.vo.RuleBaseQueryVO;
+import com.diagbot.dto.RuleConditionDTO;
+import com.diagbot.dto.RuleConditionInitDTO;
+import com.diagbot.dto.RuleDTO;
+import com.diagbot.dto.RuleIdDTO;
+import com.diagbot.dto.RuleInitDTO;
+import com.diagbot.entity.KlRuleSearch;
+import com.diagbot.enums.BaseTypeEnum;
+import com.diagbot.enums.LexiconEnum;
+import com.diagbot.enums.RedisEnum;
+import com.diagbot.enums.RuleTypeEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.facade.KlRuleFacade;
+import com.diagbot.service.KlRuleSearchService;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.RedisUtil;
+import io.github.lvyahui8.spring.annotation.DataConsumer;
+import io.github.lvyahui8.spring.annotation.DataProvider;
+import io.github.lvyahui8.spring.annotation.InvokeParameter;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2021/5/31 17:14
+ */
+@Component
+@Slf4j
+public class RuleAggregate {
+    @Autowired
+    private KlRuleFacade klRuleFacade;
+    @Autowired
+    private RedisUtil redisUtil;
+    @Autowired
+    @Qualifier("klRuleSearchServiceImpl")
+    private KlRuleSearchService klRuleSearchService;
+
+    @DataProvider("getAllRules")
+    public AllRulesDTO getAllRules(
+            @DataConsumer("getRuleInit") Map<String, List<RuleInitDTO>> ruleInits,
+            @DataConsumer("getRuleConditionInit") Map<Integer, Map<String, List<RuleConditionInitDTO>>> ruleConditionInits,
+            @DataConsumer("getRuleBaseInit") Map<Integer, List<RuleBaseInitDTO>> ruleBaseInits) {
+        try {
+            //有效规则Map
+            Map<String, RuleDTO> ruleDTOMap = new HashMap();
+            //药物过敏源
+            Map<String, Integer> drugAllergen = new HashMap<>();
+            //规则搜索有效的规则ID
+            HashSet<Long> ruleIdSet = new HashSet<>();
+            List<KlRuleSearch> klRuleSearchList = new ArrayList<>();
+            //结果判空第一层规则类型
+            if (MapUtils.isNotEmpty(ruleInits)) {
+                for (String ruleKey : ruleInits.keySet()) {
+                    RuleInitDTO ruleInitZeroDTO = ruleInits.get(ruleKey).get(0);
+                    RuleDTO ruleDTO = new RuleDTO();
+                    ruleDTO.setLibName(ruleInitZeroDTO.getLibName());
+                    ruleDTO.setLibType(ruleInitZeroDTO.getLibType());
+                    ruleDTO.setRuleType(ruleInitZeroDTO.getRuleType());
+                    //药物过敏源相关
+                    Boolean allergenAdd = false;
+                    if (ruleDTO.getRuleType().equals(RuleTypeEnum.bill.getKey())
+                            && ruleDTO.getLibType().equals(LexiconEnum.Medicine.getKey())) {
+                        allergenAdd = true;
+                    }
+                    Map<String, Integer> ruleConditionMap = new HashMap<>();
+                    for (RuleInitDTO ruleInitDTO : ruleInits.get(ruleKey)) {
+                        if (ruleInitDTO.getHasSubCond().equals(1)) {
+                            Map<String, List<RuleConditionInitDTO>> map = ruleConditionInits.get(ruleInitDTO.getRuleId());
+                            //结果判空第二层条件组别
+                            if (MapUtils.isNotEmpty(map)) {
+                                for (String ruleGroup : map.keySet()) {
+                                    RuleConditionDTO ruleConditionDTO = new RuleConditionDTO();
+                                    ruleConditionDTO.setHasSubCond(ruleInitDTO.getHasSubCond());
+                                    ruleConditionDTO.setDescription(ruleInitDTO.getDescription());
+                                    ruleConditionDTO.setRuleGroup(ruleGroup);
+                                    //结果判空第三层条件明细
+                                    if (ListUtil.isNotEmpty(map.get(ruleGroup))) {
+                                        List<List<RuleBaseDTO>> ruleBaseList = new ArrayList<>();
+                                        for (RuleConditionInitDTO ruleConditionInitDTO : map.get(ruleGroup)) {
+                                            ruleConditionDTO.setMsg(ruleConditionInitDTO.getMsg());
+                                            List<RuleBaseInitDTO> ruleBaseInitDTOList = ruleBaseInits.get(ruleConditionInitDTO.getRuleBaseId());
+                                            if (ListUtil.isNotEmpty(ruleBaseInitDTOList)) {
+                                                List<RuleBaseDTO> ruleBaseDTOList = BeanUtil.listCopyTo(ruleBaseInitDTOList, RuleBaseDTO.class);
+                                                ruleBaseList.add(ruleBaseDTOList);
+                                            }
+                                        }
+                                        //笛卡尔积
+                                        List<List<RuleBaseDTO>> ruleBaseGroup = new ArrayList<>();
+                                        descartes(ruleBaseList, ruleBaseGroup, 0, new ArrayList<>());
+                                        //药物过敏源相关
+                                        if (allergenAdd
+                                                && ruleBaseGroup.size() == 1) {
+                                            allergenAdd = true;
+                                        }
+                                        for (List<RuleBaseDTO> ruleBaseDTOList : ruleBaseGroup) {
+                                            RuleConditionDTO ruleConditionDTO1 = new RuleConditionDTO();
+                                            ruleConditionDTO1.setHasSubCond(ruleConditionDTO.getHasSubCond());
+                                            ruleConditionDTO1.setRuleGroup(ruleConditionDTO.getRuleGroup());
+                                            ruleConditionDTO1.setDescription(ruleConditionDTO.getDescription());
+                                            ruleConditionDTO1.setMsg(ruleConditionDTO.getMsg());
+                                            ruleConditionDTO1.getRuleBaseDTOList().addAll(ruleBaseDTOList);
+                                            if (!ruleConditionMap.containsKey(ruleConditionDTO1.toString())) {
+                                                ruleDTO.getRuleConditionDTOList().add(ruleConditionDTO1);
+                                                //药物过敏源相关
+                                                if (allergenAdd
+                                                        && ruleBaseDTOList.size() == 1) {
+                                                    RuleBaseDTO ruleBaseDTO = ruleBaseDTOList.get(0);
+                                                    if (ruleBaseDTO.getBaseType().equals(BaseTypeEnum.B4.getKey())
+                                                            && ruleDTO.getLibType().equals(ruleBaseDTO.getBaseLibType())
+                                                            && ruleDTO.getLibName().equals(ruleBaseDTO.getBaseLibName())) {
+                                                        if (!drugAllergen.containsKey(ruleDTO.getLibName())) {
+                                                            drugAllergen.put(ruleDTO.getLibName(), 1);
+                                                        }
+                                                    }
+                                                }
+                                                ruleConditionMap.put(ruleConditionDTO1.toString(), 1);
+                                                //规则搜索有效的规则ID
+                                                if (!ruleIdSet.contains(ruleInitDTO.getRuleId())) {
+                                                    ruleIdSet.add(ruleInitDTO.getRuleId());
+                                                    KlRuleSearch klRuleSearch = new KlRuleSearch();
+                                                    klRuleSearch.setId(ruleInitDTO.getRuleId());
+                                                    klRuleSearchList.add(klRuleSearch);
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        } else {
+                            RuleConditionDTO ruleConditionDTO = new RuleConditionDTO();
+                            ruleConditionDTO.setHasSubCond(ruleInitDTO.getHasSubCond());
+                            ruleConditionDTO.setDescription(ruleInitDTO.getDescription());
+                            ruleConditionDTO.setMsg(ruleInitDTO.getMsg());
+                            //无条件
+                            ruleConditionDTO.setRuleGroup(ruleInitDTO.getRuleId() + "-1");
+                            ruleConditionDTO.getRuleBaseDTOList().add(new RuleBaseDTO());
+                            if (!ruleConditionMap.containsKey(ruleConditionDTO.toString())) {
+                                ruleDTO.getRuleConditionDTOList().add(ruleConditionDTO);
+                                ruleConditionMap.put(ruleConditionDTO.toString(), 1);
+                                //规则搜索有效的规则ID
+                                if (!ruleIdSet.contains(ruleInitDTO.getRuleId())) {
+                                    ruleIdSet.add(ruleInitDTO.getRuleId());
+                                    KlRuleSearch klRuleSearch = new KlRuleSearch();
+                                    klRuleSearch.setId(ruleInitDTO.getRuleId());
+                                    klRuleSearchList.add(klRuleSearch);
+                                }
+                            }
+                        }
+                    }
+                    ruleDTOMap.put(RedisEnum.allRule.getName() + ruleDTO.getLibType() + "_" + ruleDTO.getLibName() + "_" + ruleDTO.getRuleType(), ruleDTO);
+                }
+            }
+            //出参设置
+            AllRulesDTO allRulesDTO = new AllRulesDTO();
+            allRulesDTO.setRuleDTOMap(ruleDTOMap);
+            allRulesDTO.setDrugAllergen(drugAllergen);
+            allRulesDTO.setKlRuleSearchList(klRuleSearchList);
+            return allRulesDTO;
+        } catch (Exception e) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "全部规则加载出错:" + e.getMessage());
+        }
+    }
+
+    @DataProvider("getRuleInit")
+    public Map<String, List<RuleInitDTO>> getRuleInit() {
+        List<RuleInitDTO> list = klRuleFacade.getRuleInitDTO();
+        return EntityUtil.makeEntityListMap(list, "conceptGroup");
+    }
+
+    //    @DataProvider("getRuleInit")
+    //    public Map<String, List<RuleInitDTO>> getRuleInit(
+    //            @DataConsumer("getRuleInitNotHaveClass") List<RuleInitDTO> ruleNotHaveClass,
+    //            @DataConsumer("getRuleInitHaveClass") List<RuleInitDTO> ruleHaveClass) {
+    //        List<RuleInitDTO> list = new ArrayList<>();
+    //        if (ListUtil.isNotEmpty(ruleNotHaveClass)) {
+    //            list.addAll(ruleNotHaveClass);
+    //        }
+    //        if (ListUtil.isNotEmpty(ruleHaveClass)) {
+    //            list.addAll(ruleHaveClass);
+    //        }
+    //        return EntityUtil.makeEntityListMap(list, "conceptGroup");
+    //    }
+
+    @DataProvider("getRuleConditionInit")
+    public Map<Long, Map<String, List<RuleConditionInitDTO>>> getRuleConditionInit() {
+        List<RuleConditionInitDTO> list = klRuleFacade.getRuleConditionInitDTO();
+        Map<Long, List<RuleConditionInitDTO>> map = EntityUtil.makeEntityListMap(list, "ruleId");
+        Map<Long, Map<String, List<RuleConditionInitDTO>>> res = new HashMap<>();
+        for (Long ruleId : map.keySet()) {
+            res.put(ruleId, EntityUtil.makeEntityListMap(map.get(ruleId), "ruleGroup"));
+        }
+        return res;
+    }
+
+    @DataProvider("getRuleBaseInit")
+    public Map<Long, List<RuleBaseInitDTO>> getRuleBaseInit(
+            @DataConsumer("getRuleBaseInitNotHaveClass") List<RuleBaseInitDTO> ruleBaseNotHaveClass,
+            @DataConsumer("getRuleBaseInitHaveClass") List<RuleBaseInitDTO> ruleBaseHaveClass) {
+        List<RuleBaseInitDTO> list = new ArrayList<>();
+        if (ListUtil.isNotEmpty(ruleBaseNotHaveClass)) {
+            list.addAll(ruleBaseNotHaveClass);
+        }
+        if (ListUtil.isNotEmpty(ruleBaseHaveClass)) {
+            list.addAll(ruleBaseHaveClass);
+        }
+        return EntityUtil.makeEntityListMap(list, "ruleBaseId");
+    }
+
+
+    @DataProvider("getRuleInitNotHaveClass")
+    public List<RuleInitDTO> getRuleInitNotHaveClass() {
+        return klRuleFacade.getRuleInitDTONotHaveClass();
+    }
+
+    @DataProvider("getRuleInitHaveClass")
+    public List<RuleInitDTO> getRuleInitHaveClass() {
+        return klRuleFacade.getRuleInitDTOHaveClass();
+    }
+
+    @DataProvider("getRuleBaseInitNotHaveClass")
+    public List<RuleBaseInitDTO> getRuleBaseInitNotHaveClass() {
+        return klRuleFacade.getRuleBaseInitDTONotHaveClass();
+    }
+
+    @DataProvider("getRuleBaseInitHaveClass")
+    public List<RuleBaseInitDTO> getRuleBaseInitHaveClass() {
+        return klRuleFacade.getRuleBaseInitDTOHaveClass();
+    }
+
+    /**
+     * Discription: 笛卡尔乘积算法
+     * 把一个List{[1,2],[A,B],[a,b]} 转化成
+     * List{[1,A,a],[1,A,b],[1,B,a],[1,B,b],[2,A,a],[2,A,b],[2,B,a],[2,B,b]} 数组输出
+     *
+     * @param dimensionValue 原List
+     * @param result         通过乘积转化后的数组
+     * @param layer          中间参数
+     * @param currentList    中间参数
+     */
+    public static <T> void descartes(List<List<T>> dimensionValue, List<List<T>> result, int layer, List<T> currentList) {
+        if (layer < dimensionValue.size() - 1) {
+            if (dimensionValue.get(layer).size() == 0) {
+                descartes(dimensionValue, result, layer + 1, currentList);
+            } else {
+                for (int i = 0; i < dimensionValue.get(layer).size(); i++) {
+                    List<T> list = new ArrayList<T>(currentList);
+                    list.add(dimensionValue.get(layer).get(i));
+                    descartes(dimensionValue, result, layer + 1, list);
+                }
+            }
+        } else if (layer == dimensionValue.size() - 1) {
+            if (dimensionValue.get(layer).size() == 0) {
+                result.add(currentList);
+            } else {
+                for (int i = 0; i < dimensionValue.get(layer).size(); i++) {
+                    List<T> list = new ArrayList<T>(currentList);
+                    list.add(dimensionValue.get(layer).get(i));
+                    result.add(list);
+                }
+            }
+        }
+    }
+
+    @DataProvider("setAllRules")
+    public Boolean setAllRules(
+            @InvokeParameter("allRulesDTO") AllRulesDTO allRulesDTO,
+            @DataConsumer("setRuleDTOMap") Boolean resRuleDTOMap,
+            @DataConsumer("setDrugAllergen") Boolean resDrugAllergen,
+            @DataConsumer("setKlRuleSearchList") Boolean resKlRuleSearchList) {
+        return true;
+    }
+
+    @DataProvider("setRuleDTOMap")
+    public Boolean setRuleDTOMap(@InvokeParameter("allRulesDTO") AllRulesDTO allRulesDTO) {
+        //加载有效规则Map
+        if (MapUtils.isNotEmpty(allRulesDTO.getRuleDTOMap())) {
+            redisUtil.multiSet(allRulesDTO.getRuleDTOMap());
+        }
+        return true;
+    }
+
+    @DataProvider("setDrugAllergen")
+    public Boolean setDrugAllergen(@InvokeParameter("allRulesDTO") AllRulesDTO allRulesDTO) {
+        //加载药物过敏源缓存
+        if (MapUtils.isNotEmpty(allRulesDTO.getDrugAllergen())) {
+            redisUtil.set(RedisEnum.drugAllergen.getName(), allRulesDTO.getDrugAllergen());
+        }
+        return true;
+    }
+
+    @DataProvider("setKlRuleSearchList")
+    public Boolean setKlRuleSearchList(@InvokeParameter("allRulesDTO") AllRulesDTO allRulesDTO) {
+        //存储有效规则Id
+        klRuleSearchService.remove(new QueryWrapper<>());
+        if (ListUtil.isNotEmpty(allRulesDTO.getKlRuleSearchList())) {
+            klRuleSearchService.saveBatch(allRulesDTO.getKlRuleSearchList());
+        }
+        return true;
+    }
+
+    @DataProvider("getAllRuleIds")
+    public List<Long> setAllRules(
+            @InvokeParameter("ruleBaseQueryVO") RuleBaseQueryVO ruleBaseQueryVO,
+            @DataConsumer("getRuleNotHaveClass") List<RuleIdDTO> notHaveClassRuleIds,
+            @DataConsumer("getRuleHaveClass") List<RuleIdDTO> haveClassRuleIds) {
+        List<Long> ruleIds = new ArrayList<>();
+        if (ListUtil.isNotEmpty(notHaveClassRuleIds)){
+            ruleIds.addAll(notHaveClassRuleIds.stream().map(RuleIdDTO::getRuleId).distinct().collect(Collectors.toList()));
+        }
+        if (ListUtil.isNotEmpty(haveClassRuleIds)){
+            ruleIds.addAll(haveClassRuleIds.stream().map(RuleIdDTO::getRuleId).distinct().collect(Collectors.toList()));
+        }
+        if (ListUtil.isEmpty(ruleIds)){
+            ruleIds.add(-1000L);
+        }
+        return ruleIds;
+    }
+    @DataProvider("getRuleNotHaveClass")
+    public List<RuleIdDTO> getRuleNotHaveClass( @InvokeParameter("ruleBaseQueryVO") RuleBaseQueryVO ruleBaseQueryVO){
+        return klRuleFacade.getRuleNotHaveClass(ruleBaseQueryVO);
+    }
+
+    @DataProvider("getRuleHaveClass")
+    public List<RuleIdDTO> getRuleHaveClass( @InvokeParameter("ruleBaseQueryVO") RuleBaseQueryVO ruleBaseQueryVO){
+        return klRuleFacade.getRuleHaveClass(ruleBaseQueryVO);
+    }
+
+    public static void main(String[] args) {
+        List<List<RuleBaseDTO>> ruleBaseList = new ArrayList<>();
+        List<RuleBaseDTO> ruleBaseDTOListA = new ArrayList<>();
+        RuleBaseDTO baseDTOA = new RuleBaseDTO();
+        baseDTOA.setBaseLibName("A");
+        ruleBaseDTOListA.add(baseDTOA);
+        RuleBaseDTO baseDTOB = new RuleBaseDTO();
+        baseDTOB.setBaseLibName("B");
+        ruleBaseDTOListA.add(baseDTOB);
+        List<RuleBaseDTO> ruleBaseDTOListC = BeanUtil.listCopyTo(ruleBaseDTOListA, RuleBaseDTO.class);
+        ruleBaseList.add(ruleBaseDTOListC);
+        RuleBaseDTO baseDTOC = new RuleBaseDTO();
+        baseDTOC.setBaseLibName("C");
+        ruleBaseDTOListA.add(baseDTOC);
+        ruleBaseList.add(ruleBaseDTOListA);
+        List<RuleBaseDTO> ruleBaseDTOList1 = new ArrayList<>();
+        RuleBaseDTO baseDTO1 = new RuleBaseDTO();
+        baseDTO1.setBaseLibName("1");
+        ruleBaseDTOList1.add(baseDTO1);
+        RuleBaseDTO baseDTO2 = new RuleBaseDTO();
+        baseDTO2.setBaseLibName("2");
+        ruleBaseDTOList1.add(baseDTO2);
+        ruleBaseList.add(ruleBaseDTOList1);
+        List<List<RuleBaseDTO>> ruleBaseGroup = new ArrayList<>();
+        descartes(ruleBaseList, ruleBaseGroup, 0, new ArrayList<>());
+        System.out.println();
+    }
+
+}

+ 24 - 0
src/main/java/com/diagbot/client/CRFServiceClient.java

@@ -0,0 +1,24 @@
+package com.diagbot.client;
+
+
+import com.diagbot.client.hystrix.CRFServiceHystrix;
+import com.diagbot.vo.CRFVo;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+
+/**
+ * @Description: 调用条件随机场服务
+ * @author: Mark Huang
+ * @time: 2019/12/13 9:52
+ */
+@FeignClient(value = "CRF-service", url="${CRF.url}", fallback = CRFServiceHystrix.class)
+public interface CRFServiceClient {
+
+    @PostMapping(value = "/api/mr_info_ex/entity_predict")
+    String getAnnotation(@RequestBody CRFVo crfVo);
+}
+
+
+

+ 17 - 0
src/main/java/com/diagbot/client/IcssPush5ServiceClient.java

@@ -0,0 +1,17 @@
+package com.diagbot.client;
+
+
+/**
+ * @Description: ICSS5.0推送
+ * @author: Mark Huang
+ * @time: 2019/12/13 9:52
+ */
+//@FeignClient(value = "IcssPush5-service", url="${IcssPush5.url}", fallback = IcssPush5ServiceHystrix.class)
+//public interface IcssPush5ServiceClient {
+//
+//    @PostMapping(value = "/api/ltapi/push/push")
+//    RespDTO<PushDTO> getAnnotation(@RequestBody com.diagbot.icss5.PushVO searchData);
+//}
+
+
+

+ 26 - 0
src/main/java/com/diagbot/client/IcssPushServiceClient.java

@@ -0,0 +1,26 @@
+package com.diagbot.client;
+
+
+import com.diagbot.client.hystrix.IcssPushServiceHystrix;
+import com.diagbot.dto.icss.Response;
+import com.diagbot.dto.icss.ResponseData;
+import com.diagbot.vo.IcssVo;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+
+/**
+ * @Description: ICSS5.0推送
+ * @author: Mark Huang
+ * @time: 2019/12/13 9:52
+ */
+@FeignClient(value = "IcssPush-service", url="${IcssPush.url}", fallback = IcssPushServiceHystrix.class)
+public interface IcssPushServiceClient {
+
+    @PostMapping(value = "/push-web/algorithm/neural")
+    Response<ResponseData> getAnnotation(@RequestBody IcssVo searchData);
+}
+
+
+

+ 27 - 0
src/main/java/com/diagbot/client/PushNewServiceClient.java

@@ -0,0 +1,27 @@
+package com.diagbot.client;
+
+import com.diagbot.client.hystrix.PushNewServiceHystrix;
+import com.diagbot.dto.PushNewDTO;
+import com.diagbot.dto.PushReloadDTO;
+import com.diagbot.vo.PushNewVO;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+/**
+ * @description: CDSS新推送
+ * @author: zhoutg
+ * @date: 2021/3/24 15:24
+ */
+@FeignClient(value = "PushNew-service", url="${PushNew.url}", fallback = PushNewServiceHystrix.class)
+public interface PushNewServiceClient {
+
+    @PostMapping(value = "/api/disease")
+    PushNewDTO pushNew(@RequestBody PushNewVO pushNewVO);
+
+    @PostMapping(value = "/api/reloadPushDB")
+    PushReloadDTO reloadPushDB();
+}
+
+
+

+ 27 - 0
src/main/java/com/diagbot/client/StandConvertNewServiceClient.java

@@ -0,0 +1,27 @@
+package com.diagbot.client;
+
+import com.diagbot.dto.StandConvertCrfBatchDTO;
+import com.diagbot.dto.StandConvertCrfDTO;
+import com.diagbot.vo.StandConvertCrfVO;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+
+import java.util.List;
+
+/**
+ * @description: 标准词转换
+ * @author: zhoutg
+ * @date: 2020/8/12 10:41
+ */
+@FeignClient(value = "StandConvertNew-service", url="${StandConvertNew.url}")
+public interface StandConvertNewServiceClient {
+
+    @PostMapping(value = "/api/similarity")
+    StandConvertCrfDTO similarity(StandConvertCrfVO standConvertCrfVO);
+
+    @PostMapping(value = "/es/word_type_body")
+    StandConvertCrfBatchDTO similarityBatch(List<StandConvertCrfVO> standConvertCrfVOList);
+}
+
+
+

+ 27 - 0
src/main/java/com/diagbot/client/StandConvertServiceClient.java

@@ -0,0 +1,27 @@
+package com.diagbot.client;
+
+import com.diagbot.dto.StandConvertCrfBatchDTO;
+import com.diagbot.dto.StandConvertCrfDTO;
+import com.diagbot.vo.StandConvertCrfVO;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+
+import java.util.List;
+
+/**
+ * @description: 标准词转换
+ * @author: zhoutg
+ * @date: 2020/8/12 10:41
+ */
+@FeignClient(value = "StandConvert-service", url="${StandConvert.url}")
+public interface StandConvertServiceClient {
+
+    @PostMapping(value = "/api/similarity")
+    StandConvertCrfDTO similarity(StandConvertCrfVO standConvertCrfVO);
+
+    @PostMapping(value = "/api/similarity_batch")
+    StandConvertCrfBatchDTO similarityBatch(List<StandConvertCrfVO> standConvertCrfVOList);
+}
+
+
+

+ 18 - 0
src/main/java/com/diagbot/client/hystrix/CRFServiceHystrix.java

@@ -0,0 +1,18 @@
+package com.diagbot.client.hystrix;
+
+import com.diagbot.client.CRFServiceClient;
+import com.diagbot.util.GsonUtil;
+import com.diagbot.vo.CRFVo;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.RequestBody;
+
+@Component
+@Slf4j
+public class CRFServiceHystrix implements CRFServiceClient {
+    @Override
+    public String getAnnotation(@RequestBody CRFVo crfVo) {
+        log.error("CRF解析文本【超时】或【服务出错】,参数如下{}", GsonUtil.toJson(crfVo));
+        return null;
+    }
+}

+ 11 - 0
src/main/java/com/diagbot/client/hystrix/IcssPush5ServiceHystrix.java

@@ -0,0 +1,11 @@
+package com.diagbot.client.hystrix;
+
+//@Component
+//@Slf4j
+//public class IcssPush5ServiceHystrix implements IcssPush5ServiceClient {
+//    @Override
+//    public RespDTO<PushDTO> getAnnotation(@RequestBody com.diagbot.icss5.PushVO searchData) {
+//        log.error("【hystrix】调用{}异常", "CRF-getAnnotation");
+//        return null;
+//    }
+//}

+ 19 - 0
src/main/java/com/diagbot/client/hystrix/IcssPushServiceHystrix.java

@@ -0,0 +1,19 @@
+package com.diagbot.client.hystrix;
+
+import com.diagbot.client.IcssPushServiceClient;
+import com.diagbot.dto.icss.Response;
+import com.diagbot.dto.icss.ResponseData;
+import com.diagbot.vo.IcssVo;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.RequestBody;
+
+@Component
+@Slf4j
+public class IcssPushServiceHystrix implements IcssPushServiceClient {
+    @Override
+    public Response<ResponseData> getAnnotation(@RequestBody IcssVo searchData) {
+        log.error("【hystrix】调用{}异常", "ICSS5推理服务");
+        return null;
+    }
+}

+ 25 - 0
src/main/java/com/diagbot/client/hystrix/PushNewServiceHystrix.java

@@ -0,0 +1,25 @@
+package com.diagbot.client.hystrix;
+
+import com.diagbot.client.PushNewServiceClient;
+import com.diagbot.dto.PushNewDTO;
+import com.diagbot.dto.PushReloadDTO;
+import com.diagbot.vo.PushNewVO;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+@Component
+@Slf4j
+public class PushNewServiceHystrix implements PushNewServiceClient {
+
+    @Override
+    public PushNewDTO pushNew(PushNewVO pushNewVO) {
+        log.error("【hystrix】调用{}异常", "pushNew");
+        return null;
+    }
+
+    @Override
+    public PushReloadDTO reloadPushDB() {
+        log.error("【hystrix】调用{}异常", "reloadDB");
+        return null;
+    }
+}

+ 27 - 0
src/main/java/com/diagbot/client/hystrix/StandConvertNewServiceHystrix.java

@@ -0,0 +1,27 @@
+package com.diagbot.client.hystrix;
+
+import com.diagbot.client.StandConvertNewServiceClient;
+import com.diagbot.dto.StandConvertCrfBatchDTO;
+import com.diagbot.dto.StandConvertCrfDTO;
+import com.diagbot.vo.StandConvertCrfVO;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+@Component
+@Slf4j
+public class StandConvertNewServiceHystrix implements StandConvertNewServiceClient {
+
+    @Override
+    public StandConvertCrfDTO similarity(StandConvertCrfVO standConvertCrfVO) {
+        log.error("【hystrix】调用{}异常", "similarity");
+        return null;
+    }
+
+    @Override
+    public StandConvertCrfBatchDTO similarityBatch(List<StandConvertCrfVO> standConvertCrfVOList) {
+        log.error("【hystrix】调用{}异常", "similarityBatch");
+        return null;
+    }
+}

+ 27 - 0
src/main/java/com/diagbot/client/hystrix/StandConvertServiceHystrix.java

@@ -0,0 +1,27 @@
+package com.diagbot.client.hystrix;
+
+import com.diagbot.client.StandConvertServiceClient;
+import com.diagbot.dto.StandConvertCrfBatchDTO;
+import com.diagbot.dto.StandConvertCrfDTO;
+import com.diagbot.vo.StandConvertCrfVO;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+@Component
+@Slf4j
+public class StandConvertServiceHystrix implements StandConvertServiceClient {
+
+    @Override
+    public StandConvertCrfDTO similarity(StandConvertCrfVO standConvertCrfVO) {
+        log.error("【hystrix】调用{}异常", "similarity");
+        return null;
+    }
+
+    @Override
+    public StandConvertCrfBatchDTO similarityBatch(List<StandConvertCrfVO> standConvertCrfVOList) {
+        log.error("【hystrix】调用{}异常", "similarityBatch");
+        return null;
+    }
+}

+ 78 - 0
src/main/java/com/diagbot/config/CacheDeleteInit.java

@@ -0,0 +1,78 @@
+package com.diagbot.config;
+
+import com.diagbot.facade.CacheFacade;
+import com.diagbot.facade.ConceptInfoFacade;
+import com.diagbot.facade.NeoFacade;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.CommandLineRunner;
+import org.springframework.core.annotation.Order;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description: 项目启动后初始化缓存
+ * @author: gaodm
+ * @time: 2020/5/13 11:20
+ */
+@Component //把类交给spring容器管理
+@Order(100)  //使用order属性,设置该类在spring容器中的加载顺序
+@Slf4j
+public class CacheDeleteInit implements CommandLineRunner {
+
+    @Autowired
+    CacheFacade cacheFacade;
+    @Autowired
+    NeoFacade neoFacade;
+    @Autowired
+    private ConceptInfoFacade conceptInfoFacade;
+
+    @Override
+    public void run(String... args) {
+        // 服务启动清除redis缓存
+        cacheFacade.clear();
+        log.info("CDSS-CORE服务启动清除redis缓存成功!");
+
+       // cacheFacade.loadDrugTypeCache();
+       // log.info("CDSS-CORE服务启动加载药品类型对应关系缓存成功!");
+
+        cacheFacade.getDiseaseCorrespondCache();
+        log.info("CDSS-CORE服务启动加载疾病对应ICD10缓存成功!");
+
+        cacheFacade.getdiseaseFilterCache();
+        log.info("CDSS-CORE服务启动加载疾病过滤缓存成功!");
+
+        cacheFacade.loadPushModel();
+        log.info("CDSS-CORE服务启动加载医院推送类型成功!");
+
+        cacheFacade.loadDeptPush();
+        log.info("CDSS-CORE服务启动加载科室和推送映射成功!");
+
+        cacheFacade.loadFrequency();
+        log.info("CDSS-CORE服务启动加载开单频次成功!");
+
+        cacheFacade.loadMsg();
+        log.info("CDSS-CORE服务启动加载开单提示语成功!");
+
+        cacheFacade.loadDateInterval();
+        log.info("CDSS-CORE加载开单时间间隔成功!");
+
+        cacheFacade.loadVteAdviceCache();
+        log.info("CDSS-CORE服务启动加载vte医嘱数据成功!");
+
+        conceptInfoFacade.loadCustomDictionary();
+        log.info("CDSS-CORE服务启动加载NLP分词字典成功!");
+
+        cacheFacade.clearStandConvert();
+        log.info("CDSS-CORE服务启动清除标准词转换缓存成功!");
+
+        cacheFacade.loadAllBaseDiagnoseCache();
+        log.info("CDSS-CORE服务启动加载诊断依据缓存成功!");
+
+        long t1 = System.currentTimeMillis();
+        cacheFacade.loadAllRuleCache();
+        long t2 = System.currentTimeMillis();
+        log.info("CDSS-CORE服务启动加载医学知识库中的所有规则缓存成功!耗时:" + (t2 - t1)/ 1000.0 + "秒");
+
+        log.info("CDSS-CORE初始化完成!");
+    }
+}

+ 30 - 0
src/main/java/com/diagbot/config/CorsConfiguer.java

@@ -0,0 +1,30 @@
+package com.diagbot.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.cors.CorsConfiguration;
+import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
+import org.springframework.web.filter.CorsFilter;
+
+/**
+ * @Description:
+ * @author: zhoutg
+ * @time: 2020/4/12 15:56
+ */
+@Configuration
+public class CorsConfiguer {
+    private CorsConfiguration buildConfig() {
+        CorsConfiguration corsConfiguration = new CorsConfiguration();
+        corsConfiguration.addAllowedOrigin("*"); // 允许的域名
+        corsConfiguration.addAllowedHeader("*"); // 允许的请求头
+        corsConfiguration.addAllowedMethod("*"); // 允许的方法(post、get等)
+        return corsConfiguration;
+    }
+
+    @Bean
+    public CorsFilter corsFilter() {
+        UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
+        source.registerCorsConfiguration("/**", buildConfig()); // 对接口配置跨域设置
+        return new CorsFilter(source);
+    }
+}

+ 73 - 0
src/main/java/com/diagbot/config/KryoRedisSerializer.java

@@ -0,0 +1,73 @@
+package com.diagbot.config;
+
+import com.esotericsoftware.kryo.Kryo;
+import com.esotericsoftware.kryo.io.Input;
+import com.esotericsoftware.kryo.io.Output;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.data.redis.serializer.RedisSerializer;
+import org.springframework.data.redis.serializer.SerializationException;
+import org.xerial.snappy.Snappy;
+
+import java.io.ByteArrayOutputStream;
+
+/**
+ * @Description: KryoRedis 序列化工具
+ * @author: gaodm
+ * @time: 2021/12/16 13:12
+ */
+@Slf4j
+public class KryoRedisSerializer<T> implements RedisSerializer<T> {
+    public static final byte[] EMPTY_BYTE_ARRAY = new byte[0];
+
+    private static final ThreadLocal<Kryo> kryos = ThreadLocal.withInitial(Kryo::new);
+
+    private final Class<T> clazz;
+
+    public KryoRedisSerializer(Class<T> clazz) {
+        super();
+        this.clazz = clazz;
+    }
+
+    @Override
+    public byte[] serialize(T t) throws SerializationException {
+        if (t == null) {
+            return EMPTY_BYTE_ARRAY;
+        }
+
+        Kryo kryo = kryos.get();
+        kryo.setRegistrationRequired(false);
+        kryo.setReferences(false);
+        kryo.register(clazz);
+
+        try (ByteArrayOutputStream baos = new ByteArrayOutputStream();
+             Output output = new Output(baos)) {
+            kryo.writeClassAndObject(output, t);
+            output.flush();
+            return Snappy.compress(baos.toByteArray()); //压缩
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+        }
+        return EMPTY_BYTE_ARRAY;
+    }
+
+    @Override
+    public T deserialize(byte[] bytes) throws SerializationException {
+        if (bytes == null || bytes.length <= 0) {
+            return null;
+        }
+
+        Kryo kryo = kryos.get();
+        kryo.setRegistrationRequired(false);
+        kryo.setReferences(false);
+        kryo.register(clazz);
+
+        try (Input input = new Input(Snappy.uncompress(bytes))) { //解压
+            return (T) kryo.readClassAndObject(input);
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+        }
+        return null;
+    }
+
+}
+

+ 39 - 0
src/main/java/com/diagbot/config/MybatisPlusConfigurer.java

@@ -0,0 +1,39 @@
+package com.diagbot.config;
+
+import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
+import com.diagbot.config.mybatisLike.MybatisLikeSqlInterceptor;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+/**
+ * @Description: MybatisPlus配置类
+ * @author: zhoutg
+ * @time: 2018/8/2 13:39
+ */
+@EnableTransactionManagement
+@Configuration
+@MapperScan("com.diagbot.mapper*")//这个注解,作用相当于下面的@Bean MapperScannerConfigurer,2者配置1份即可
+public class MybatisPlusConfigurer {
+
+    /**
+     * mybatis-plus分页插件<br>
+     * 文档:http://mp.baomidou.com<br>
+     */
+    @Bean
+    public PaginationInterceptor paginationInterceptor() {
+        PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
+        // 设置请求的页面大于最大页后操作,true调回到首页,false继续请求,默认false
+        //paginationInterceptor.setOverflow(false);
+        // 设置最大单页限制数量,默认500条,-1不受限制
+        paginationInterceptor.setLimit(-1L);
+        return paginationInterceptor;
+    }
+
+    @Bean
+    public MybatisLikeSqlInterceptor mybatisSqlInterceptor() {
+        return new MybatisLikeSqlInterceptor();
+    }
+
+}

+ 190 - 0
src/main/java/com/diagbot/config/RedisConfigurer.java

@@ -0,0 +1,190 @@
+package com.diagbot.config;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.PropertyAccessor;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.pool2.impl.GenericObjectPoolConfig;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.cache.CacheManager;
+import org.springframework.cache.annotation.CachingConfigurerSupport;
+import org.springframework.cache.annotation.EnableCaching;
+import org.springframework.cache.interceptor.KeyGenerator;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+import org.springframework.data.redis.cache.RedisCacheConfiguration;
+import org.springframework.data.redis.cache.RedisCacheManager;
+import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
+import org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration;
+import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
+import org.springframework.data.redis.connection.lettuce.LettucePoolingClientConfiguration;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.RedisSerializationContext;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
+
+import java.time.Duration;
+
+@Configuration
+@EnableCaching
+@Slf4j
+public class RedisConfigurer extends CachingConfigurerSupport {
+
+    @Value("${spring.redis.database.cache}")
+    private String databaseCache;
+    @Value("${spring.redis.database.similar}")
+    private String databaseMr;
+    @Value("${spring.redis.host}")
+    private String host;
+    @Value("${spring.redis.password}")
+    private String password;
+    @Value("${spring.redis.port}")
+    private int port;
+    @Value("${spring.redis.timeout}")
+    private int timeout;
+    @Value("${spring.redis.lettuce.pool.max-active}")
+    private int maxActive;
+    @Value("${spring.redis.lettuce.pool.max-idle}")
+    private int maxIdle;
+    @Value("${spring.redis.lettuce.pool.max-wait}")
+    private long maxWaitMillis;
+    @Value("${spring.redis.lettuce.pool.min-idle}")
+    private int minIdle;
+
+    @Autowired
+    @Qualifier("factoryForCache")
+    private LettuceConnectionFactory lettuceConnectionFactory;
+
+    @Bean
+    public GenericObjectPoolConfig getRedisConfig() {
+        GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();
+        poolConfig.setMaxTotal(maxActive);
+        poolConfig.setMaxIdle(maxIdle);
+        poolConfig.setMaxWaitMillis(maxWaitMillis);
+        poolConfig.setMinIdle(minIdle);
+        return poolConfig;
+    }
+
+    @Bean
+    @Override
+    public CacheManager cacheManager() {
+        RedisCacheConfiguration redisCacheConfiguration = RedisCacheConfiguration.defaultCacheConfig()
+                // 设置 key为string序列化
+                .serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(new StringRedisSerializer()))
+                // 设置value为json序列化
+                .serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(getSerializer()))
+                // 不缓存空值
+                .disableCachingNullValues();
+        RedisCacheManager cacheManager = RedisCacheManager.builder(lettuceConnectionFactory)
+                .cacheDefaults(redisCacheConfiguration)
+                .transactionAware()
+                .build();
+        cacheManager.afterPropertiesSet();
+        log.info("RedisCacheManager config success");
+        return cacheManager;
+    }
+
+    @Bean(name = "springSessionDefaultRedisSerializer")
+    public GenericJackson2JsonRedisSerializer getGenericJackson2JsonRedisSerializer() {
+        return new GenericJackson2JsonRedisSerializer();
+    }
+
+    /**
+     * 缓存使用的redis
+     *
+     * @return
+     */
+    @Bean("factoryForCache")
+    @Primary
+    public LettuceConnectionFactory redisConnectionFactory() {
+        return getRedisConnectionFactory(Integer.valueOf(databaseCache));
+    }
+
+    @Bean
+    public RedisTemplate<String, Object> redisTemplate() {
+        return getRedisTemplate(lettuceConnectionFactory);
+    }
+
+    private KryoRedisSerializer getSerializer() {
+//        SnnpyJackson2JsonRedisSerializer jackson2JsonRedisSerializer = new SnnpyJackson2JsonRedisSerializer<>(Object.class);
+//        ObjectMapper om = new ObjectMapper();
+//        om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
+//        om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
+//        om.setSerializationInclusion(JsonInclude.Include.NON_NULL); // 空值不会序列化,从而减少序列化空间,提升效率
+//        jackson2JsonRedisSerializer.setObjectMapper(om);
+//        return jackson2JsonRedisSerializer;
+        KryoRedisSerializer  kryoRedisSerializer = new KryoRedisSerializer<>(Object.class);
+        return kryoRedisSerializer;
+    }
+
+    @Bean
+    @Override
+    public KeyGenerator keyGenerator() {
+        //  设置自动key的生成规则,配置spring boot的注解,进行方法级别的缓存
+        // 使用:进行分割,可以很多显示出层级关系
+        // 这里其实就是new了一个KeyGenerator对象
+        return (target, method, params) -> {
+            StringBuilder sb = new StringBuilder();
+            sb.append(target.getClass().getName());
+            sb.append(":");
+            sb.append(method.getName());
+            for (Object obj : params) {
+                sb.append(":" + obj);
+            }
+            String rsToUse = String.valueOf(sb);
+            log.info("自动生成Redis Key -> [{}]", rsToUse);
+            return rsToUse;
+        };
+    }
+
+    /**
+     * Similar使用的redis
+     *
+     * @return
+     */
+    @Bean("factoryForSimilar")
+    public LettuceConnectionFactory redisConnectionFactoryForToken() {
+        return getRedisConnectionFactory(Integer.valueOf(databaseMr));
+    }
+
+    @Bean(name = "redisTemplateForSimilar")
+    public RedisTemplate<String, Object> redisTemplateForToken(@Qualifier("factoryForSimilar") LettuceConnectionFactory factory) {
+        return getRedisTemplate(factory);
+    }
+
+
+    private LettuceConnectionFactory getRedisConnectionFactory(Integer database) {
+        RedisStandaloneConfiguration connection = new RedisStandaloneConfiguration();
+        connection.setHostName(host);
+        connection.setPort(port);
+        connection.setPassword(password);
+        connection.setDatabase(database);
+        GenericObjectPoolConfig poolConfig = getRedisConfig();
+        LettuceClientConfiguration builder = LettucePoolingClientConfiguration.builder()
+                .commandTimeout(Duration.ofMillis(timeout))
+                .poolConfig(poolConfig)
+                .shutdownTimeout(Duration.ZERO)
+                .build();
+        LettuceConnectionFactory factory = new LettuceConnectionFactory(connection, builder);
+        return factory;
+    }
+
+    private RedisTemplate<String, Object> getRedisTemplate(LettuceConnectionFactory factory) {
+        RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
+        redisTemplate.setConnectionFactory(factory);
+
+        // value值的序列化
+        redisTemplate.setValueSerializer(getSerializer());
+        redisTemplate.setHashValueSerializer(getSerializer());
+        // key的序列化采用StringRedisSerializer
+        redisTemplate.setKeySerializer(new StringRedisSerializer());
+        redisTemplate.setHashKeySerializer(new StringRedisSerializer());
+        redisTemplate.afterPropertiesSet();
+        return redisTemplate;
+    }
+}
+ 

+ 72 - 0
src/main/java/com/diagbot/config/SnnpyJackson2JsonRedisSerializer.java

@@ -0,0 +1,72 @@
+package com.diagbot.config;
+
+import com.fasterxml.jackson.databind.JavaType;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.type.TypeFactory;
+import org.springframework.data.redis.serializer.RedisSerializer;
+import org.springframework.data.redis.serializer.SerializationException;
+import org.springframework.lang.Nullable;
+import org.springframework.util.Assert;
+import org.xerial.snappy.Snappy;
+
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2021/12/15 15:29
+ */
+@Deprecated
+public class SnnpyJackson2JsonRedisSerializer<T> implements RedisSerializer<T> {
+    public static final Charset DEFAULT_CHARSET;
+    private final JavaType javaType;
+    private ObjectMapper objectMapper = new ObjectMapper();
+
+    public SnnpyJackson2JsonRedisSerializer(Class<T> type) {
+        this.javaType = this.getJavaType(type);
+    }
+
+    public SnnpyJackson2JsonRedisSerializer(JavaType javaType) {
+        this.javaType = javaType;
+    }
+
+    public T deserialize(@Nullable byte[] bytes) throws SerializationException {
+        if (bytes == null || bytes.length == 0) {
+            return null;
+        } else {
+            try {
+                final byte[] uncompressBytes = Snappy.uncompress(bytes); //解压
+                return this.objectMapper.readValue(uncompressBytes, 0, uncompressBytes.length, this.javaType);
+            } catch (Exception var3) {
+                throw new SerializationException("Could not read JSON: " + var3.getMessage(), var3);
+            }
+        }
+    }
+
+    public byte[] serialize(@Nullable Object t) throws SerializationException {
+        if (t == null) {
+            return new byte[0];
+        } else {
+            try {
+                final byte[] bytes = this.objectMapper.writeValueAsBytes(t);
+                return Snappy.compress(bytes); //压缩
+            } catch (Exception var3) {
+                throw new SerializationException("Could not write JSON: " + var3.getMessage(), var3);
+            }
+        }
+    }
+
+    public void setObjectMapper(ObjectMapper objectMapper) {
+        Assert.notNull(objectMapper, "'objectMapper' must not be null");
+        this.objectMapper = objectMapper;
+    }
+
+    protected JavaType getJavaType(Class<?> clazz) {
+        return TypeFactory.defaultInstance().constructType(clazz);
+    }
+
+    static {
+        DEFAULT_CHARSET = StandardCharsets.UTF_8;
+    }
+}

+ 68 - 0
src/main/java/com/diagbot/config/SwaggerConfigurer.java

@@ -0,0 +1,68 @@
+package com.diagbot.config;
+
+
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.service.Contact;
+import springfox.documentation.service.Parameter;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * @Description: Swagger配置类
+ * @author: zhoutg
+ * @time: 2018/8/2 14:21
+ */
+@Configuration
+@ConditionalOnProperty(prefix = "swagger", value = { "enable" }, havingValue = "true")
+@EnableSwagger2
+public class SwaggerConfigurer {
+    /**
+     * 全局参数
+     *
+     * @return
+     */
+    private List<Parameter> parameter() {
+        List<Parameter> params = new ArrayList<>();
+//        params.add(new ParameterBuilder().name("Authorization")
+//                .description("Authorization Bearer token")
+//                .modelRef(new ModelRef("string"))
+//                .parameterType("header")
+//                .required(false).build());
+        return params;
+    }
+
+
+    @Bean
+    public Docket sysApi() {
+        return new Docket(DocumentationType.SWAGGER_2)
+                .apiInfo(apiInfo())
+                .select()
+                .apis(RequestHandlerSelectors.basePackage("com.diagbot.web"))
+                .paths(PathSelectors.any())
+                .build().globalOperationParameters(parameter());
+        //.securitySchemes(newArrayList(oauth()))
+        // .securityContexts(newArrayList(securityContext()));
+    }
+
+    private ApiInfo apiInfo() {
+        return new ApiInfoBuilder()
+                .title("CDSS核心服务 api ")
+                .description("CDSS核心服务")
+                .termsOfServiceUrl("")
+                .contact(new Contact("diagbot","",""))
+                .version("1.0")
+                .build();
+    }
+
+}

+ 223 - 0
src/main/java/com/diagbot/config/mybatisLike/AbstractLikeSqlConverter.java

@@ -0,0 +1,223 @@
+package com.diagbot.config.mybatisLike;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+
+import java.beans.IntrospectionException;
+import java.beans.PropertyDescriptor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Set;
+
+
+/**
+ * @Description: 包含like的SQL语句转义模板
+ * @author: gaodm
+ * @time: 2020/11/2 16:05
+ */
+@Slf4j
+public abstract class AbstractLikeSqlConverter<T> {
+
+    /**
+     * SQL语句like使用关键字%
+     */
+    private final static String LIKE_SQL_KEY = "%";
+
+    /**
+     * SQL语句需要转义的关键字
+     */
+    private final static String[] ESCAPE_CHAR = new String[] { LIKE_SQL_KEY, "_", "\\" };
+
+    /**
+     * mybatis-plus中like的SQL语句样式
+     */
+    private final static String MYBATIS_PLUS_LIKE_SQL = " like ?";
+
+    /**
+     * mybatis-plus中参数前缀
+     */
+    private final static String MYBATIS_PLUS_WRAPPER_PREFIX = "ew.paramNameValuePairs.";
+
+    /**
+     * mybatis-plus中参数键
+     */
+    final static String MYBATIS_PLUS_WRAPPER_KEY = "ew";
+
+    /**
+     * mybatis-plus中参数分隔符
+     */
+    final static String MYBATIS_PLUS_WRAPPER_SEPARATOR = ".";
+
+    /**
+     * mybatis-plus中参数分隔符替换器
+     */
+    final static String MYBATIS_PLUS_WRAPPER_SEPARATOR_REGEX = "\\.";
+
+    /**
+     * 已经替换过的标记
+     */
+    final static String REPLACED_LIKE_KEYWORD_MARK = "replaced.keyword";
+
+    /**
+     * 转义特殊字符
+     *
+     * @param sql       SQL语句
+     * @param fields    字段列表
+     * @param parameter 参数对象
+     */
+    public void convert(String sql, Set<String> fields, T parameter) {
+        for (String field : fields) {
+            if (this.hasMybatisPlusLikeSql(sql)) {
+                if (this.hasWrapper(field)) {
+                    // 第一种情况:在业务层进行条件构造产生的模糊查询关键字,使用QueryWrapper,LambdaQueryWrapper
+                    this.transferWrapper(field, parameter);
+                } else {
+                    // 第二种情况:未使用条件构造器,但是在service层进行了查询关键字与模糊查询符`%`手动拼接
+                    this.transferSelf(field, parameter);
+                }
+            } else {
+                // 第三种情况:在Mapper类的注解SQL中进行了模糊查询的拼接
+                this.transferSplice(field, parameter);
+            }
+        }
+    }
+
+    /**
+     * 转义条件构造的特殊字符
+     * 在业务层进行条件构造产生的模糊查询关键字,使用QueryWrapper,LambdaQueryWrapper
+     *
+     * @param field     字段名称
+     * @param parameter 参数对象
+     */
+    public abstract void transferWrapper(String field, T parameter);
+
+    /**
+     * 转义自定义条件拼接的特殊字符
+     * 未使用条件构造器,但是在service层进行了查询关键字与模糊查询符`%`手动拼接
+     *
+     * @param field     字段名称
+     * @param parameter 参数对象
+     */
+    public abstract void transferSelf(String field, T parameter);
+
+    /**
+     * 转义自定义条件拼接的特殊字符
+     * 在Mapper类的注解SQL中进行了模糊查询的拼接
+     *
+     * @param field     字段名称
+     * @param parameter 参数对象
+     */
+    public abstract void transferSplice(String field, T parameter);
+
+    /**
+     * 转义通配符
+     *
+     * @param before 待转义字符串
+     * @return 转义后字符串
+     */
+    String escapeChar(String before) {
+        if (StringUtils.isNotBlank(before)) {
+            before = before.replaceAll("\\\\", "\\\\\\\\");
+            before = before.replaceAll("_", "\\\\_");
+            before = before.replaceAll("%", "\\\\%");
+        }
+        return before;
+    }
+
+    /**
+     * 是否包含需要转义的字符
+     *
+     * @param obj 待判断的对象
+     * @return true/false
+     */
+    boolean hasEscapeChar(Object obj) {
+        if (!(obj instanceof String)) {
+            return false;
+        }
+        return this.hasEscapeChar((String) obj);
+    }
+
+    /**
+     * 处理对象like问题
+     *
+     * @param field     对象字段
+     * @param parameter 对象
+     */
+    void resolveObj(String field, Object parameter) {
+        if (parameter == null || StringUtils.isBlank(field)) {
+            return;
+        }
+        try {
+            PropertyDescriptor descriptor = new PropertyDescriptor(field, parameter.getClass());
+            Method readMethod = descriptor.getReadMethod();
+            Object param = readMethod.invoke(parameter);
+            if (this.hasEscapeChar(param)) {
+                Method setMethod = descriptor.getWriteMethod();
+                setMethod.invoke(parameter, this.escapeChar(param.toString()));
+            } else if (this.cascade(field)) {
+                int index = field.indexOf(MYBATIS_PLUS_WRAPPER_SEPARATOR) + 1;
+                this.resolveObj(field.substring(index), param);
+            }
+        } catch (IntrospectionException | IllegalAccessException | InvocationTargetException e) {
+            log.error("反射 {} 的 {} get/set方法出现异常", parameter, field, e);
+        }
+    }
+
+    /**
+     * 判断是否是级联属性
+     *
+     * @param field 字段名
+     * @return true/false
+     */
+    boolean cascade(String field) {
+        if (StringUtils.isBlank(field)) {
+            return false;
+        }
+        return field.contains(MYBATIS_PLUS_WRAPPER_SEPARATOR) && !this.hasWrapper(field);
+    }
+
+    /**
+     * 是否包含mybatis-plus的包含like的SQL语句格式
+     *
+     * @param sql 完整SQL语句
+     * @return true/false
+     */
+    private boolean hasMybatisPlusLikeSql(String sql) {
+        if (StringUtils.isBlank(sql)) {
+            return false;
+        }
+        return sql.toLowerCase().contains(MYBATIS_PLUS_LIKE_SQL);
+    }
+
+    /**
+     * 判断是否使用mybatis-plus条件构造器
+     *
+     * @param field 字段
+     * @return true/false
+     */
+    private boolean hasWrapper(String field) {
+        if (StringUtils.isBlank(field)) {
+            return false;
+        }
+        return field.contains(MYBATIS_PLUS_WRAPPER_PREFIX);
+    }
+
+    /**
+     * 判断字符串是否含有需要转义的字符
+     *
+     * @param str 待判断的字符串
+     * @return true/false
+     */
+    private boolean hasEscapeChar(String str) {
+        if (StringUtils.isBlank(str)) {
+            return false;
+        }
+        for (String s : ESCAPE_CHAR) {
+            if (str.contains(s)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+}

+ 79 - 0
src/main/java/com/diagbot/config/mybatisLike/MapLikeSqlConverter.java

@@ -0,0 +1,79 @@
+package com.diagbot.config.mybatisLike;
+
+import com.baomidou.mybatisplus.core.conditions.AbstractWrapper;
+
+import java.util.Map;
+import java.util.Objects;
+
+/**
+ * @Description: 参数对象为Map的转换器
+ * @author: gaodm
+ * @time: 2020/11/2 16:07
+ */
+public class MapLikeSqlConverter extends AbstractLikeSqlConverter<Map> {
+
+    @Override
+    public void transferWrapper(String field, Map parameter) {
+        AbstractWrapper wrapper = (AbstractWrapper) parameter.get(MYBATIS_PLUS_WRAPPER_KEY);
+        parameter = wrapper.getParamNameValuePairs();
+        String[] keys = field.split(MYBATIS_PLUS_WRAPPER_SEPARATOR_REGEX);
+        // ew.paramNameValuePairs.param1,截取字符串之后,获取第三个,即为参数名
+        String paramName = keys[2];
+        String mapKey = String.format("%s.%s", REPLACED_LIKE_KEYWORD_MARK, paramName);
+        if (parameter.containsKey(mapKey) && Objects.equals(parameter.get(mapKey), true)) {
+            return;
+        }
+        if (this.cascade(field)) {
+            this.resolveCascadeObj(field, parameter);
+        } else {
+            Object param = parameter.get(paramName);
+            if (this.hasEscapeChar(param)) {
+                String paramStr = param.toString();
+                parameter.put(keys[2], String.format("%%%s%%", this.escapeChar(paramStr.substring(1, paramStr.length() - 1))));
+            }
+        }
+        parameter.put(mapKey, true);
+    }
+
+    @Override
+    public void transferSelf(String field, Map parameter) {
+        if (this.cascade(field)) {
+            this.resolveCascadeObj(field, parameter);
+            return;
+        }
+        Object param = parameter.get(field);
+        if (this.hasEscapeChar(param)) {
+            String paramStr = param.toString();
+            parameter.put(field, String.format("%%%s%%", this.escapeChar(paramStr.substring(1, paramStr.length() - 1))));
+        }
+    }
+
+    @Override
+    public void transferSplice(String field, Map parameter) {
+        if (this.cascade(field)) {
+            this.resolveCascadeObj(field, parameter);
+            return;
+        }
+        Object param = parameter.get(field);
+        if (this.hasEscapeChar(param)) {
+            parameter.put(field, this.escapeChar(param.toString()));
+        }
+    }
+
+    /**
+     * 处理级联属性
+     *
+     * @param field     级联字段名
+     * @param parameter 参数Map对象
+     */
+    private void resolveCascadeObj(String field, Map parameter) {
+        int index = field.indexOf(MYBATIS_PLUS_WRAPPER_SEPARATOR);
+        Object param = parameter.get(field.substring(0, index));
+        if (param == null) {
+            return;
+        }
+        this.resolveObj(field.substring(index + 1), param);
+    }
+
+}
+

+ 160 - 0
src/main/java/com/diagbot/config/mybatisLike/MybatisLikeSqlInterceptor.java

@@ -0,0 +1,160 @@
+package com.diagbot.config.mybatisLike;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.ibatis.executor.Executor;
+import org.apache.ibatis.mapping.BoundSql;
+import org.apache.ibatis.mapping.MappedStatement;
+import org.apache.ibatis.plugin.Interceptor;
+import org.apache.ibatis.plugin.Intercepts;
+import org.apache.ibatis.plugin.Invocation;
+import org.apache.ibatis.plugin.Plugin;
+import org.apache.ibatis.plugin.Signature;
+import org.apache.ibatis.session.ResultHandler;
+import org.apache.ibatis.session.RowBounds;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+/**
+ * @Description: mybatis/mybatis-plus模糊查询语句特殊字符转义拦截器
+ * @author: gaodm
+ * @time: 2020/11/2 16:04
+ */
+@Intercepts({ @Signature(type = Executor.class, method = "query", args = { MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class }) })
+@Slf4j
+public class MybatisLikeSqlInterceptor implements Interceptor {
+
+    /**
+     * SQL语句like
+     */
+    private final static String SQL_LIKE = " like ";
+
+    /**
+     * SQL语句占位符
+     */
+    private final static String SQL_PLACEHOLDER = "?";
+
+    /**
+     * SQL语句占位符分隔
+     */
+    private final static String SQL_PLACEHOLDER_REGEX = "\\?";
+
+    /**
+     * 所有的转义器
+     */
+    private static final Map<Class, AbstractLikeSqlConverter> converterMap = new HashMap<>(4);
+
+    static {
+        converterMap.put(Map.class, new MapLikeSqlConverter());
+        converterMap.put(Object.class, new ObjectLikeSqlConverter());
+    }
+
+    @Override
+    public Object intercept(Invocation invocation) throws Throwable {
+        Object[] args = invocation.getArgs();
+        MappedStatement statement = (MappedStatement) args[0];
+        Object parameterObject = args[1];
+        BoundSql boundSql = statement.getBoundSql(parameterObject);
+        String sql = boundSql.getSql();
+        this.transferLikeSql(sql, parameterObject, boundSql);
+        return invocation.proceed();
+    }
+
+    @Override
+    public Object plugin(Object target) {
+        return Plugin.wrap(target, this);
+    }
+
+    @Override
+    public void setProperties(Properties arg0) {
+
+    }
+
+    /**
+     * 修改包含like的SQL语句
+     *
+     * @param sql             SQL语句
+     * @param parameterObject 参数对象
+     * @param boundSql        绑定SQL对象
+     */
+    private void transferLikeSql(String sql, Object parameterObject, BoundSql boundSql) {
+        if (!isEscape(sql)) {
+            return;
+        }
+        sql = sql.replaceAll(" {2}", " ");
+        // 获取关键字的个数(去重)
+        Set<String> fields = this.getKeyFields(sql, boundSql);
+        if (fields == null) {
+            return;
+        }
+        // 此处可以增强,不止是支持Map对象,Map对象仅用于传入的条件为Map或者使用@Param传入的对象被Mybatis转为的Map
+        AbstractLikeSqlConverter converter;
+        // 对关键字进行特殊字符“清洗”,如果有特殊字符的,在特殊字符前添加转义字符(\)
+        if (parameterObject instanceof Map) {
+            converter = converterMap.get(Map.class);
+        } else {
+            converter = converterMap.get(Object.class);
+        }
+        converter.convert(sql, fields, parameterObject);
+    }
+
+    /**
+     * 是否需要转义
+     *
+     * @param sql SQL语句
+     * @return true/false
+     */
+    private boolean isEscape(String sql) {
+        return this.hasLike(sql) && this.hasPlaceholder(sql);
+    }
+
+    /**
+     * 判断SQL语句中是否含有like关键字
+     *
+     * @param str SQL语句
+     * @return true/false
+     */
+    private boolean hasLike(String str) {
+        if (StringUtils.isBlank(str)) {
+            return false;
+        }
+        return str.toLowerCase().contains(SQL_LIKE);
+    }
+
+    /**
+     * 判断SQL语句中是否包含SQL占位符
+     *
+     * @param str SQL语句
+     * @return true/false
+     */
+    private boolean hasPlaceholder(String str) {
+        if (StringUtils.isBlank(str)) {
+            return false;
+        }
+        return str.toLowerCase().contains(SQL_PLACEHOLDER);
+    }
+
+    /**
+     * 获取需要替换的所有字段集合
+     *
+     * @param sql      完整SQL语句
+     * @param boundSql 绑定的SQL对象
+     * @return 字段集合列表
+     */
+    private Set<String> getKeyFields(String sql, BoundSql boundSql) {
+        String[] params = sql.split(SQL_PLACEHOLDER_REGEX);
+        Set<String> fields = new HashSet<>();
+        for (int i = 0; i < params.length; i++) {
+            if (this.hasLike(params[i])) {
+                String field = boundSql.getParameterMappings().get(i).getProperty();
+                fields.add(field);
+            }
+        }
+        return fields;
+    }
+
+}

+ 28 - 0
src/main/java/com/diagbot/config/mybatisLike/ObjectLikeSqlConverter.java

@@ -0,0 +1,28 @@
+package com.diagbot.config.mybatisLike;
+
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * @Description: 通用参数的转换器
+ * @author: gaodm
+ * @time: 2020/11/2 16:06
+ */
+@Slf4j
+public class ObjectLikeSqlConverter extends AbstractLikeSqlConverter<Object> {
+
+    @Override
+    public void transferWrapper(String field, Object parameter) {
+        // 尚未发现这种情况
+    }
+
+    @Override
+    public void transferSelf(String field, Object parameter) {
+        // 尚未发现这种情况
+    }
+
+    @Override
+    public void transferSplice(String field, Object parameter) {
+        this.resolveObj(field, parameter);
+    }
+
+}

+ 26 - 0
src/main/java/com/diagbot/dto/AllRulesDTO.java

@@ -0,0 +1,26 @@
+package com.diagbot.dto;
+
+import com.diagbot.entity.KlRuleSearch;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2022/2/22 14:21
+ */
+@Getter
+@Setter
+public class AllRulesDTO {
+    //有效规则Map
+    Map<String, RuleDTO> ruleDTOMap = new HashMap();
+    //药物过敏源
+    Map<String, Integer> drugAllergen = new HashMap<>();
+    //规则搜索有效的规则ID
+    List<KlRuleSearch> klRuleSearchList = new ArrayList<>();
+}

+ 19 - 0
src/main/java/com/diagbot/dto/AnesthesiaInfoDTO.java

@@ -0,0 +1,19 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/4/23 10:55
+ */
+@Getter
+@Setter
+public class AnesthesiaInfoDTO {
+    private Long id;
+    /**
+     * 麻醉名称
+     */
+    private String name;
+}

+ 82 - 0
src/main/java/com/diagbot/dto/BaseDiagnoseDTO.java

@@ -0,0 +1,82 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2021/3/15 10:49
+ */
+@Data
+public class BaseDiagnoseDTO {
+
+    /**
+     * id逗号隔开
+     */
+    private String ids;
+
+    /**
+     * 医学基本术语
+     */
+    private String baseLibName;
+
+    /**
+     * 术语类型
+     */
+    private Integer baseLibType;
+
+    /**
+     * 多个概念id
+     */
+    private String baseConceptids;
+
+    /**
+     * 基础规则类型(1:等于术语本身;2:存在比较;3:不等于术语本身;)
+     */
+    private Integer baseType;
+
+    /**
+     * 最小域比较符
+     */
+    private String baseMinOperator;
+
+    /**
+     * 最小域值
+     */
+    private String baseMinValue;
+
+    /**
+     * 最小域单位
+     */
+    private String baseMinUnit;
+
+    /**
+     * 最大域比较符
+     */
+    private String baseMaxOperator;
+
+    /**
+     * 最大域值
+     */
+    private String baseMaxValue;
+
+    /**
+     * 最大域单位
+     */
+    private String baseMaxUnit;
+
+    /**
+     * 等于域比较符
+     */
+    private String baseEqOperator;
+
+    /**
+     * 等于域值
+     */
+    private String baseEqValue;
+
+    /**
+     * 等于域单位
+     */
+    private String baseEqUnit;
+}

+ 84 - 0
src/main/java/com/diagbot/dto/BaseRegulationDTO.java

@@ -0,0 +1,84 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: zhoutg
+ * @time: 2021/3/15 10:49
+ */
+@Getter
+@Setter
+public class BaseRegulationDTO {
+
+    /**
+     * id逗号隔开
+     */
+    private String ids;
+
+    /**
+     * 医学基本术语
+     */
+    private String baseLibName;
+
+    /**
+     * 术语类型
+     */
+    private Integer baseLibType;
+
+    /**
+     * 多个概念id
+     */
+    private String baseConceptids;
+
+    /**
+     * 基础规则类型(1:等于术语本身;2:存在比较;3:不等于术语本身;)
+     */
+    private Integer baseType;
+
+    /**
+     * 最小域比较符
+     */
+    private String baseMinOperator;
+
+    /**
+     * 最小域值
+     */
+    private String baseMinValue;
+
+    /**
+     * 最小域单位
+     */
+    private String baseMinUnit;
+
+    /**
+     * 最大域比较符
+     */
+    private String baseMaxOperator;
+
+    /**
+     * 最大域值
+     */
+    private String baseMaxValue;
+
+    /**
+     * 最大域单位
+     */
+    private String baseMaxUnit;
+
+    /**
+     * 等于域比较符
+     */
+    private String baseEqOperator;
+
+    /**
+     * 等于域值
+     */
+    private String baseEqValue;
+
+    /**
+     * 等于域单位
+     */
+    private String baseEqUnit;
+}

+ 33 - 0
src/main/java/com/diagbot/dto/BillDTO.java

@@ -0,0 +1,33 @@
+package com.diagbot.dto;
+
+import com.google.common.collect.Lists;
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Description: 开单提示语
+ * @Author:zhoutg
+ * @time: 2020/8/12 15:53
+ */
+@Data
+public class BillDTO {
+    // 通用匹配内容
+    private String content;
+    // 禁忌类型
+    private String conType = "";
+    // 匹配条数
+    private int matchNum = 0;
+    // 性别拼接提示语
+    private String sexMsg = "";
+    // 年龄拼接提示语
+    private String ageMsg = "";
+    // 诊断拼接提示语
+    private List<String> diseaseMsg = Lists.newArrayList();
+    // 人群拼接提示语
+    private String groupMsg = "";
+
+
+    private List<String> lisMsg = new ArrayList<>(); // 化验拼接提示语——暂无数据
+}

+ 44 - 0
src/main/java/com/diagbot/dto/BillMsg.java

@@ -0,0 +1,44 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+import java.util.Objects;
+
+/**
+ * @description: 开单合理性提示语
+ * @author: zhoutg
+ * @time: 2020/7/29 9:57
+ */
+@Data
+public class BillMsg {
+
+    // 提示信息
+    private String msg;
+    // 开单名称
+    private String orderName;
+    // 明细名称
+    private String orderDetailName;
+    // 开单标准名称
+    private String orderStandName;
+    // 匹配的内容
+    private String content;
+    // 类型
+    private String type;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        BillMsg billMsg = (BillMsg) o;
+        return Objects.equals(msg, billMsg.msg);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(msg);
+    }
+}

+ 18 - 0
src/main/java/com/diagbot/dto/Cn2SpellDTO.java

@@ -0,0 +1,18 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/9/22 16:05
+ */
+@Getter
+@Setter
+public class Cn2SpellDTO {
+    private List<Cn2SpellDetailDTO> cn2SpellDetailDTOList = new ArrayList<>();
+}

+ 18 - 0
src/main/java/com/diagbot/dto/Cn2SpellDetailDTO.java

@@ -0,0 +1,18 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/9/22 16:06
+ */
+@Getter
+@Setter
+public class Cn2SpellDetailDTO {
+    //汉字
+    private String cn;
+    //拼音
+    private String spell;
+}

+ 36 - 0
src/main/java/com/diagbot/dto/ConceptDTO.java

@@ -0,0 +1,36 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/11/15 14:32
+ */
+@Data
+public class ConceptDTO {
+    /**
+     * 主键,概念id
+     */
+    private Long id;
+
+    /**
+     * 对应术语id
+     */
+    private Long libId;
+
+    /**
+     * 概念名称(冗余)
+     */
+    private String libName;
+
+    /**
+     * 概念词性type(冗余)
+     */
+    private Integer libType;
+
+    /**
+     * 启用状态(0:禁用,1:启用)
+     */
+    private Integer status;
+}

+ 43 - 0
src/main/java/com/diagbot/dto/ConceptDetailDTO.java

@@ -0,0 +1,43 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/8/21 10:28
+ */
+@Getter
+@Setter
+public class ConceptDetailDTO {
+    /**
+     * 提示概念id
+     */
+    private Long conceptId;
+
+    /**
+     * 提示明细标题
+     */
+    private String title;
+
+    /**
+     * 提示明细内容
+     */
+    private String content;
+
+    /**
+     * 纯文本
+     */
+    private String text;
+
+    /**
+     * 提示明细序号
+     */
+    private Integer orderNo;
+
+    /**
+     * 内容类型(多选):1-化验、辅检、手术和操作、诊断、药品静态信息,2-注意事项,3-临床路径,4-治疗方案
+     */
+    private String contentType;
+}

+ 17 - 0
src/main/java/com/diagbot/dto/ConceptScaleDTO.java

@@ -0,0 +1,17 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/5/12 13:50
+ */
+@Getter
+@Setter
+public class ConceptScaleDTO {
+    List<ConceptScaleSubDTO> scaleDetails;
+}

+ 107 - 0
src/main/java/com/diagbot/dto/ConceptScaleDetailDTO.java

@@ -0,0 +1,107 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/5/12 13:54
+ */
+@Getter
+@Setter
+public class ConceptScaleDetailDTO {
+    /**
+     * 下级
+     */
+    private List<ConceptScaleSubDTO> subList = new ArrayList<>();
+
+    private Long id;
+    /**
+     * -1:表示顶级,其他值表示上级id
+     */
+    private Long parentId;
+
+    /**
+     * 内容
+     */
+    private String content;
+
+    /**
+     * 编码
+     */
+    private String ruleCode;
+
+    /**
+     * 扣分
+     */
+    private BigDecimal score;
+
+    /**
+     * 0表格1有分数2无分数
+     */
+    private Integer textType;
+
+    /**
+     * 结果类型(1算分;2显示选择结果)
+     */
+    private Integer resultType;
+
+    /**
+     * 选择类型(1单选2多选)
+     */
+    private Integer selectType;
+
+    /**
+     * 显示顺序
+     */
+    private Integer orderNo;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 术语概念id
+     */
+    private Long conceptId;
+
+
+    /**
+     * 系数
+     */
+    private BigDecimal factor;
+
+    /**
+     * 常数
+     */
+    private BigDecimal constant;
+
+
+    /**
+     * 1:显示,0:不显示,2隐藏
+     */
+    private Integer status;
+
+    /**
+     * 组别互斥(同组互斥)
+     */
+    private Integer groupNum;
+
+    /**
+     * 结果
+     */
+    private String result;
+
+    /**
+     * 推送信息
+     */
+    private String pushInfo;
+
+    private Integer match;
+}

+ 18 - 0
src/main/java/com/diagbot/dto/ConceptScaleSubDTO.java

@@ -0,0 +1,18 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/5/25 13:46
+ */
+@Getter
+@Setter
+public class ConceptScaleSubDTO {
+    private Integer groupNum;
+    private List<ConceptScaleDetailDTO> detailList;
+}

+ 16 - 0
src/main/java/com/diagbot/dto/CustomDictionaryDTO.java

@@ -0,0 +1,16 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2021/5/25 20:03
+ */
+@Getter
+@Setter
+public class CustomDictionaryDTO {
+    private String name;
+    private String type;
+}

+ 60 - 0
src/main/java/com/diagbot/dto/DefaultExportDTO.java

@@ -0,0 +1,60 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @description: 导出通用类
+ * @author: zhoutg
+ * @date: 2021/8/2 13:40
+ */
+@Data
+public class DefaultExportDTO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+    // ruleId
+    private Long ruleId;
+    // 规则组
+    private String ruleGroup;
+    // 规则分类
+    private String ruleType;
+    // 组号
+    private String groupType;
+    // 提示语
+    private String msg;
+    // conceptId
+    private Long conceptId;
+    // libType
+    private Integer libType;
+    // libTypeCn
+    private String libTypeCn;
+    // libName
+    private String libName;
+    // baseConcept
+    private Long baseConcept;
+    // baseType
+    private Integer baseType;
+
+    @Excel(name="术语名称", width = 25, orderNum = "30")
+    private String baseName = "";
+    @Excel(name="术语类型", width = 17, orderNum = "35")
+    private String baseTypeCn;
+    @Excel(name="术语子元素", width = 35, orderNum = "38")
+    private String sonName;
+    @Excel(name="匹配条件", width = 17, orderNum = "40")
+    private String tabooType;
+    @Excel(name="最小值", width = 10, orderNum = "60")
+    private String minValue;
+    @Excel(name="最小值符号", width = 10, orderNum = "50")
+    private String minOperator;
+    @Excel(name="最大值", width = 10, orderNum = "80")
+    private String maxValue;
+    @Excel(name="最大值符号", width = 10, orderNum = "70")
+    private String maxOperator;
+    @Excel(name="等于", width = 10, orderNum = "90")
+    private String eqValue;
+    // @Excel(name="condId", width = 10, orderNum = "110")
+    // private Long condId;
+}

+ 20 - 0
src/main/java/com/diagbot/dto/DeptInfoDTO.java

@@ -0,0 +1,20 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:Mark
+ * @time: 2020/8/17 11:28
+ */
+@Getter
+@Setter
+public class DeptInfoDTO {
+    /**
+     * 科室名称
+     */
+    private String name;
+}

+ 17 - 0
src/main/java/com/diagbot/dto/DiagnoseDTO.java

@@ -0,0 +1,17 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2021/3/15 11:21
+ */
+@Getter
+@Setter
+public class DiagnoseDTO {
+    private Long conceptId;
+    private String libName;
+    private Integer conditionType;
+}

+ 19 - 0
src/main/java/com/diagbot/dto/DiagnoseRecordDTO.java

@@ -0,0 +1,19 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @className: com.diagbot.dto-> DiagnoseRecordDTO
+ * @description: 校验过后,都是标准词的诊断依据记录
+ * @author: kongwz
+ * @createDate: 2021-08-26 14:01
+ * @version: 1.0
+ * @todo:
+ */
+@Data
+public class DiagnoseRecordDTO extends ExportDiagnoseDTO implements Serializable {
+    private static final long serialVersionUID = 1L;
+    private String diseaseName;
+}

+ 18 - 0
src/main/java/com/diagbot/dto/DiagnosesFindDTO.java

@@ -0,0 +1,18 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-03-29 11:06
+ */
+@Setter
+@Getter
+public class DiagnosesFindDTO {
+
+    private Long conceptId;
+
+    private String conceptName;
+}

+ 17 - 0
src/main/java/com/diagbot/dto/DictionaryDTO.java

@@ -0,0 +1,17 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhoutg
+ * @time: 2021/6/7 10:27
+ */
+@Data
+public class DictionaryDTO {
+    // 字典数据
+    private List<DictionaryInfoDTO> list = new ArrayList<>();
+}

+ 48 - 0
src/main/java/com/diagbot/dto/DictionaryInfoDTO.java

@@ -0,0 +1,48 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * icss字典表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-12-25
+ */
+@Getter
+@Setter
+public class DictionaryInfoDTO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 分组(值自定义)
+     */
+    private Long groupType;
+
+    /**
+     * 内容
+     */
+    private String name;
+
+    /**
+     * 值
+     */
+    private String val;
+
+
+    /**
+     * 排序号
+     */
+    private Integer orderNo;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+}

+ 15 - 0
src/main/java/com/diagbot/dto/DiseaseIndexDTO.java

@@ -0,0 +1,15 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2022/4/8 13:52
+ */
+@Data
+public class DiseaseIndexDTO {
+    private Long id;
+    private String name;
+    private String code;
+}

+ 24 - 0
src/main/java/com/diagbot/dto/DiseaseInfoDTO.java

@@ -0,0 +1,24 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/9/15 10:07
+ */
+@Getter
+@Setter
+public class DiseaseInfoDTO {
+    private Long id;
+    /**
+     * 疾病名称
+     */
+    private String name;
+
+    /**
+     * ICD10编码
+     */
+    private String icd10Code;
+}

+ 17 - 0
src/main/java/com/diagbot/dto/DiseaseItemDTO.java

@@ -0,0 +1,17 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2021/2/22 16:49
+ */
+@Getter
+@Setter
+public class DiseaseItemDTO {
+    private String diseaseName;
+    private Long relationId;
+    private String itemName;
+}

+ 33 - 0
src/main/java/com/diagbot/dto/DrugInfoDTO.java

@@ -0,0 +1,33 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/8/12 16:15
+ */
+@Getter
+@Setter
+public class DrugInfoDTO {
+    private Long id;
+    /**
+     * 药品名称
+     */
+    private String name;
+    /**
+     * 用法
+     */
+    private List<String> usage;
+    /**
+     * 用量、剂量
+     */
+    private List<String> dosage;
+    /**
+     * 频次
+     */
+    private List<String> frequency;
+}

+ 15 - 0
src/main/java/com/diagbot/dto/DrugNameDTO.java

@@ -0,0 +1,15 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2021/2/4 10:34
+ */
+@Getter
+@Setter
+public class DrugNameDTO {
+    private String drug;
+}

+ 18 - 0
src/main/java/com/diagbot/dto/DrugTypeCacheDTO.java

@@ -0,0 +1,18 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2021/2/4 10:36
+ */
+@Getter
+@Setter
+public class DrugTypeCacheDTO {
+    private String drugType;
+    private List<String> drugs;
+}

+ 18 - 0
src/main/java/com/diagbot/dto/DrugTypeDTO.java

@@ -0,0 +1,18 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2021/2/4 9:55
+ */
+@Getter
+@Setter
+public class DrugTypeDTO {
+    private String drugType;
+    private List<DrugNameDTO> drugs;
+}

+ 24 - 0
src/main/java/com/diagbot/dto/ExportDescDTO.java

@@ -0,0 +1,24 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 诊断依据说明导出
+ * </p>
+ *
+ * @author kongwz
+ * @since 2020-07-28
+ */
+@Data
+public class ExportDescDTO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @Excel(name="说明", width = 100, orderNum = "10")
+    private String name = "";
+
+}

+ 44 - 0
src/main/java/com/diagbot/dto/ExportDiagnoseDTO.java

@@ -0,0 +1,44 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 诊断依据导出
+ * </p>
+ *
+ * @author kongwz
+ * @since 2020-07-28
+ */
+@Data
+public class ExportDiagnoseDTO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @Excel(name="类型", width = 20, orderNum = "10")
+    private String type = "";
+    @Excel(name="序号", width = 10, orderNum = "20")
+    private String orderNo = "";
+    @Excel(name="规则", width = 50, orderNum = "30")
+    private String rule = "";
+    @Excel(name="等于", width = 10, orderNum = "40")
+    private String eq;
+    @Excel(name="最大值", width = 10, orderNum = "50")
+    private String max;
+    @Excel(name="最大值符号", width = 10, orderNum = "60")
+    private String maxSymbol;
+    @Excel(name="最小值", width = 10, orderNum = "70")
+    private String min;
+    @Excel(name="最小值符号", width = 10, orderNum = "80")
+    private String minSymbol;
+    @Excel(name="单位", width = 10, orderNum = "90")
+    private String unit;
+    @Excel(name="关联词", width = 10, orderNum = "35")
+    private String relation;
+    @Excel(name="校验", width = 10, orderNum = "33")
+    private String check;
+
+}

+ 24 - 0
src/main/java/com/diagbot/dto/ExportDiagnoseNameDTO.java

@@ -0,0 +1,24 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 诊断依据导出
+ * </p>
+ *
+ * @author kongwz
+ * @since 2020-07-28
+ */
+@Data
+public class ExportDiagnoseNameDTO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @Excel(name="名称", isHyperlink = true)
+    private String name = "";
+
+}

+ 18 - 0
src/main/java/com/diagbot/dto/GatherDTO.java

@@ -0,0 +1,18 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+/**
+ * @Description:
+ * @Author:zhoutg
+ * @time: 2021/6/7 10:27
+ */
+@Data
+public class GatherDTO {
+    // 集合标准名
+    private String parName;
+    // 集合类型
+    private String parLibType;
+    // 元素标准名
+    private String sonName;
+}

+ 48 - 0
src/main/java/com/diagbot/dto/GetAllForRelationDTO.java

@@ -0,0 +1,48 @@
+package com.diagbot.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-03-17 15:23
+ */
+@Setter
+@Getter
+public class GetAllForRelationDTO {
+    /**
+     * 概念id
+     */
+    @ApiModelProperty(value="概念id")
+    private Long conceptId;
+
+    /**
+     * 概念名称
+     */
+    @ApiModelProperty(value="概念名称")
+    private String conceptName;
+
+    /**
+     * 概念id
+     */
+    @ApiModelProperty(value="概念id")
+    private Integer libType;
+
+    /**
+     * 概念名称(类型)
+     */
+    @ApiModelProperty(value="概念名称(类型)")
+    private String conceptNameType;
+
+    /**
+     * 说明
+     */
+    @ApiModelProperty(value="说明(remark)")
+    private String remark;
+
+
+
+}
+

+ 32 - 0
src/main/java/com/diagbot/dto/IndexBatchDTO.java

@@ -0,0 +1,32 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/6/7 10:27
+ */
+@Getter
+@Setter
+public class IndexBatchDTO {
+    private Long id;
+    private Integer status;
+    private String name;
+    private String code;
+    private String synonyms;
+    private Integer type;
+    /**
+     * 国药准字
+     */
+    private String approval;
+    /**
+     * 药品剂型
+     */
+    private String form;
+    /**
+     * 药品剂型id
+     */
+    private Long formConceptId;
+}

+ 24 - 0
src/main/java/com/diagbot/dto/IndexDTO.java

@@ -0,0 +1,24 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/2/22 9:49
+ */
+@Getter
+@Setter
+public class IndexDTO {
+    private Long id;
+    private String name;
+    private String icd10Code;
+    private String code;
+    private Double maxValue;
+    private Double minValue;
+    private String units;
+    private Integer range;
+    private Long packId;
+    private String packName;
+}

+ 27 - 0
src/main/java/com/diagbot/dto/IndicationDTO.java

@@ -0,0 +1,27 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @description: 提示信息出参
+ * @author: zhoutg
+ * @time: 2020/7/29 9:57
+ */
+@Data
+public class IndicationDTO {
+    // 危机值提醒
+    private List<BillMsg> criticalValList = new ArrayList<>();
+    // 开单合理性提示信息
+    private List<BillMsg> billMsgList = new ArrayList<>();
+    // 高危药品、手术
+    private List<BillMsg> highRiskList = new ArrayList<>();
+    // 其他提醒
+    private List<BillMsg> otherList = new ArrayList<>();
+    // 记录调试信息
+    private Map<String, Object> debug = new LinkedHashMap<>();
+}

+ 42 - 0
src/main/java/com/diagbot/dto/IndicationExportDTO.java

@@ -0,0 +1,42 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @description: 开单导出
+ * @author: zhoutg
+ * @date: 2021/8/2 13:40
+ */
+@Data
+public class IndicationExportDTO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @Excel(name="开单名称", width = 25, orderNum = "10")
+    private String parName = "";
+    @Excel(name="开单类型", width = 17, orderNum = "20")
+    private String parType = "";
+    @Excel(name="规则名称", width = 25, orderNum = "30")
+    private String baseName = "";
+    @Excel(name="规则类型", width = 17, orderNum = "35")
+    private String baseType;
+    @Excel(name="规则条件", width = 17, orderNum = "40")
+    private String tabooType;
+    @Excel(name="最小值", width = 10, orderNum = "50")
+    private String minValue;
+    @Excel(name="最小值符号", width = 10, orderNum = "60")
+    private String minOperator;
+    @Excel(name="最大值", width = 10, orderNum = "70")
+    private String maxValue;
+    @Excel(name="最大值符号", width = 10, orderNum = "80")
+    private String maxOperator;
+    @Excel(name="原因及建议", width = 15, orderNum = "90")
+    private String msg;
+    @Excel(name="ruleId", width = 10, orderNum = "100")
+    private Long ruleId;
+    @Excel(name="condId", width = 10, orderNum = "110")
+    private Long condId;
+}

+ 33 - 0
src/main/java/com/diagbot/dto/IndicationNewExportDTO.java

@@ -0,0 +1,33 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @description: 开单导出
+ * @author: zhoutg
+ * @date: 2021/8/2 13:40
+ */
+@Data
+public class IndicationNewExportDTO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @Excel(needMerge = true, name="规则名称", width = 25, orderNum = "10")
+    private String ruleGroup = "";
+    @Excel(needMerge = true, name="开单名称", width = 25, orderNum = "11")
+    private String libName;
+    @Excel(needMerge = true, name="开单类型", width = 17, orderNum = "12")
+    private String libTypeCn;
+    @Excel(needMerge = true, name="开单子名称", width = 25, orderNum = "13")
+    private String sonLibName;
+    @ExcelCollection(name="组内明细", orderNum = "20")
+    private List<DefaultExportDTO> defaultExportDTOList= new ArrayList<>();
+    @Excel(needMerge = true, name="提示语", width = 25, orderNum = "30")
+    private String msg;
+}

+ 43 - 0
src/main/java/com/diagbot/dto/KlConceptDetailDTO.java

@@ -0,0 +1,43 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/2/24 13:39
+ */
+@Getter
+@Setter
+public class KlConceptDetailDTO {
+    /**
+     * 提示概念id
+     */
+    private Long conceptId;
+
+    /**
+     * 提示明细标题
+     */
+    private String title;
+
+    /**
+     * 提示明细内容
+     */
+    private String content;
+
+    /**
+     * 纯文本
+     */
+    private String text;
+
+    /**
+     * 提示明细序号
+     */
+    private Integer orderNo;
+
+    /**
+     * 内容类型(多选):1-化验、辅检、手术和操作、诊断、药品静态信息,2-注意事项,3-临床路径,4-治疗方案
+     */
+    private String contentType;
+}

+ 109 - 0
src/main/java/com/diagbot/dto/KlConceptScaleDTO.java

@@ -0,0 +1,109 @@
+package com.diagbot.dto;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-05-25 10:00
+ */
+@Setter
+@Getter
+public class KlConceptScaleDTO {
+
+    private Long id;
+
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 术语概念id
+     */
+    private Long conceptId;
+
+    /**
+     * -1:表示顶级,其他值表示上级菜单的id
+     */
+    private Long parentId;
+
+    /**
+     * 内容
+     */
+    private String content;
+
+    /**
+     * 编码
+     */
+    private String ruleCode;
+
+    /**
+     * 扣分
+     */
+    private BigDecimal score;
+
+    /**
+     * 系数
+     */
+    private BigDecimal factor;
+
+    /**
+     * 常数
+     */
+    private BigDecimal constant;
+
+    /**
+     * 11表格;12文本;21标题;31算分;32显示选择结果
+     */
+    private Integer textType;
+    /**
+     * 结果类型(1算分;2显示选择结果)
+     */
+    private Integer resultType;
+    /**
+     * 选择类型(1单选2多选)
+     */
+    private Integer selectType;
+
+    /**
+     * 显示顺序
+     */
+    private Integer orderNo;
+
+    /**
+     * 1:显示,0:不显示,2隐藏
+     */
+    private Integer status;
+
+    /**
+     * 组别互斥(同组互斥)
+     */
+    private Integer groupNum;
+
+    /**
+     * 结果
+     */
+    private String result;
+
+    /**
+     * 推送信息
+     */
+    private String pushInfo;
+
+    private String remark;
+
+}

+ 67 - 0
src/main/java/com/diagbot/dto/KlConceptStaticDTO.java

@@ -0,0 +1,67 @@
+package com.diagbot.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/2/24 13:38
+ */
+@Getter
+@Setter
+public class KlConceptStaticDTO {
+    /**
+     * 术语id
+     */
+    private Long id;
+    /**
+     * 术语名称
+     */
+    private String name;
+    /**
+     * 关联标题
+     */
+    private String title;
+    /**
+     * 术语类型(词性)
+     */
+    private Integer type;
+    /**
+     * 术语类型(词性)
+     */
+    private String typeName;
+    /**
+     * 临床路径名称
+     */
+    private String clinicalPathwayName;
+    /**
+     * 注意事项名称
+     */
+    private String noticeName;
+    /**
+     * 修改时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date gmtModified;
+    /**
+     * 修改人
+     */
+    private String modifier;
+    /**
+     * 启用状态
+     */
+    private Integer status;
+    /**
+     * 明细
+     */
+    private List<KlConceptDetailDTO> details;
+    /**
+     * 量表结构
+     */
+    private KlScaleByIdDTO scale;
+}

+ 93 - 0
src/main/java/com/diagbot/dto/KlDiagnoseByIdDTO.java

@@ -0,0 +1,93 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-03-19 15:26
+ */
+@Setter
+@Getter
+public class KlDiagnoseByIdDTO {
+    private Long id;
+    private String description;//规则名称
+    private Long conceptId;//提示概念id
+    private String libName;
+    private Integer libType;
+    private String lename;
+    private Integer status;//启用状态(0:禁用,1:启用)
+    /**
+     * 条件类型(1:基础条件;2:拟诊条件;3:确诊条件;4:警惕条件)
+     */
+    private Integer conditionType;
+
+    private Long basId;
+    /**
+     * 规则组别(condition_type为2:拟诊条件;3:确诊条件;4:警惕条件有效)
+     */
+    private Integer conditionGroup;
+
+    /**
+     * 符合数量(condition_type为2:拟诊条件;3:确诊条件;4:警惕条件有效)
+     */
+    private Integer fitNo;
+    /**
+     * 基础规则组别(condition_type为1:基础条件;2:拟诊条件;3:确诊条件;4:警惕条件都有效)
+     */
+    private Integer baseGroup;
+    /**
+     * 描述
+     */
+    private String basDescription;
+    /*  private Long basConceptId;
+      private String basLibName;*/
+    private List<KlDiagnoseLibNameDTO> libNameList;
+    private Integer basLibType;
+
+    private String basLename;
+    /**
+     * 基础规则类型(1:等于术语本身;2:存在比较;3:不等于术语本身;)
+     */
+    private Integer basType;
+    /**
+     * 最小域比较符
+     */
+    private String minOperator;
+    /**
+     * 最小域值
+     */
+    private String minVal;
+
+    /**
+     * 最小域单位
+     */
+    private String minUnit;
+    /**
+     * 最大域比较符
+     */
+    private String maxOperator;
+    /**
+     * 最大域值
+     */
+    private String maxVal;
+    /**
+     * 最大域单位
+     */
+    private String maxUnit;
+    /**
+     * 等于域比较符
+     */
+    private String eqOperator;
+    /**
+     * 等于域值
+     */
+    private String eqValue;
+    /**
+     * 等于域单位
+     */
+    private String eqUnit;
+}

+ 33 - 0
src/main/java/com/diagbot/dto/KlDiagnoseGroupDTO.java

@@ -0,0 +1,33 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-03-22 10:33
+ */
+@Setter
+@Getter
+public class KlDiagnoseGroupDTO {
+    /**
+     * 基础规则组别(condition_type为1:基础条件;2:拟诊条件;3:确诊条件;4:警惕条件都有效)
+     */
+    private Integer baseGroup;
+    /**
+     * 满足的条件
+     */
+    private Integer fitNo;
+    /**
+     * 上一级的组别
+     */
+   // private Integer conditionGroup;
+    /**
+     * 组别里的明细
+     */
+    List<KlDiagnoseByIdDTO>  klDiagnoseByIdDTO;
+
+}

+ 48 - 0
src/main/java/com/diagbot/dto/KlDiagnoseInfoDTO.java

@@ -0,0 +1,48 @@
+package com.diagbot.dto;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-03-19 14:58
+ */
+@Setter
+@Getter
+public class KlDiagnoseInfoDTO {
+
+    private Long id;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 疾病概念id
+     */
+    private Long conceptId;
+
+    private String conceptName;
+
+    /**
+     * 描述
+     */
+    private String description;
+
+    /**
+     * 启用状态(0:禁用,1:启用)
+     */
+    private Integer status;
+
+}

+ 19 - 0
src/main/java/com/diagbot/dto/KlDiagnoseLibNameDTO.java

@@ -0,0 +1,19 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-07-01 10:20
+ */
+@Setter
+@Getter
+public class KlDiagnoseLibNameDTO {
+    private Long basId;
+    private Long basConceptId;
+    private String basLibName;
+    private Integer basLibType;
+    private String basLename;
+}

+ 89 - 0
src/main/java/com/diagbot/dto/KlDiagnoseRecordDTO.java

@@ -0,0 +1,89 @@
+package com.diagbot.dto;
+
+import com.google.common.collect.Lists;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * <p>
+ * 诊断依据记录表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-08-24
+ */
+@Data
+public class KlDiagnoseRecordDTO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 诊断依据主表id
+     */
+    private Long diagnoseId;
+
+    /**
+     * 类型
+     */
+    private String type;
+
+    /**
+     * 序号
+     */
+    private String code;
+
+    /**
+     * 规则
+     */
+    private String rule;
+
+    /**
+     * 描述
+     */
+    private String description;
+
+    /**
+     * 等于
+     */
+    private String eqValue;
+
+    /**
+     * 最大值
+     */
+    private String maxValue;
+
+    /**
+     * 最大值符号
+     */
+    private String maxOperator;
+
+    /**
+     * 最小值
+     */
+    private String minValue;
+
+    /**
+     * 最小值符号
+     */
+    private String minOperator;
+
+    /**
+     * 单位
+     */
+    private String unit;
+
+    /**
+     * 排序号
+     */
+    private Integer orderNo;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    // 导入记录明细
+    private List<KlDiagnoseRecordDetailDTO> recordDetailList = Lists.newArrayList();
+}

+ 39 - 0
src/main/java/com/diagbot/dto/KlDiagnoseRecordDetailDTO.java

@@ -0,0 +1,39 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 诊断依据记录明细表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-08-24
+ */
+@Data
+public class KlDiagnoseRecordDetailDTO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 诊断依据记录表id
+     */
+    private Long diagnoseRecordId;
+
+    /**
+     * 标准词
+     */
+    private Long conceptId;
+
+    /**
+     * 排序号
+     */
+    private Integer orderNo;
+
+    /**
+     * 备注
+     */
+    private String remark;
+}

+ 29 - 0
src/main/java/com/diagbot/dto/KlDiagnoseTypeDTO.java

@@ -0,0 +1,29 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-03-22 10:58
+ */
+@Setter
+@Getter
+public class KlDiagnoseTypeDTO {
+
+    /**
+     * 条件类型名
+     */
+    private String conditionTypeName;
+    /**
+     * 条件类型(1:基础条件;2:拟诊条件;3:确诊条件;4:警惕条件)
+     */
+    private Integer conditionType;
+
+    private Integer conditionGroup;
+
+    List<KlDiagnoseGroupDTO> byIdDTO;
+}

+ 43 - 0
src/main/java/com/diagbot/dto/KlRuleByIdDTO.java

@@ -0,0 +1,43 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-03-08 11:13
+ */
+@Setter
+@Getter
+public class KlRuleByIdDTO {
+    private Long ruleId;//规则id
+    private Long parId;
+    private String parDescription;//规则名称
+    private Integer parRuleType;//规则类型(1:开单合理性;2:高危;3:危急值;4:其他值提醒;5:其他值提醒输血;6:正常项目重复开立)
+    private Long parConceptId;//提示概念id
+    private String parlibName;
+    private Integer parHasSub;//是否有子条件(0:无,1:有)
+    private String parMsg;//附加信息
+    private Integer parStatus;//启用状态(0:禁用,1:启用)
+    private String parLenName;
+    private String parLenCode;
+    private Long subId;//基础规则id
+    private String subDescription;//基础规则名称
+    private Long subConceptId;//医学标准术语id
+    private String subLibName;//医学标准术语
+    private String subLenName;//基础规则术语类型
+    private String subLenCode;//基础规则术语编码
+    private Integer subType;//基础规则类型(1:开单外等于术语本身;2:开单外存在比较;3:开单外不等于术语本身;4:过敏原;5:开单项;6:检查结果正则表达式)
+    private Integer groupType;
+    private String subMinOperator;//最小域比较符
+    private String subMinValue;//最小域值
+    private String subMinUnit;//最小域单位
+    private String subMaxOperator;//最大域比较符
+    private String subMaxValue;//最大域值
+    private String subMaxUnit;//最大域单位
+    private String subEqOperator;//等于域比较符
+    private String subEqValue;//等于域值
+    private String subEqUnit;//等于域单位
+    private String subMsg;//附加信息
+}

+ 27 - 0
src/main/java/com/diagbot/dto/KlRuleByIdParDTO.java

@@ -0,0 +1,27 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-03-08 13:18
+ */
+@Setter
+@Getter
+public class KlRuleByIdParDTO {
+    private Long parId;
+    private String parDescription;//规则名称
+    private Integer parRuleType;//规则类型(1:开单合理性;2:高危;3:危急值;4:其他值提醒;5:其他值提醒输血;6:正常项目重复开立)
+    private Long parConceptId;//提示概念id
+    private String parlibName;
+    private Integer parHasSub;//是否有子条件(0:无,1:有)
+    private String parMsg;//附加信息
+    private Integer parStatus;//启用状态(0:禁用,1:启用)
+    private String parLenName;
+    private String parLenCode;
+    private List<KlRuleByIdSubDTO>  klRuleByIdSub;
+}

+ 32 - 0
src/main/java/com/diagbot/dto/KlRuleByIdSubDTO.java

@@ -0,0 +1,32 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-03-08 13:16
+ */
+@Setter
+@Getter
+public class KlRuleByIdSubDTO {
+    private Long subId;//基础规则id
+    private String subDescription;//基础规则名称
+    private Long subConceptId;//医学标准术语id
+    private String subLibName;//医学标准术语
+    private String subLenName;//基础规则术语类型
+    private String subLenCode;//基础规则术语编码
+    private Integer subType;//基础规则类型(1:开单外等于术语本身;2:开单外存在比较;3:开单外不等于术语本身;4:过敏原;5:开单项;6:检查结果正则表达式)
+    private Integer groupType;
+    private String subMinOperator;//最小域比较符
+    private String subMinValue;//最小域值
+    private String subMinUnit;//最小域单位
+    private String subMaxOperator;//最大域比较符
+    private String subMaxValue;//最大域值
+    private String subMaxUnit;//最大域单位
+    private String subEqOperator;//等于域比较符
+    private String subEqValue;//等于域值
+    private String subEqUnit;//等于域单位
+    private String subMsg;//附加信息
+}

+ 65 - 0
src/main/java/com/diagbot/dto/KlRuleInfoDTO.java

@@ -0,0 +1,65 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-03-05 13:44
+ */
+@Setter
+@Getter
+public class KlRuleInfoDTO {
+
+    /**
+     * 主键
+     */
+    private Long parId;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 提示概念id
+     */
+    private Long parConceptId;
+
+    private String parConceptName;
+
+
+    private String parLibTypeName;
+    /**
+     * 描述
+     */
+    private String parDescription;
+
+    /**
+     * 规则类型(1:开单合理性;2:高危;3:危急值;4:其他值提醒;5:其他值提醒输血;6:正常项目重复开立)
+     */
+    private Integer parRuleType;
+
+    /**
+     * 是否有子条件(0:无,1:有)
+     */
+    private Integer parHasSub;
+
+    /**
+     * 启用状态(0:禁用,1:启用)
+     */
+    private Integer parStatus;
+
+    /**
+     * 附加信息
+     */
+    private String parMsg;
+}

+ 12 - 0
src/main/java/com/diagbot/dto/KlRulePlanDTO.java

@@ -0,0 +1,12 @@
+package com.diagbot.dto;
+import lombok.Data;
+
+@Data
+public class KlRulePlanDTO {
+    // 类型
+    private String name;
+    // 编码
+    private String code;
+    // 分组
+    private Long groupType;
+}

+ 49 - 0
src/main/java/com/diagbot/dto/KlScaleByIdDTO.java

@@ -0,0 +1,49 @@
+package com.diagbot.dto;
+
+import com.diagbot.entity.wrapper.KlScaleDetailWrapper;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-05-10 10:36
+ */
+@Setter
+@Getter
+public class KlScaleByIdDTO {
+
+    private Long id;
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 术语概念id
+     */
+    private Long conceptId;
+
+    private String conceptName;
+
+
+    /**
+     * 状态
+     */
+    private Integer status;
+
+
+    /**
+     * 量表明细
+     */
+    private List<KlScaleDetailWrapper> klScaleDetail ;
+}

+ 83 - 0
src/main/java/com/diagbot/dto/KlScaleDetailDTO.java

@@ -0,0 +1,83 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-05-10 10:32
+ */
+@Setter
+@Getter
+public class KlScaleDetailDTO {
+
+    private Long id;
+
+
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 术语概念id
+     */
+    private Long conceptId;
+
+    /**
+     * -1:表示顶级,其他值表示上级菜单的id
+     */
+    private Long parentId;
+
+    /**
+     * 内容
+     */
+    private String content;
+
+    /**
+     * 编码
+     */
+    private String ruleCode;
+
+    /**
+     * 扣分
+     */
+    private BigDecimal score;
+
+    /**
+     * 0表格1有分数2无分数
+     */
+    private Integer textType;
+
+    /**
+     * 选择类型(1单选2多选)
+     */
+    private Integer selectType;
+
+    /**
+     * 显示顺序
+     */
+    private Integer orderNo;
+
+    /**
+     * 是否显示(1是,0否)
+     */
+    private Integer status;
+
+    private String remark;
+
+    private List<KlScaleDetailDTO> klScaleDetailSub = new ArrayList<>();
+}

+ 43 - 0
src/main/java/com/diagbot/dto/KlScaleInfoDTO.java

@@ -0,0 +1,43 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-05-10 10:30
+ */
+@Setter
+@Getter
+public class KlScaleInfoDTO {
+
+    private Long id;
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 术语概念id
+     */
+    private Long conceptId;
+
+    private String conceptName;
+    /**
+     * 状态
+     */
+    private Integer status;
+
+    /**
+     * 量表明细
+     */
+    // private List<KlScaleDetailDTO> klScaleDetail = new ArrayList<>();
+}

+ 38 - 0
src/main/java/com/diagbot/dto/KllisDetailDTO.java

@@ -0,0 +1,38 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2021/4/16 14:34
+ */
+@Getter
+@Setter
+public class KllisDetailDTO {
+    /**
+     * 名称
+     */
+    private String libName;
+    /**
+     * 编号
+     */
+    private Long id;
+    /**
+     * 下限
+     */
+    private Double minValue;
+    /**
+     * 上限
+     */
+    private Double maxValue;
+    /**
+     * 单位
+     */
+    private String unit;
+    /**
+     * 参考范围:0-范围内,1-范围外
+     */
+    private Integer type;
+}

+ 19 - 0
src/main/java/com/diagbot/dto/LibConceptDTO.java

@@ -0,0 +1,19 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+/**
+ * @author zhoutg
+ * @Description:
+ * @date 2021-06-10 19:51
+ */
+@Data
+public class LibConceptDTO {
+
+    // 原词
+    private String name;
+    // 标准词
+    private String conceptName;
+    // 类型
+    private Integer libType;
+}

+ 19 - 0
src/main/java/com/diagbot/dto/LisCtritalDTO.java

@@ -0,0 +1,19 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Description: 化验危急值提示语
+ * @Author:zhoutg
+ * @time: 2020/8/12 15:53
+ */
+@Data
+public class LisCtritalDTO {
+    private String name; // 化验拼接提示语
+    private String groupMsg = ""; // 人群拼接提示语
+    private String ageMsg = ""; // 年龄拼接提示语
+    private List<String> lisMsg = new ArrayList<>(); // 化验拼接提示语——暂无数据
+}

+ 51 - 0
src/main/java/com/diagbot/dto/LisDetailDTO.java

@@ -0,0 +1,51 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/8/12 15:53
+ */
+@Getter
+@Setter
+public class LisDetailDTO {
+    private Long id;
+    /**
+     * 大项(套餐)
+     */
+    private String name;
+    /**
+     * 小项(公表名)
+     */
+    private String uniqueName;
+    /**
+     * 数值
+     */
+    private Double value;
+    /**
+     * 单位
+     */
+    private String units;
+    /**
+     * 下限
+     */
+    private Double minValue;
+    /**
+     * 上限
+     */
+    private Double maxValue;
+    /**
+     * 非数值结果
+     */
+    private String otherValue;
+    /**
+     * 非数值类型参考值
+     */
+    private String referenceValue;
+    /**
+     * 参考范围:0-范围内,1-范围外
+     */
+    private Integer range;
+}

+ 24 - 0
src/main/java/com/diagbot/dto/LisOtherDTO.java

@@ -0,0 +1,24 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhoutg
+ * @time: 2020/8/12 15:53
+ */
+@Data
+public class LisOtherDTO {
+    private String name; // 化验拼接提示语
+    private String lisNameDetail;  // 化验套餐和明细拼接,如果套餐和明细名称一样,取明细
+    private String msg; // 输血名称
+    private List<String> drugMsg = new ArrayList<>(); // 药品拼接提示语
+    private List<String> diseaseMsg = new ArrayList<>(); // 诊断拼接提示语
+    private List<String> groupMsg = new ArrayList<>(); // 人群拼接提示语
+    private List<String> operationMsg = new ArrayList<>(); // 手术拼接提示语
+    private String sexMsg = ""; // 性别拼接提示语
+    private List<String> lisMsg = new ArrayList<>(); // 化验拼接提示语——暂无数据
+}

+ 14 - 0
src/main/java/com/diagbot/dto/MatchDTO.java

@@ -0,0 +1,14 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+/**
+ * @description: 规则匹配内容
+ * @author: zhoutg
+ * @time: 2020/7/29 9:57
+ */
+@Data
+public class MatchDTO {
+    private String content; // 匹配内容
+    private String lisNameDetail; // 化验套餐和明细拼接,如果套餐和明细名称一样,取明细
+}

+ 35 - 0
src/main/java/com/diagbot/dto/NeoPushDTO.java

@@ -0,0 +1,35 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @description: 推理出参《图谱返回数据》
+ * @author: zhoutg
+ * @time: 2020/8/17 15:34
+ */
+@Data
+public class NeoPushDTO {
+    private PushBaseDTO disease;//疾病医保名称
+    private PushBaseDTO icd10;//疾病医保版icd-10
+    private List<PushBaseDTO> symptoms = new ArrayList<>();//症状
+    private List<PushBaseDTO> vitals = new ArrayList<>();//体征
+    private List<PushBaseDTO> lis = new ArrayList<>();//实验室检查
+    private List<PushBaseDTO> pacs = new ArrayList<>();//辅助检查
+    private List<PushBaseDTO> scales = new ArrayList<>();//量表
+    // 鉴别诊断
+    private List<PushBaseDTO> differentialDis;
+    /**
+     * Map<String,List<NeoPushGeneralDTO>>
+     *     operation:[  ]
+     *     drug:[  ]
+     */
+    private Map<String,List<PushBaseDTO>> treat = new HashMap<>();//治疗
+    private List<PushBaseDTO> diagnosticBasis = new ArrayList<>();//诊断依据
+
+
+}

+ 19 - 0
src/main/java/com/diagbot/dto/NurseInfoDTO.java

@@ -0,0 +1,19 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/4/23 10:55
+ */
+@Getter
+@Setter
+public class NurseInfoDTO {
+    private Long id;
+    /**
+     * 护理名称
+     */
+    private String name;
+}

+ 25 - 0
src/main/java/com/diagbot/dto/OperationInfoDTO.java

@@ -0,0 +1,25 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/8/12 16:21
+ */
+@Getter
+@Setter
+public class OperationInfoDTO {
+    private Long id;
+    /**
+     * 手术或操作名称
+     */
+    private String name;
+    /**
+     * 类型:手术、操作
+     */
+    private String type;
+
+    private String code;
+}

+ 29 - 0
src/main/java/com/diagbot/dto/OtherExportDTO.java

@@ -0,0 +1,29 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @description: 开单导出
+ * @author: zhoutg
+ * @date: 2021/8/2 13:40
+ */
+@Data
+public class OtherExportDTO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @Excel(needMerge = true, name="规则名称", width = 25, orderNum = "10")
+    private String ruleGroup = "";
+
+    @ExcelCollection(name="组内明细", orderNum = "20")
+    private List<DefaultExportDTO> defaultExportDTOList= new ArrayList<>();
+
+    @Excel(needMerge = true, name="提示语", width = 25, orderNum = "30")
+    private String msg;
+}

+ 17 - 0
src/main/java/com/diagbot/dto/PacsDTO.java

@@ -0,0 +1,17 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/10/15 14:26
+ */
+@Getter
+@Setter
+public class PacsDTO {
+    private String name;
+    //词性 5:辅检项目,7:辅检子项
+    private Integer type;
+}

+ 0 - 0
src/main/java/com/diagbot/dto/PacsOtherDTO.java


部分文件因文件數量過多而無法顯示