Browse Source

cdss-core上传

wangsy 1 year ago
parent
commit
e8665aefc2

+ 58 - 58
pom.xml

@@ -220,63 +220,63 @@
 
 
     <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>
+    <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>

+ 1 - 0
src/main/java/com/diagbot/enums/ConEnum.java

@@ -30,6 +30,7 @@ public enum ConEnum implements KeyedNamed {
     otherAllergy(17, "禁忌其他过敏原"),
     repeat24(18, "24小时重复开立"),
     repeat(19, "正常项目重复开立"),
+    dept(20, "禁忌科室"),
     ;
 
     @Setter

+ 5 - 0
src/main/java/com/diagbot/rule/BillRule.java

@@ -32,6 +32,8 @@ public class BillRule {
     @Autowired
     AgeRule ageRule;
     @Autowired
+    DeptRule deptRule;
+    @Autowired
     MsgNewUtil msgNewUtil;
     @Autowired
     CommonRule commonRule;
@@ -92,6 +94,9 @@ public class BillRule {
                     case Age: // 年龄
                         flag = ageRule.bill(wordCrfDTO, ruleBaseDTO, ruleSimpleDTO);
                         break;
+                    case Dept: // 科室
+                        flag = deptRule.bill(wordCrfDTO, ruleBaseDTO, ruleSimpleDTO);
+                        break;
                     case Disease: // 诊断
                         flag = commonRule.compareItemWithBill(diags, ruleBaseDTO, ruleSimpleDTO, ConEnum.disease.getName());
                         break;

+ 60 - 0
src/main/java/com/diagbot/rule/DeptRule.java

@@ -0,0 +1,60 @@
+package com.diagbot.rule;
+
+import com.diagbot.biz.push.entity.Item;
+import com.diagbot.dto.RuleBaseDTO;
+import com.diagbot.dto.RuleSimpleDTO;
+import com.diagbot.dto.WordCrfDTO;
+import com.diagbot.enums.ConEnum;
+import com.diagbot.util.CoreUtil;
+import com.diagbot.util.StringUtil;
+import com.google.common.collect.Lists;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @description: 科室规则
+ * @author: zhoutg
+ * @time: 2023/7/21 14:47
+ */
+@Component
+public class DeptRule {
+
+    /**
+     * 比较科室
+     *
+     * @param wordCrfDTO
+     * @param ruleBaseDTO
+     * @param ruleSimpleDTO
+     */
+    public Boolean bill(WordCrfDTO wordCrfDTO, RuleBaseDTO ruleBaseDTO, RuleSimpleDTO ruleSimpleDTO) {
+        boolean flag = getFlag(wordCrfDTO, ruleBaseDTO);
+        if (flag) {
+            List<String> contentList = Lists.newArrayList();
+            if (!contentList.contains(ruleBaseDTO.getBaseLibName())) {
+                contentList.add(ruleBaseDTO.getBaseLibName());
+            }
+            CoreUtil.setListAndType(ruleSimpleDTO, contentList, ConEnum.dept.getName());
+        }
+        return flag;
+    }
+
+    /**
+     * 匹配规则——返回状态
+     *
+     * @param wordCrfDTO
+     * @param ruleBaseDTO
+     * @return
+     */
+    public boolean getFlag(WordCrfDTO wordCrfDTO, RuleBaseDTO ruleBaseDTO) {
+        String dept = ruleBaseDTO.getBaseLibName();
+        if (StringUtil.isNotBlank(dept) && wordCrfDTO.getDept() != null) {
+            for (Item item : wordCrfDTO.getDept()) {
+                if (dept.equals(item.getName())) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+}

+ 2 - 1
src/main/resources/mapper/KlDiagnoseBaseMapper.xml

@@ -97,7 +97,8 @@
             t.eq_value,
             t.eq_unit,
             t.conceptids,
-            t.lib_name
+            t.lib_name,
+            t.lib_type
     </select>
 
 </mapper>