Переглянути джерело

开单合理性接口重定义修改

louhr 5 роки тому
батько
коміт
95053e99e5

+ 204 - 39
common-push/src/main/java/org/diagbot/common/push/bean/SearchData.java

@@ -13,6 +13,8 @@ public class SearchData {
     protected int age_end = 200;
     protected int age = 0;
     protected String sex;
+    //婚姻
+    protected String marriage;
     // 搜索结果的贝叶斯阈值
     protected String threshold = "0";
     //特征类别
@@ -25,26 +27,61 @@ public class SearchData {
     protected String resourceType;
     //外部系统编码 用于返回映射数据,如果sysCode为空或null,则返回kl_standard_info标准名称
     protected String sysCode;
-    private List<PreResult> lisArr = new ArrayList<>();
+
     protected String normal  = "";
     protected String chief  = "";
     protected String symptom = "";
     protected String vital = "";
-    protected String lis = "";
-    protected String pacs = "";
-    protected String diag = "";
-    private String diseaseName;
     protected String pasts = "";
     protected String other = "";
+    //传染病史
+    protected String infectious = "";
+    //手术外伤史
+    protected String operation = "";
+    //过敏史
+    protected String allergy = "";
+    //接种史
+    protected String vaccination = "";
+    //个人史
+    protected String personal = "";
+    //婚育史
+    protected String marital = "";
+    //家族史
+    protected String family = "";
+    //月经史
+    protected String menstrual = "";
+    //化验文本输入
+    protected String lisString = "";
+    //pacs文本输入
+    protected String pacsString = "";
+    //疾病文本输入
+    protected String diagString = "";
+    //药品文本输入
+    protected String drugString = "";
+    //lis结构化数据
+    private List<PreResult> lis = new ArrayList<>();
+    //pacs结构化数据
+    private List<PreResult> pacs = new ArrayList<>();
+    //diag结构化数据
+    private List<PreResult> diag = new ArrayList<>();
+    //drug结构化数据
+    private List<PreResult> drug = new ArrayList<>();
     //当前开单lis项目
     protected String lisOrder = "";
     //当前开单pacs项目
     protected String pacsOrder = "";
+    //当前开单诊断项目
+    protected String diagOrder = "";
+    //当前开单药品项目
+    protected String drugOrder = "";
+    //当前开单手术项目
+    protected String operationOrder = "";
     //当前开单其他 预留
     protected String otherOrder = "";
     //大数据推送诊断结果信息
     protected List<FeatureRate> pushDiags = new ArrayList<>();
-
+    //选中诊断
+    private String diseaseName;
     //量表
     protected String scaleName = "";
     //指标结果
@@ -61,7 +98,7 @@ public class SearchData {
     private Map<String, List<Rule>> rules = new HashMap<>();
     //特征推送走的模型 1:机器学习 2:朴素贝叶斯
     private Integer algorithmType;
-    //规则类型
+    //规则类型 1:危机值提醒,2:开单合理性,3:管理评估,4:不良反应,5:药物推荐,6:异常值
     private String ruleType;
 
     public Integer getDisType() {
@@ -72,14 +109,6 @@ public class SearchData {
         this.disType = disType;
     }
 
-    public List<PreResult> getLisArr() {
-        return lisArr;
-    }
-
-    public void setLisArr(List<PreResult> lisArr) {
-        this.lisArr = lisArr;
-    }
-
     public int getLength() {
         return length;
     }
@@ -198,30 +227,6 @@ public class SearchData {
         this.vital = vital;
     }
 
-    public String getLis() {
-        return lis;
-    }
-
-    public void setLis(String lis) {
-        this.lis = lis;
-    }
-
-    public String getPacs() {
-        return pacs;
-    }
-
-    public void setPacs(String pacs) {
-        this.pacs = pacs;
-    }
-
-    public String getDiag() {
-        return diag;
-    }
-
-    public void setDiag(String diag) {
-        this.diag = diag;
-    }
-
     public String getPasts() {
         return pasts;
     }
@@ -341,4 +346,164 @@ public class SearchData {
     public void setRuleType(String ruleType) {
         this.ruleType = ruleType;
     }
+
+    public String getMarriage() {
+        return marriage;
+    }
+
+    public void setMarriage(String marriage) {
+        this.marriage = marriage;
+    }
+
+    public String getInfectious() {
+        return infectious;
+    }
+
+    public void setInfectious(String infectious) {
+        this.infectious = infectious;
+    }
+
+    public String getOperation() {
+        return operation;
+    }
+
+    public void setOperation(String operation) {
+        this.operation = operation;
+    }
+
+    public String getAllergy() {
+        return allergy;
+    }
+
+    public void setAllergy(String allergy) {
+        this.allergy = allergy;
+    }
+
+    public String getVaccination() {
+        return vaccination;
+    }
+
+    public void setVaccination(String vaccination) {
+        this.vaccination = vaccination;
+    }
+
+    public String getPersonal() {
+        return personal;
+    }
+
+    public void setPersonal(String personal) {
+        this.personal = personal;
+    }
+
+    public String getMarital() {
+        return marital;
+    }
+
+    public void setMarital(String marital) {
+        this.marital = marital;
+    }
+
+    public String getFamily() {
+        return family;
+    }
+
+    public void setFamily(String family) {
+        this.family = family;
+    }
+
+    public String getMenstrual() {
+        return menstrual;
+    }
+
+    public void setMenstrual(String menstrual) {
+        this.menstrual = menstrual;
+    }
+
+    public String getLisString() {
+        return lisString;
+    }
+
+    public void setLisString(String lisString) {
+        this.lisString = lisString;
+    }
+
+    public String getPacsString() {
+        return pacsString;
+    }
+
+    public void setPacsString(String pacsString) {
+        this.pacsString = pacsString;
+    }
+
+    public List<PreResult> getLis() {
+        return lis;
+    }
+
+    public void setLis(List<PreResult> lis) {
+        this.lis = lis;
+    }
+
+    public List<PreResult> getPacs() {
+        return pacs;
+    }
+
+    public void setPacs(List<PreResult> pacs) {
+        this.pacs = pacs;
+    }
+
+    public List<PreResult> getDiag() {
+        return diag;
+    }
+
+    public void setDiag(List<PreResult> diag) {
+        this.diag = diag;
+    }
+
+    public List<PreResult> getDrug() {
+        return drug;
+    }
+
+    public void setDrug(List<PreResult> drug) {
+        this.drug = drug;
+    }
+
+    public String getDiagOrder() {
+        return diagOrder;
+    }
+
+    public void setDiagOrder(String diagOrder) {
+        this.diagOrder = diagOrder;
+    }
+
+    public String getDrugOrder() {
+        return drugOrder;
+    }
+
+    public void setDrugOrder(String drugOrder) {
+        this.drugOrder = drugOrder;
+    }
+
+    public String getOperationOrder() {
+        return operationOrder;
+    }
+
+    public void setOperationOrder(String operationOrder) {
+        this.operationOrder = operationOrder;
+    }
+
+    public String getDiagString() {
+        return diagString;
+    }
+
+    public void setDiagString(String diagString) {
+        this.diagString = diagString;
+    }
+
+    public String getDrugString() {
+        return drugString;
+    }
+
+    public void setDrugString(String drugString) {
+        this.drugString = drugString;
+    }
 }

+ 85 - 33
common-push/src/main/java/org/diagbot/common/push/filter/rule/PretreatmentRule.java

@@ -8,9 +8,7 @@ import org.diagbot.nlp.rule.module.PreResult;
 import org.diagbot.nlp.rule.pretreat.*;
 import org.springframework.util.StringUtils;
 
-import java.io.IOException;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -18,51 +16,105 @@ public class PretreatmentRule {
     public void rule(SearchData searchData) throws java.io.IOException {
         //患者基本信息 性别 年龄
         if (!StringUtils.isEmpty(searchData.getNormal())) {
-            searchData.setNormal(add2PreResultList(new PretreatmentNormal(), searchData.getNormal(), "normal", searchData));
+            add2PreResultList(new PretreatmentNormal(), searchData.getNormal(), "normal", searchData);
         }
-        //症状数据
-        if (!StringUtils.isEmpty(searchData.getSymptom())) {
-            searchData.setSymptom(add2PreResultList(new PretreatmentSymptom(), searchData.getSymptom(), "symptom", searchData));
+        //症状规则 主诉、现病史提取
+        if (!StringUtils.isEmpty(searchData.getChief())) {
+            searchData.setChief(add2PreResultList(new PretreatmentSymptom(), searchData.getChief(), "symptom", searchData));
         }
-        //体征数据
+        //体征数据 体征、现病史提取
         if (!StringUtils.isEmpty(searchData.getVital())) {
             searchData.setVital(add2PreResultList(new PretreatmentVital(), searchData.getVital(), "vital", searchData));
         }
-        //lis结构化信息
-        if (searchData.getLisArr() != null && searchData.getLisArr().size() > 0) {
-            List<PreResult> preResults = searchData.getLisArr();
+        //诊断数据  诊断信息(历史)、现病史、既往史(重要疾病史)
+        if (searchData.getDiag() != null && searchData.getDiag().size() > 0) {
+            List<PreResult> preResults = searchData.getDiag();
             for (PreResult result : preResults) {
-                result.setUniqueName("化验--" + result.getUniqueName());
+                result.setUniqueName("诊断--" + result.getUniqueName());
             }
-            searchData.setLis(add2PreResultList(searchData.getLisArr(), searchData.getLis(), "lis", searchData));
-        } else if (!StringUtils.isEmpty(searchData.getLis())) {
-            searchData.setLis(add2PreResultList(new PretreatmentLis(), searchData.getLis(), "lis", searchData));
+            searchData.setDiagString(add2PreResultList(searchData.getDiag(), searchData.getDiagString(), "diag", searchData));
+            add2PreResultList(new PretreatmentDiag(), searchData.getPasts(), "diag", searchData);
+        } else if (!StringUtils.isEmpty(searchData.getDiagString())) {
+            searchData.setDiagString(add2PreResultList(new PretreatmentDiag(), searchData.getDiagString(), "diag", searchData));
+            add2PreResultList(new PretreatmentDiag(), searchData.getPasts(), "diag", searchData);
         }
-        //pacs数据
-        if (!StringUtils.isEmpty(searchData.getPacs())) {
-            searchData.setPacs(add2PreResultList(new PretreatmentPacs(), searchData.getPacs(), "pacs", searchData));
+        //药品数据  药品信息(历史)、现病史、既往史
+        if (searchData.getDrug() != null && searchData.getDrug().size() > 0) {
+            List<PreResult> preResults = searchData.getDrug();
+            for (PreResult result : preResults) {
+                result.setUniqueName("药品--" + result.getUniqueName());
+            }
+            searchData.setDrugString(add2PreResultList(searchData.getDrug(), searchData.getDrugString(), "drug", searchData));
+            add2PreResultList(new PretreatmentDrug(), searchData.getPasts(), "drug", searchData);
+        } else if (!StringUtils.isEmpty(searchData.getDrugString())) {
+            searchData.setDrugString(add2PreResultList(new PretreatmentDrug(), searchData.getDrugString(), "drug", searchData));
+            add2PreResultList(new PretreatmentDrug(), searchData.getPasts(), "drug", searchData);
         }
         //既往史
         if (!StringUtils.isEmpty(searchData.getPasts())) {
-            searchData.setPasts(add2PreResultList(new PretreatmentPast(), searchData.getPasts(), "past", searchData));
+            add2PreResultList(new PretreatmentPast(), searchData.getPasts(), "pasts", searchData);
+        }
+        //手术外伤史 现病史、手术史
+        if (!StringUtils.isEmpty(searchData.getPasts())) {
+            add2PreResultList(new PretreatmentOperation(), searchData.getOperation(), "operation", searchData);
+            add2PreResultList(new PretreatmentOperation(), searchData.getSymptom(), "operation", searchData);
+        }
+        //过敏 现病史、过敏史
+        if (!StringUtils.isEmpty(searchData.getPasts())) {
+            add2PreResultList(new PretreatmentAllergy(), searchData.getAllergy(), "allergy", searchData);
+            add2PreResultList(new PretreatmentAllergy(), searchData.getSymptom(), "allergy", searchData);
+        }
+        //外伤   现病史、手术外伤史
+        if (!StringUtils.isEmpty(searchData.getPasts())) {
+            add2PreResultList(new PretreatmentWound(), searchData.getOperation(), "wound", searchData);
+            add2PreResultList(new PretreatmentWound(), searchData.getSymptom(), "wound", searchData);
+        }
+        //传染病   现病史、传染病史
+        if (!StringUtils.isEmpty(searchData.getPasts())) {
+            add2PreResultList(new PretreatmentInfectious(), searchData.getInfectious(), "infectious", searchData);
+            add2PreResultList(new PretreatmentInfectious(), searchData.getSymptom(), "infectious", searchData);
         }
-        //其他史
-        if (!StringUtils.isEmpty(searchData.getOther())) {
-            add2PreResultList(new PretreatmentOther(), searchData.getSymptom(), "symptom-other", searchData);
-            searchData.setOther(add2PreResultList(new PretreatmentOther(), searchData.getOther(), "other", searchData));
+        //lis结构化信息
+        if (searchData.getLis() != null && searchData.getLis().size() > 0) {
+            List<PreResult> preResults = searchData.getLis();
+            for (PreResult result : preResults) {
+                result.setUniqueName("化验--" + result.getUniqueName());
+            }
+            searchData.setLisString(add2PreResultList(searchData.getLis(), searchData.getLisString(), "lis", searchData));
+        } else if (!StringUtils.isEmpty(searchData.getLisString())) {
+            searchData.setLisString(add2PreResultList(new PretreatmentLis(), searchData.getLisString(), "lis", searchData));
         }
-        //开具诊断
-        if (!StringUtils.isEmpty(searchData.getDiag())) {
-            add2PreResultList(new PretreatmentDiag(), searchData.getDiag(), "diag", searchData);
+        //pacs结构化信息
+        if (searchData.getPacs() != null && searchData.getPacs().size() > 0) {
+            List<PreResult> preResults = searchData.getPacs();
+            for (PreResult result : preResults) {
+                result.setUniqueName("检查--" + result.getUniqueName());
+            }
+            searchData.setPacsString(add2PreResultList(searchData.getPacs(), searchData.getPacsString(), "pacs", searchData));
+        } else if (!StringUtils.isEmpty(searchData.getPacsString())) {
+            searchData.setPacsString(add2PreResultList(new PretreatmentPacs(), searchData.getPacsString(), "pacs", searchData));
         }
-        //开具辅检化验
+
+        //开具 化验
         if (!StringUtils.isEmpty(searchData.getLisOrder())) {
             add2PreResultList(new PretreatmentMakeList(), searchData.getLisOrder(), "lisOrder", searchData);
         }
-        //开具辅检化验
+        //开具 检查
         if (!StringUtils.isEmpty(searchData.getPacsOrder())) {
             add2PreResultList(new PretreatmentMakeList(), searchData.getPacsOrder(), "pacsOrder", searchData);
         }
+        //开具 诊断
+        if (!StringUtils.isEmpty(searchData.getDiagOrder())) {
+            add2PreResultList(new PretreatmentMakeList(), searchData.getDiagOrder(), "diagOrder", searchData);
+        }
+        //开具 药品
+        if (!StringUtils.isEmpty(searchData.getDrugOrder())) {
+            add2PreResultList(new PretreatmentMakeList(), searchData.getDrugOrder(), "drugOrder", searchData);
+        }
+        //开具 手术
+        if (!StringUtils.isEmpty(searchData.getOperationOrder())) {
+            add2PreResultList(new PretreatmentMakeList(), searchData.getOperationOrder(), "operationOrder", searchData);
+        }
 
 //        Map<String, List<Rule>> ruleMap = searchData.getRules();
 //        for (Map.Entry<String, List<Rule>> entry : ruleMap.entrySet()) {
@@ -72,12 +124,12 @@ public class PretreatmentRule {
 //        }
     }
 
-    private String add2PreResultList(Pretreatment pretreatment, String content, String ruleType, SearchData searchData) throws java.io.IOException {
+    private String add2PreResultList(Pretreatment pretreatment, String content, String inputType, SearchData searchData) throws java.io.IOException {
         List<PreResult> preResultList = pretreatment.analyze(content);
-        return add2PreResultList(preResultList, content, ruleType, searchData);
+        return add2PreResultList(preResultList, content, inputType, searchData);
     }
 
-    private String add2PreResultList(List<PreResult> preResultList, String content, String ruleType, SearchData searchData) throws java.io.IOException {
+    private String add2PreResultList(List<PreResult> preResultList, String content, String inputType, SearchData searchData) throws java.io.IOException {
         Map<String, List<Rule>> kl_rule_filter_map = ApplicationCacheUtil.getKl_rule_filter_map();
         //符合条件的规则
         Map<String, List<Rule>> accord_rule_map = searchData.getRules();
@@ -94,13 +146,13 @@ public class PretreatmentRule {
                         boolean isSuit = suitRule(result, rule, content);
                         if (isSuit) {
                             rule.setOriginText(result.getUniqueName() + ":" + result.getValue() + result.getUnits());
-                            if (accord_rule_map.get(ruleType) == null) {
+                            if (accord_rule_map.get(inputType) == null) {
                                 accord_rules = new ArrayList<>();
                             } else {
-                                accord_rules = accord_rule_map.get(ruleType);
+                                accord_rules = accord_rule_map.get(inputType);
                             }
                             accord_rules.add(rule);
-                            accord_rule_map.put(ruleType, accord_rules);
+                            accord_rule_map.put(inputType, accord_rules);
                             searchData.setRules(accord_rule_map);
 
                             content = content + (rule.getRemind() == null ? "" : rule.getSuffixInfo());

+ 1 - 1
common-push/src/main/java/org/diagbot/common/push/work/RelationExtractionUtil.java

@@ -24,7 +24,7 @@ import java.util.Map;
 public class RelationExtractionUtil {
     public List<Triad> createTriad(SearchData searchData) throws IOException {
         List<Triad> triads = new ArrayList<>();
-        String[] pacsSplits = searchData.getPacs().trim().split("。|\n");
+        String[] pacsSplits = searchData.getPacsString().trim().split("。|\n");
         List<Lemma> lemmaList = new ArrayList<>();
         Lemma lemma = null;
         for (String pacsSplit : pacsSplits) {

+ 36 - 18
nlp/src/main/java/org/diagbot/nlp/rule/module/PreResult.java

@@ -4,14 +4,16 @@ package org.diagbot.nlp.rule.module;
  * Created by louhr on 2019/8/31.
  */
 public class PreResult {
+    protected String name = "";
+    protected String uniqueName = "";
+    protected String dataValue = "";
     private String detailName = "";
-    private String uniqueName = "";
     private String maxValue = "";
     private String minValue = "";
-    private String name = "";
     private String otherValue = "";
     private String units = "";
     private String value = "";
+    private String result = "";
 
     public String getDetailName() {
         return detailName;
@@ -21,14 +23,6 @@ public class PreResult {
         this.detailName = detailName;
     }
 
-    public String getUniqueName() {
-        return uniqueName;
-    }
-
-    public void setUniqueName(String uniqueName) {
-        this.uniqueName = uniqueName;
-    }
-
     public String getMaxValue() {
         return maxValue;
     }
@@ -45,14 +39,6 @@ public class PreResult {
         this.minValue = minValue;
     }
 
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
     public String getOtherValue() {
         return otherValue;
     }
@@ -76,4 +62,36 @@ public class PreResult {
     public void setValue(String value) {
         this.value = value;
     }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getUniqueName() {
+        return uniqueName;
+    }
+
+    public void setUniqueName(String uniqueName) {
+        this.uniqueName = uniqueName;
+    }
+
+    public String getDataValue() {
+        return dataValue;
+    }
+
+    public void setDataValue(String dataValue) {
+        this.dataValue = dataValue;
+    }
+
+    public String getResult() {
+        return result;
+    }
+
+    public void setResult(String result) {
+        this.result = result;
+    }
 }

+ 42 - 0
nlp/src/main/java/org/diagbot/nlp/rule/pretreat/PretreatmentAllergy.java

@@ -0,0 +1,42 @@
+package org.diagbot.nlp.rule.pretreat;
+
+import org.diagbot.nlp.participle.ParticipleUtil;
+import org.diagbot.nlp.participle.word.Lexeme;
+import org.diagbot.nlp.participle.word.LexemePath;
+import org.diagbot.nlp.rule.module.PreResult;
+import org.diagbot.nlp.util.NegativeEnum;
+import org.diagbot.nlp.util.NlpUtil;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by louhr on 2019/12/9.
+ */
+public class PretreatmentAllergy extends Pretreatment {
+    protected NegativeEnum[] nees_allergy = new NegativeEnum[]{NegativeEnum.ALLERGY};
+
+    public List<PreResult> analyze(String content) throws java.io.IOException{
+        List<PreResult> preResults = new ArrayList<>();
+        LexemePath<Lexeme> lexemes = ParticipleUtil.participle(content);
+        for (int i = 0; i < lexemes.size(); i++) {
+            Lexeme l = lexemes.get(i);
+            if (NlpUtil.isFeature(l.getProperty(), nees_allergy)) {
+                PreResult result = new PreResult();
+                result.setUniqueName("过敏--");
+                result.setDetailName("过敏--");
+                result.setValue(NlpUtil.concept(l, NegativeEnum.ALLERGY));
+                preResults.add(result);
+            }
+        }
+        return preResults;
+    }
+
+    public PreResult createPreResult(LexemePath<Lexeme> lexemes, Lexeme lexeme, int index) {
+        return null;
+    }
+
+    public String findBodyValue(LexemePath<Lexeme> lexemes, Lexeme lexeme, int index) {
+        return null;
+    }
+}

+ 42 - 0
nlp/src/main/java/org/diagbot/nlp/rule/pretreat/PretreatmentDrug.java

@@ -0,0 +1,42 @@
+package org.diagbot.nlp.rule.pretreat;
+
+import org.diagbot.nlp.participle.ParticipleUtil;
+import org.diagbot.nlp.participle.word.Lexeme;
+import org.diagbot.nlp.participle.word.LexemePath;
+import org.diagbot.nlp.rule.module.PreResult;
+import org.diagbot.nlp.util.NegativeEnum;
+import org.diagbot.nlp.util.NlpUtil;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by louhr on 2019/12/6.
+ */
+public class PretreatmentDrug extends Pretreatment {
+    protected NegativeEnum[] nees_med = new NegativeEnum[]{NegativeEnum.MEDICINE, NegativeEnum.MEDICINE_NAME, NegativeEnum.MEDICINE_PRD};
+
+    public List<PreResult> analyze(String content) throws java.io.IOException{
+        List<PreResult> preResults = new ArrayList<>();
+        LexemePath<Lexeme> lexemes = ParticipleUtil.participle(content);
+        for (int i = 0; i < lexemes.size(); i++) {
+            Lexeme l = lexemes.get(i);
+            if (NlpUtil.isFeature(l.getProperty(), nees_med)) {
+                PreResult result = new PreResult();
+                result.setUniqueName("药品--");
+                result.setDetailName("药品--");
+                result.setValue(NlpUtil.concept(l, NegativeEnum.MEDICINE));
+                preResults.add(result);
+            }
+        }
+        return preResults;
+    }
+
+    public PreResult createPreResult(LexemePath<Lexeme> lexemes, Lexeme lexeme, int index) {
+        return null;
+    }
+
+    public String findBodyValue(LexemePath<Lexeme> lexemes, Lexeme lexeme, int index) {
+        return null;
+    }
+}

+ 27 - 0
nlp/src/main/java/org/diagbot/nlp/rule/pretreat/PretreatmentInfectious.java

@@ -0,0 +1,27 @@
+package org.diagbot.nlp.rule.pretreat;
+
+import org.diagbot.nlp.participle.word.Lexeme;
+import org.diagbot.nlp.participle.word.LexemePath;
+import org.diagbot.nlp.rule.module.PreResult;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by louhr on 2019/12/9.
+ */
+public class PretreatmentInfectious extends Pretreatment {
+
+    public List<PreResult> analyze(String content) throws java.io.IOException{
+        List<PreResult> preResults = new ArrayList<>();
+        return preResults;
+    }
+
+    public PreResult createPreResult(LexemePath<Lexeme> lexemes, Lexeme lexeme, int index) {
+        return null;
+    }
+
+    public String findBodyValue(LexemePath<Lexeme> lexemes, Lexeme lexeme, int index) {
+        return null;
+    }
+}

+ 41 - 0
nlp/src/main/java/org/diagbot/nlp/rule/pretreat/PretreatmentOperation.java

@@ -0,0 +1,41 @@
+package org.diagbot.nlp.rule.pretreat;
+
+import org.diagbot.nlp.participle.ParticipleUtil;
+import org.diagbot.nlp.participle.word.Lexeme;
+import org.diagbot.nlp.participle.word.LexemePath;
+import org.diagbot.nlp.rule.module.PreResult;
+import org.diagbot.nlp.util.NegativeEnum;
+import org.diagbot.nlp.util.NlpUtil;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by louhr on 2019/12/6.
+ */
+public class PretreatmentOperation extends Pretreatment {
+    protected NegativeEnum[] operation_disease = new NegativeEnum[]{NegativeEnum.OPERATION};
+
+    public List<PreResult> analyze(String content) throws java.io.IOException{
+        List<PreResult> preResults = new ArrayList<>();
+        LexemePath<Lexeme> lexemes = ParticipleUtil.participle(content);
+        for (int i = 0; i < lexemes.size(); i++) {
+            Lexeme l = lexemes.get(i);
+            if (NlpUtil.isFeature(l.getProperty(), operation_disease)) {
+                PreResult result = new PreResult();
+                result.setUniqueName("手术--");
+                result.setDetailName("手术--");
+                result.setValue(NlpUtil.concept(l, NegativeEnum.OPERATION));
+                preResults.add(result);
+            }
+        }
+        return preResults;
+    }
+    public PreResult createPreResult(LexemePath<Lexeme> lexemes, Lexeme lexeme, int index) {
+        return null;
+    }
+
+    public String findBodyValue(LexemePath<Lexeme> lexemes, Lexeme lexeme, int index) {
+        return null;
+    }
+}

+ 27 - 0
nlp/src/main/java/org/diagbot/nlp/rule/pretreat/PretreatmentWound.java

@@ -0,0 +1,27 @@
+package org.diagbot.nlp.rule.pretreat;
+
+import org.diagbot.nlp.participle.word.Lexeme;
+import org.diagbot.nlp.participle.word.LexemePath;
+import org.diagbot.nlp.rule.module.PreResult;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by louhr on 2019/12/9.
+ */
+public class PretreatmentWound extends Pretreatment {
+
+    public List<PreResult> analyze(String content) throws java.io.IOException{
+        List<PreResult> preResults = new ArrayList<>();
+        return preResults;
+    }
+
+    public PreResult createPreResult(LexemePath<Lexeme> lexemes, Lexeme lexeme, int index) {
+        return null;
+    }
+
+    public String findBodyValue(LexemePath<Lexeme> lexemes, Lexeme lexeme, int index) {
+        return null;
+    }
+}