Procházet zdrojové kódy

中医诊断、中医证候术语检索

zhaops před 4 roky
rodič
revize
c54fffea19

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

@@ -14,6 +14,7 @@ public class IndexDTO {
     private Long id;
     private String name;
     private String icd10Code;
+    private String code;
     private Double maxValue;
     private Double minValue;
     private String units;

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

@@ -61,4 +61,12 @@ public class RetrievalDTO {
      * 护理
      */
     private List<NurseInfoDTO> nursenames;
+    /**
+     * 中医诊断
+     */
+    private List<TcmdiseaseInfoDTO> tcmdiseaseNames;
+    /**
+     * 中医证候
+     */
+    private List<TcmsyndromeInfoDTO> tcmsyndromeNames;
 }

+ 23 - 0
src/main/java/com/diagbot/dto/TcmdiseaseInfoDTO.java

@@ -0,0 +1,23 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/5/13 15:37
+ */
+@Getter
+@Setter
+public class TcmdiseaseInfoDTO {
+    /**
+     * 疾病名称
+     */
+    private String name;
+
+    /**
+     * 编码
+     */
+    private String code;
+}

+ 23 - 0
src/main/java/com/diagbot/dto/TcmsyndromeInfoDTO.java

@@ -0,0 +1,23 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/5/13 15:43
+ */
+@Getter
+@Setter
+public class TcmsyndromeInfoDTO {
+    /**
+     * 疾病名称
+     */
+    private String name;
+
+    /**
+     * 编码
+     */
+    private String code;
+}

+ 3 - 1
src/main/java/com/diagbot/enums/LexiconEnum.java

@@ -53,7 +53,9 @@ public enum LexiconEnum implements KeyedNamed {
     OperationClassNode(407,"手术和操作类别根节点"),
     LisClassNode(408,"实验室检查类别根节点"),
     PacsClassNode(409,"辅助检查类别根节点"),
-    Age(410,"年龄");
+    Age(410,"年龄"),
+    Tcmdisease(126,"中医疾病"),
+    Tcmsyndrome(127,"中医证候");
 
 
     @Setter

+ 9 - 2
src/main/java/com/diagbot/facade/KlConceptFacade.java

@@ -43,7 +43,7 @@ public class KlConceptFacade extends KlConceptServiceImpl {
             return new ArrayList<>();
         }
         List<String> retList = Lists.newLinkedList();
-        //type: 类型:1-化验大项、2-化验小项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理
+        //type: 类型:1-化验大项、2-化验小项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候
         Integer type = convertType(conceptVO.getType());
 
         QueryWrapper<KlConcept> queryWrapper = new QueryWrapper<>();
@@ -67,7 +67,7 @@ public class KlConceptFacade extends KlConceptServiceImpl {
 
     public Integer convertType(Integer type) {
         Integer retType = null;
-        //type: 类型:1-化验大项、2-化验小项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理
+        //type: 类型:1-化验大项、2-化验小项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候
         switch (type) {
             case 1:
                 retType = LexiconEnum.LisName.getKey();
@@ -98,6 +98,13 @@ public class KlConceptFacade extends KlConceptServiceImpl {
                 break;
             case 11:
                 retType = LexiconEnum.Nurse.getKey();
+                break;
+            case 12:
+                retType = LexiconEnum.Tcmdisease.getKey();
+                break;
+            case 13:
+                retType = LexiconEnum.Tcmsyndrome.getKey();
+                break;
             default:
                 break;
         }

+ 20 - 1
src/main/java/com/diagbot/facade/MedRetrievalFacade.java

@@ -10,6 +10,8 @@ import com.diagbot.dto.OperationInfoDTO;
 import com.diagbot.dto.RetrievalDTO;
 import com.diagbot.dto.ScaleInfoDTO;
 import com.diagbot.dto.StaticKnowledgeIndexDTO;
+import com.diagbot.dto.TcmdiseaseInfoDTO;
+import com.diagbot.dto.TcmsyndromeInfoDTO;
 import com.diagbot.enums.LexiconEnum;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.util.EntityUtil;
@@ -58,7 +60,7 @@ public class MedRetrievalFacade {
         List<IndexDTO> indexList = Lists.newLinkedList();
 
         /**
-         * 类型:1-化验大项、2-化验小项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、9-症状、10-量表、11-护理
+         * 类型:1-化验大项、2-化验小项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、9-症状、10-量表、11-护理、12-中医诊断、13-中医证候
          */
         switch (retrievalVO.getType()) {
             case 1:
@@ -162,6 +164,23 @@ public class MedRetrievalFacade {
                     retrievalDTO.setNursenames(BeanUtil.listCopyTo(indexList, NurseInfoDTO.class));
                 }
                 break;
+            case 12:
+                medRetrievalVO.setTypeId(LexiconEnum.Tcmdisease.getKey());
+                medRetrievalVO.getTypeIds().add(LexiconEnum.Tcmdisease.getKey());
+                indexList = klConceptFacade.index(medRetrievalVO);
+                if (ListUtil.isNotEmpty(indexList)) {
+                    retrievalDTO.setTcmdiseaseNames(BeanUtil.listCopyTo(indexList, TcmdiseaseInfoDTO.class));
+                }
+                break;
+            case 13:
+                medRetrievalVO.setTypeId(LexiconEnum.Tcmsyndrome.getKey());
+                medRetrievalVO.getTypeIds().add(LexiconEnum.Tcmsyndrome.getKey());
+                indexList = klConceptFacade.index(medRetrievalVO);
+                if (ListUtil.isNotEmpty(indexList)) {
+                    retrievalDTO.setTcmsyndromeNames(BeanUtil.listCopyTo(indexList, TcmsyndromeInfoDTO.class));
+                }
+                break;
+
         }
         return retrievalDTO;
     }

+ 1 - 1
src/main/java/com/diagbot/web/RetrievalController.java

@@ -39,7 +39,7 @@ public class RetrievalController {
 
 
     @ApiOperation(value = "术语检索[zhaops]",
-            notes = "type: 类型:1-化验大项、2-化验小项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、9-症状、10-量表、11-护理 <br>" +
+            notes = "type: 类型:1-化验大项、2-化验小项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、9-症状、10-量表、11-护理、12-中医诊断、13-中医证候 <br>" +
                     "inputStr: 检索内容<br>" +
                     "sex: 性别:1-男、2-女、3-通用 <br>" +
                     "age: 年龄<br>")

+ 72 - 0
src/main/resources/mapper/KlConceptMapper.xml

@@ -23,6 +23,12 @@
 		<if test="typeId!=null and typeId==100">
 			,t.icd10Code as icd10Code
 		</if>
+		<if test="typeId!=null and typeId==126">
+			,t.code as code
+		</if>
+		<if test="typeId!=null and typeId==127">
+			,t.code as code
+		</if>
 		<if test="typeId!=null and typeId==108">
 			,
 			t1.max_value as `maxValue`,
@@ -40,6 +46,12 @@
 		<if test="typeId!=null and typeId==100">
 			,c.icd10_code as icd10Code
 		</if>
+		<if test="typeId!=null and typeId==126">
+			,c.code as code
+		</if>
+		<if test="typeId!=null and typeId==127">
+			,c.code as code
+		</if>
 		FROM
 		kl_library_info a,
 		kl_concept b
@@ -48,6 +60,16 @@
 			on c.is_deleted = 'N'
 			and b.id = c.concept_id
 		</if>
+		<if test="typeId!=null and typeId==126">
+			left join kl_tcm_disease c
+			on c.is_deleted = 'N'
+			and b.id = c.concept_id
+		</if>
+		<if test="typeId!=null and typeId==127">
+			left join kl_tcm_syndrome c
+			on c.is_deleted = 'N'
+			and b.id = c.concept_id
+		</if>
 		WHERE
 		a.is_deleted = 'N'
 		AND b.is_deleted = 'N'
@@ -58,6 +80,12 @@
 			<if test="typeId!=null and typeId==100">
 				OR LOWER(c.icd10_code) = LOWER(#{inputStr})
 			</if>
+			<if test="typeId!=null and typeId==126">
+				OR LOWER(c.code) = LOWER(#{inputStr})
+			</if>
+			<if test="typeId!=null and typeId==127">
+				OR LOWER(c.code) = LOWER(#{inputStr})
+			</if>
 			)
 		</if>
 		<if test="typeIds != null and typeIds.size > 0">
@@ -72,6 +100,12 @@
 		<if test="typeId!=null and typeId==100">
 			,c.icd10_code as icd10Code
 		</if>
+		<if test="typeId!=null and typeId==126">
+			,c.code as code
+		</if>
+		<if test="typeId!=null and typeId==127">
+			,c.code as code
+		</if>
 		FROM
 		kl_library_info a,
 		kl_concept b
@@ -80,6 +114,16 @@
 			on c.is_deleted = 'N'
 			and b.id = c.concept_id
 		</if>
+		<if test="typeId!=null and typeId==126">
+			left join kl_tcm_disease c
+			on c.is_deleted = 'N'
+			and b.id = c.concept_id
+		</if>
+		<if test="typeId!=null and typeId==127">
+			left join kl_tcm_syndrome c
+			on c.is_deleted = 'N'
+			and b.id = c.concept_id
+		</if>
 		WHERE
 		a.is_deleted = 'N'
 		AND b.is_deleted = 'N'
@@ -90,6 +134,12 @@
 			<if test="typeId!=null and typeId==100">
 				OR LOWER(c.icd10_code) LIKE LOWER(concat(#{inputStr},'%'))
 			</if>
+			<if test="typeId!=null and typeId==126">
+				OR LOWER(c.code) LIKE LOWER(concat(#{inputStr},'%'))
+			</if>
+			<if test="typeId!=null and typeId==127">
+				OR LOWER(c.code) LIKE LOWER(concat(#{inputStr},'%'))
+			</if>
 			)
 		</if>
 		<if test="typeIds != null and typeIds.size > 0">
@@ -104,6 +154,12 @@
 		<if test="typeId!=null and typeId==100">
 			,c.icd10_code as icd10Code
 		</if>
+		<if test="typeId!=null and typeId==126">
+			,c.code as code
+		</if>
+		<if test="typeId!=null and typeId==127">
+			,c.code as code
+		</if>
 		FROM
 		kl_library_info a,
 		kl_concept b
@@ -112,6 +168,16 @@
 			on c.is_deleted = 'N'
 			and b.id = c.concept_id
 		</if>
+		<if test="typeId!=null and typeId==126">
+			left join kl_tcm_disease c
+			on c.is_deleted = 'N'
+			and b.id = c.concept_id
+		</if>
+		<if test="typeId!=null and typeId==127">
+			left join kl_tcm_syndrome c
+			on c.is_deleted = 'N'
+			and b.id = c.concept_id
+		</if>
 		WHERE
 		a.is_deleted = 'N'
 		AND b.is_deleted = 'N'
@@ -122,6 +188,12 @@
 			<if test="typeId!=null and typeId==100">
 				OR LOWER(c.icd10_code) LIKE LOWER( concat('%',#{inputStr},'%'))
 			</if>
+			<if test="typeId!=null and typeId==126">
+				OR LOWER(c.code) LIKE LOWER( concat('%',#{inputStr},'%'))
+			</if>
+			<if test="typeId!=null and typeId==127">
+				OR LOWER(c.code) LIKE LOWER( concat('%',#{inputStr},'%'))
+			</if>
 			)
 		</if>
 		<if test="typeIds != null and typeIds.size > 0">