Browse Source

1、诊断静态知识检索支持国临版

zhaops 3 years ago
parent
commit
db3792ae17

+ 8 - 0
src/main/java/com/diagbot/dto/StaticKnowledgeIndexDTO.java

@@ -23,6 +23,14 @@ public class StaticKnowledgeIndexDTO {
      * 编码
      */
     private String code;
+    /**
+     * 国临版编码
+     */
+    private String guocode;
+    /**
+     * 国临版名称
+     */
+    private String guoname;
     /**
      * 词性
      */

+ 45 - 9
src/main/resources/mapper/KlConceptMapper.xml

@@ -285,6 +285,8 @@
         s.type,
         s.typeName,
         s.code,
+        s.guocode,
+        IF(( s.CODE IS NULL OR s.CODE = '' ) AND s.NAME = s.guoname, '', s.guoname ) AS guoname,
         IF( s2.concept_id IS NOT NULL, s2.concept_id, s3.concept_id ) AS conceptId,
         s1.clinical_pathway_name,
         s1.notice_name,
@@ -307,7 +309,9 @@
         t.isConcept,
         t.type,
         t.typeName,
-        t1.icd10_code AS code
+        t1.icd10_code AS code,
+        t1.guocode,
+        t1.guoname
         FROM
         (
         SELECT
@@ -348,7 +352,9 @@
         t.isConcept,
         t.type,
         t.typeName,
-        t1.icd10_code AS code
+        t1.icd10_code AS code,
+        t1.guocode,
+        t1.guoname
         FROM
         (
         SELECT
@@ -390,7 +396,9 @@
         t.isConcept,
         t.type,
         t.typeName,
-        t1.icd10_code AS code
+        t1.icd10_code AS code,
+        t1.guocode,
+        t1.guoname
         FROM
         (
         SELECT
@@ -637,7 +645,9 @@
             t.isConcept,
             t.type,
             t.typeName,
-            l1.icd10_code AS code
+            l1.icd10_code AS code,
+            l1.guocode,
+            l1.guoname
             FROM
             (
             SELECT
@@ -666,7 +676,15 @@
             AND l1.is_deleted = 'N'
             <where>
                 <if test="inputStr!=null and inputStr!=''">
-                    AND LOWER(l1.icd10_code) = LOWER(#{inputStr})
+                    AND (
+                    LOWER(l1.icd10_code) = LOWER(#{inputStr})
+                    OR
+                    LOWER(l1.guospell) = LOWER(#{inputStr})
+                    OR
+                    LOWER(l1.guocode) = LOWER(#{inputStr})
+                    OR
+                    LOWER(l1.guoname) = LOWER(#{inputStr})
+                    )
                 </if>
             </where>
             UNION
@@ -678,7 +696,9 @@
             t.isConcept,
             t.type,
             t.typeName,
-            l1.icd10_code AS code
+            l1.icd10_code AS code,
+            l1.guocode,
+            l1.guoname
             FROM
             (
             SELECT
@@ -707,7 +727,14 @@
             AND l1.is_deleted = 'N'
             <where>
                 <if test="inputStr!=null and inputStr!=''">
-                    AND LOWER(l1.icd10_code) LIKE LOWER( concat(#{inputStr},'%'))
+                    AND (LOWER(l1.icd10_code) LIKE LOWER( concat(#{inputStr},'%'))
+                    OR
+                    LOWER(l1.guospell) LIKE LOWER( concat(#{inputStr},'%'))
+                    OR
+                    LOWER(l1.guocode) LIKE LOWER( concat(#{inputStr},'%'))
+                    OR
+                    LOWER(l1.guoname) LIKE LOWER( concat(#{inputStr},'%'))
+                    )
                 </if>
             </where>
             UNION
@@ -719,7 +746,9 @@
             t.isConcept,
             t.type,
             t.typeName,
-            l1.icd10_code AS code
+            l1.icd10_code AS code,
+            l1.guocode,
+            l1.guoname
             FROM
             (
             SELECT
@@ -748,7 +777,14 @@
             AND l1.is_deleted = 'N'
             <where>
                 <if test="inputStr!=null and inputStr!=''">
-                    AND LOWER(l1.icd10_code) LIKE LOWER( concat('%',#{inputStr},'%'))
+                    AND (LOWER(l1.icd10_code) LIKE LOWER( concat('%',#{inputStr},'%'))
+                    OR
+                    LOWER(l1.guospell) LIKE LOWER( concat('%',#{inputStr},'%'))
+                    OR
+                    LOWER(l1.guocode) LIKE LOWER( concat('%',#{inputStr},'%'))
+                    OR
+                    LOWER(l1.guoname) LIKE LOWER( concat('%',#{inputStr},'%'))
+                    )
                 </if>
             </where>
         </if>

+ 51 - 15
src/main/resources/mapper/KlConceptStaticMapper.xml

@@ -77,6 +77,8 @@
         s.type,
         s.typeName,
         s.code,
+        s.guocode,
+        IF(( s.CODE IS NULL OR s.CODE = '' ) AND s.NAME = s.guoname, '', s.guoname ) AS guoname,
         s1.concept_id AS conceptId,
         s1.clinical_pathway_name AS clinicalPathwayName,
         s1.notice_name AS noticeName,
@@ -91,7 +93,9 @@
         t.isConcept,
         t.type,
         t.typeName,
-        t1.icd10_code AS code
+        t1.icd10_code AS code,
+        t1.guocode,
+        t1.guoname
         FROM
         (
         SELECT
@@ -133,7 +137,9 @@
         t.isConcept,
         t.type,
         t.typeName,
-        t1.icd10_code AS code
+        t1.icd10_code AS code,
+        t1.guocode,
+        t1.guoname
         FROM
         (
         SELECT
@@ -175,7 +181,9 @@
         t.isConcept,
         t.type,
         t.typeName,
-        t1.icd10_code AS code
+        t1.icd10_code AS code,
+        t1.guocode,
+        t1.guoname
         FROM
         (
         SELECT
@@ -426,7 +434,9 @@
             t.isConcept,
             t.type,
             t.typeName,
-            l1.icd10_code AS code
+            l1.icd10_code AS code,
+            l1.guocode,
+            l1.guoname
             FROM
             (
             SELECT
@@ -454,9 +464,17 @@
             LEFT JOIN kl_disease l1 ON t.id = l1.concept_id
             AND l1.is_deleted = 'N'
             <where>
-            <if test="staticKnowledgeIndexPageVO.inputStr!=null and staticKnowledgeIndexPageVO.inputStr!=''">
-                AND LOWER(l1.icd10_code) = LOWER(#{staticKnowledgeIndexPageVO.inputStr})
-            </if>
+                <if test="staticKnowledgeIndexPageVO.inputStr!=null and staticKnowledgeIndexPageVO.inputStr!=''">
+                    AND (
+                    LOWER(l1.icd10_code) = LOWER(#{staticKnowledgeIndexPageVO.inputStr})
+                    OR
+                    LOWER(l1.guospell) = LOWER(#{staticKnowledgeIndexPageVO.inputStr})
+                    OR
+                    LOWER(l1.guocode) = LOWER(#{staticKnowledgeIndexPageVO.inputStr})
+                    OR
+                    LOWER(l1.guoname) = LOWER(#{staticKnowledgeIndexPageVO.inputStr})
+                    )
+                </if>
             </where>
             UNION
             SELECT
@@ -467,7 +485,9 @@
             t.isConcept,
             t.type,
             t.typeName,
-            l1.icd10_code AS code
+            l1.icd10_code AS code,
+            l1.guocode,
+            l1.guoname
             FROM
             (
             SELECT
@@ -495,9 +515,16 @@
             LEFT JOIN kl_disease l1 ON t.id = l1.concept_id
             AND l1.is_deleted = 'N'
             <where>
-            <if test="staticKnowledgeIndexPageVO.inputStr!=null and staticKnowledgeIndexPageVO.inputStr!=''">
-                AND LOWER(l1.icd10_code) LIKE LOWER( concat(#{staticKnowledgeIndexPageVO.inputStr},'%'))
-            </if>
+                <if test="staticKnowledgeIndexPageVO.inputStr!=null and staticKnowledgeIndexPageVO.inputStr!=''">
+                    AND (LOWER(l1.icd10_code) LIKE LOWER( concat(#{staticKnowledgeIndexPageVO.inputStr},'%'))
+                    OR
+                    LOWER(l1.guospell) LIKE LOWER( concat(#{staticKnowledgeIndexPageVO.inputStr},'%'))
+                    OR
+                    LOWER(l1.guocode) LIKE LOWER( concat(#{staticKnowledgeIndexPageVO.inputStr},'%'))
+                    OR
+                    LOWER(l1.guoname) LIKE LOWER( concat(#{staticKnowledgeIndexPageVO.inputStr},'%'))
+                    )
+                </if>
             </where>
             UNION
             SELECT
@@ -508,7 +535,9 @@
             t.isConcept,
             t.type,
             t.typeName,
-            l1.icd10_code AS code
+            l1.icd10_code AS code,
+            l1.guocode,
+            l1.guoname
             FROM
             (
             SELECT
@@ -536,9 +565,16 @@
             LEFT JOIN kl_disease l1 ON t.id = l1.concept_id
             AND l1.is_deleted = 'N'
             <where>
-            <if test="staticKnowledgeIndexPageVO.inputStr!=null and staticKnowledgeIndexPageVO.inputStr!=''">
-                AND LOWER(l1.icd10_code) LIKE LOWER( concat('%',#{staticKnowledgeIndexPageVO.inputStr},'%'))
-            </if>
+                <if test="staticKnowledgeIndexPageVO.inputStr!=null and staticKnowledgeIndexPageVO.inputStr!=''">
+                    AND (LOWER(l1.icd10_code) LIKE LOWER( concat('%',#{staticKnowledgeIndexPageVO.inputStr},'%'))
+                    OR
+                    LOWER(l1.guospell) LIKE LOWER( concat('%',#{staticKnowledgeIndexPageVO.inputStr},'%'))
+                    OR
+                    LOWER(l1.guocode) LIKE LOWER( concat('%',#{staticKnowledgeIndexPageVO.inputStr},'%'))
+                    OR
+                    LOWER(l1.guoname) LIKE LOWER( concat('%',#{staticKnowledgeIndexPageVO.inputStr},'%'))
+                    )
+                </if>
             </where>
         </if>
         ) s,