فهرست منبع

词性转换移到common

Zhaops 6 سال پیش
والد
کامیت
56213cc71a

+ 1 - 0
aipt-service/src/main/java/com/diagbot/enums/ConceptTypeEnum.java

@@ -21,6 +21,7 @@ public enum  ConceptTypeEnum implements KeyedNamed {
     SIDE_EFFECTS(10, "不良反应"),
     Drug_Category_Small(11, "药品分类-小类"),
     LIS_TABLES(12,"化验公表项"),
+    DEPARTMENT(15,"科室"),
     Scale(21, "量表"),
     Indication(22, "指标"),
     LisDetail(51, "化验明细");

+ 7 - 0
aipt-service/src/main/java/com/diagbot/util/ParamConvertUtil.java

@@ -62,6 +62,8 @@ public class ParamConvertUtil {
             case LisDetail:
                 libType = LexiconTypeEnum.LIS_DETAILS.getKey();
                 break;
+            case DEPARTMENT:
+                libType = LexiconTypeEnum.DEPARTMENT.getKey();
             default:
                 break;
         }
@@ -116,6 +118,11 @@ public class ParamConvertUtil {
             case CORE_INDICATORS:
                 type = ConceptTypeEnum.Indication.getKey();
                 break;
+            case LIS_DETAILS:
+                type = ConceptTypeEnum.LisDetail.getKey();
+                break;
+            case DEPARTMENT:
+                type = ConceptTypeEnum.DEPARTMENT.getKey();
             default:
                 break;
         }

+ 65 - 0
common/src/main/java/com/diagbot/enums/ConceptTypeEnum.java

@@ -0,0 +1,65 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/5/7 14:06
+ */
+public enum  ConceptTypeEnum implements KeyedNamed {
+    Symptom(1, "症状"),
+    Past(2, "既往史"),
+    Other(3, "其他史"),
+    Vital(4, "查体"),
+    Lis(5, "化验"),
+    Pacs(6, "辅检"),
+    Disease(7, "诊断"),
+    Drug(8, "药品"),
+    Drug_Category_Big(9, "药品分类-大类"),
+    SIDE_EFFECTS(10, "不良反应"),
+    Drug_Category_Small(11, "药品分类-小类"),
+    LIS_TABLES(12,"化验公表项"),
+    DEPARTMENT(15,"科室"),
+    Scale(21, "量表"),
+    Indication(22, "指标"),
+    LisDetail(51, "化验明细");
+
+
+
+    @Setter
+    private Integer key;
+
+    @Setter
+    private String name;
+
+    ConceptTypeEnum(Integer key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static ConceptTypeEnum getEnum(Integer key) {
+        for (ConceptTypeEnum item : ConceptTypeEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(Integer key) {
+        ConceptTypeEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}

+ 99 - 0
common/src/main/java/com/diagbot/enums/LexiconTypeEnum.java

@@ -0,0 +1,99 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @Description: 术语分类枚举
+ * @author: gaodm
+ * @time: 2019/5/6 13:58
+ */
+public enum LexiconTypeEnum implements KeyedNamed {
+    SYMPTOM(1,"症状"),
+    TIME(2,"时间"),
+    BODYPART(3,"部位"),
+    NATURE(4,"性质"),
+    CAUSE(5,"诱因"),
+    DEGREE(6,"程度"),
+    NEGATIVE(7,"阴性"),
+    POSITIVE(8,"阳性"),
+    COMPANY(9,"单位"),
+    DRUGS(10,"药品"),
+    TREATMENT(11,"治疗"),
+    LIS_PACKAGE(12,"化验套餐"),
+    LIS_DETAILS(13,"化验明细"),
+    LIS_RESULTS(14,"化验结果"),
+    PACS_PACKAGE(15,"辅检套餐"),
+    PACS_ITEMS(16,"辅检项目"),
+    PACS_RESULTS(17,"辅检结果"),
+    DIAGNOSIS(18,"诊断"),
+    CONNECTIVES(19,"连接词"),
+    POSITION(20,"方位"),
+    RELATIVES(21,"亲属"),
+    MARRIAGE(22,"婚姻"),
+    FOOD(23,"食品"),
+    HISTORY(24,"历史"),
+    OPERATION(25,"手术"),
+    SYMPTOM_MANIFESTATION(26,"症状表现"),
+    DIGITAL_QUANTIFIER(27,"数字量词"),
+    NUMBER(28,"数字"),
+    DRUG_CATEGORY_BIG(29,"药品大类"),
+    DRUG_CATEGORY_SMALL(30,"药品小类"),
+    PACS_CATEGORY_BIG(31,"辅检大类"),
+    PACS_CATEGORY_SMALL(32,"辅检小类"),
+    VITAL_INDEX(33,"体征指标"),
+    VITAL_INDEX_VALUE(34,"体征指标值"),
+    VITAL_RESULT(35,"体征结果"),
+    PLACE(36,"地点"),
+    OCCUPATION(37,"职业"),
+    PERSONAL_HISTORY(38,"个人史"),
+    PERSONAL_HISTORY_DESCRIPTION(39,"个人史描述"),
+    TIME_DESCRIPTION(40,"时间描述"),
+    SYMPTOM_INDEX(41,"症状指标"),
+    MEDICAL_SUPPLIES(42,"医用耗材 "),
+    DEGREE_CLASSIFIER(43,"程度量词"),
+    OTHER(44,"其他"),
+    DELETE(45,"删除"),
+    LIS_TABLES(46,"化验公表项"),
+    DEPARTMENT(47,"科室"),
+    GAUGE(48,"量表"),
+    SIDE_EFFECTS(49,"不良反应"),
+    CORE_INDICATORS(50,"核心指标"),
+    TYPES_OF_DISEASE(51,"疾病类型(慢病|急诊)");
+
+    @Setter
+    private Integer key;
+
+    @Setter
+    private String name;
+
+    LexiconTypeEnum(Integer key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static LexiconTypeEnum getEnum(Integer key) {
+        for (LexiconTypeEnum item : LexiconTypeEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(Integer key) {
+        LexiconTypeEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}
+

+ 131 - 0
common/src/main/java/com/diagbot/util/ParamConvertUtil.java

@@ -0,0 +1,131 @@
+package com.diagbot.util;
+
+import com.diagbot.enums.ConceptTypeEnum;
+import com.diagbot.enums.LexiconTypeEnum;
+
+/**
+ * @Description:参数转换
+ * @Author:zhaops
+ * @time: 2019/5/7 9:44
+ */
+public class ParamConvertUtil {
+
+    /**
+     * 概念(标签)词性转术语词性
+     *
+     * @param type
+     * @return
+     */
+    public static Integer conceptConvert2Lib(Integer type) {
+        Integer libType = null;
+        switch (ConceptTypeEnum.getEnum(type)) {
+            case Symptom:
+                libType = LexiconTypeEnum.SYMPTOM.getKey();
+                break;
+            case Past:
+            case Other:
+                libType = LexiconTypeEnum.HISTORY.getKey();
+                break;
+            case Vital:
+                libType = LexiconTypeEnum.VITAL_INDEX.getKey();
+                break;
+            case Lis:
+                libType = LexiconTypeEnum.LIS_PACKAGE.getKey();
+                break;
+            case LIS_TABLES:
+                libType = LexiconTypeEnum.LIS_TABLES.getKey();
+                break;
+            case Pacs:
+                libType = LexiconTypeEnum.PACS_ITEMS.getKey();
+                break;
+            case Disease:
+                libType = LexiconTypeEnum.DIAGNOSIS.getKey();
+                break;
+            case Drug:
+                libType = LexiconTypeEnum.DRUGS.getKey();
+                break;
+            case SIDE_EFFECTS:
+                libType = LexiconTypeEnum.SIDE_EFFECTS.getKey();
+                break;
+            case Drug_Category_Big:
+                libType = LexiconTypeEnum.DRUG_CATEGORY_BIG.getKey();
+                break;
+            case Drug_Category_Small:
+                libType = LexiconTypeEnum.DRUG_CATEGORY_SMALL.getKey();
+                break;
+            case Scale:
+                libType = LexiconTypeEnum.GAUGE.getKey();
+                break;
+            case Indication:
+                libType = LexiconTypeEnum.CORE_INDICATORS.getKey();
+                break;
+            case LisDetail:
+                libType = LexiconTypeEnum.LIS_DETAILS.getKey();
+                break;
+            case DEPARTMENT:
+                libType = LexiconTypeEnum.DEPARTMENT.getKey();
+            default:
+                break;
+        }
+        return libType;
+    }
+
+    /**
+     * 术语词性转概念(标签)词性
+     *
+     * @param libType
+     * @return
+     */
+    public static Integer libConvert2Concept(Integer libType) {
+        Integer type = null;
+        switch (LexiconTypeEnum.getEnum(libType)) {
+            case SYMPTOM:
+                type = ConceptTypeEnum.Symptom.getKey();
+                break;
+            case HISTORY:
+                type = ConceptTypeEnum.Other.getKey();
+                break;
+            case VITAL_INDEX:
+                type = ConceptTypeEnum.Vital.getKey();
+                break;
+            case LIS_PACKAGE:
+                type = ConceptTypeEnum.Lis.getKey();
+                break;
+            case LIS_TABLES:
+                type = ConceptTypeEnum.LIS_TABLES.getKey();
+                break;
+            case PACS_ITEMS:
+                type = ConceptTypeEnum.Pacs.getKey();
+                break;
+            case DIAGNOSIS:
+                type = ConceptTypeEnum.Disease.getKey();
+                break;
+            case DRUGS:
+                type = ConceptTypeEnum.Drug.getKey();
+                break;
+            case SIDE_EFFECTS:
+                type = ConceptTypeEnum.SIDE_EFFECTS.getKey();
+                break;
+            case DRUG_CATEGORY_BIG:
+                type = ConceptTypeEnum.Drug_Category_Big.getKey();
+                break;
+            case DRUG_CATEGORY_SMALL:
+                type = ConceptTypeEnum.Drug_Category_Small.getKey();
+                break;
+            case GAUGE:
+                type = ConceptTypeEnum.Scale.getKey();
+                break;
+            case CORE_INDICATORS:
+                type = ConceptTypeEnum.Indication.getKey();
+                break;
+            case LIS_DETAILS:
+                type = ConceptTypeEnum.LisDetail.getKey();
+                break;
+            case DEPARTMENT:
+                type = ConceptTypeEnum.DEPARTMENT.getKey();
+            default:
+                break;
+        }
+        return type;
+    }
+}