|
@@ -9,8 +9,10 @@ import org.diagbot.nlp.util.NlpCache;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
|
|
+import java.util.HashSet;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
+import java.util.Set;
|
|
|
|
|
|
public class ApplicationCacheUtil {
|
|
public class ApplicationCacheUtil {
|
|
|
|
|
|
@@ -24,6 +26,8 @@ public class ApplicationCacheUtil {
|
|
public static Map<String, List<Rule>> kl_rule_filter_map = null;
|
|
public static Map<String, List<Rule>> kl_rule_filter_map = null;
|
|
//危险值提醒
|
|
//危险值提醒
|
|
public static Map<String, RuleApp> kl_rule_app_filter_map = null;
|
|
public static Map<String, RuleApp> kl_rule_app_filter_map = null;
|
|
|
|
+ //pacs关系抽取过滤
|
|
|
|
+ public static Map<String, Map<String, String>> kl_diagnose_detail_filter_map = null;
|
|
|
|
|
|
public static Map<String, Map<String, String>> getStandard_info_synonym_map() {
|
|
public static Map<String, Map<String, String>> getStandard_info_synonym_map() {
|
|
if (standard_info_synonym_map == null) {
|
|
if (standard_info_synonym_map == null) {
|
|
@@ -154,4 +158,33 @@ public class ApplicationCacheUtil {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public static Map<String, Map<String, String>> getKl_diagnose_detail_filter_map() {
|
|
|
|
+ if (kl_diagnose_detail_filter_map == null) {
|
|
|
|
+ create_kl_diagnose_detail_filter_map();
|
|
|
|
+ }
|
|
|
|
+ return kl_diagnose_detail_filter_map;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static void create_kl_diagnose_detail_filter_map() {
|
|
|
|
+ kl_diagnose_detail_filter_map = new HashMap<>();
|
|
|
|
+ Map<String, String> diagnoseDetailRelationMap = new HashMap<>();
|
|
|
|
+ Set<String> diagnoseDetailRelation = new HashSet<>();
|
|
|
|
+ Configuration configuration = new DefaultConfig();
|
|
|
|
+ List<String> fileContents = configuration.readFileContents("bigdata_diagnose_detail_filter.dict");
|
|
|
|
+ for (String line : fileContents) {
|
|
|
|
+ String[] content = line.split("\\|", -1);
|
|
|
|
+ String[] relations = content[1].split("、");
|
|
|
|
+ for (String relation : relations) {
|
|
|
|
+ if (diagnoseDetailRelation.add(relation)) {
|
|
|
|
+ if (kl_diagnose_detail_filter_map.get(content[0]) == null) {
|
|
|
|
+ diagnoseDetailRelationMap.put(relation, relation);
|
|
|
|
+ kl_diagnose_detail_filter_map.put(content[0], diagnoseDetailRelationMap);
|
|
|
|
+ } else {
|
|
|
|
+ kl_diagnose_detail_filter_map.get(content[0]).put(relation, relation);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|