|
@@ -52,6 +52,10 @@ public class ApplicationCacheUtil {
|
|
return standard_info_type_tree_map;
|
|
return standard_info_type_tree_map;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 現已無用
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
public static Map<String, String> getDoc_result_mapping_vital_map() {
|
|
public static Map<String, String> getDoc_result_mapping_vital_map() {
|
|
if (doc_result_mapping_vital_map == null) {
|
|
if (doc_result_mapping_vital_map == null) {
|
|
Configuration configuration = new DefaultConfig();
|
|
Configuration configuration = new DefaultConfig();
|
|
@@ -62,131 +66,146 @@ public class ApplicationCacheUtil {
|
|
|
|
|
|
public static Map<String, String> getDoc_result_mapping_diag_map() {
|
|
public static Map<String, String> getDoc_result_mapping_diag_map() {
|
|
if (doc_result_mapping_diag_map == null) {
|
|
if (doc_result_mapping_diag_map == null) {
|
|
- Configuration configuration = new DefaultConfig();
|
|
|
|
- doc_result_mapping_diag_map = configuration.loadMapDict("doc_result_mapping_diag.dict");
|
|
|
|
|
|
+ createDoc_result_mapping_diag_map();
|
|
}
|
|
}
|
|
return doc_result_mapping_diag_map;
|
|
return doc_result_mapping_diag_map;
|
|
}
|
|
}
|
|
|
|
|
|
- public static Map<String, Map<String, ResultMappingFilter>> getDoc_result_mapping_filter_map() {
|
|
|
|
|
|
+ public static Map<String, String> createDoc_result_mapping_diag_map() {
|
|
Configuration configuration = new DefaultConfig();
|
|
Configuration configuration = new DefaultConfig();
|
|
|
|
+ doc_result_mapping_diag_map = configuration.loadMapDict("bigdata_diag_2_dept.dict");
|
|
|
|
+ return doc_result_mapping_diag_map;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static Map<String, Map<String, ResultMappingFilter>> getDoc_result_mapping_filter_map() {
|
|
if (doc_result_mapping_filter_map == null) {
|
|
if (doc_result_mapping_filter_map == null) {
|
|
- List<String> fileContents = configuration.readFileContents("doc_result_mapping_filter.dict");
|
|
|
|
- String[] line_string;
|
|
|
|
- List<ResultMappingFilter> resultMappingFilters = new ArrayList<>();
|
|
|
|
- try {
|
|
|
|
- for (int i = 0; i < fileContents.size(); i++) {
|
|
|
|
- line_string = org.apache.commons.lang3.StringUtils.split(fileContents.get(i), "\\|");
|
|
|
|
- if (line_string.length == 5) {
|
|
|
|
- ResultMappingFilter resultMappingFilter = new ResultMappingFilter();
|
|
|
|
- resultMappingFilter.setFeatureName(line_string[0]);
|
|
|
|
- resultMappingFilter.setFeatureType(line_string[1]);
|
|
|
|
- resultMappingFilter.setSex(line_string[2]);
|
|
|
|
- resultMappingFilter.setAgeStart(Integer.parseInt(line_string[3]));
|
|
|
|
- resultMappingFilter.setAgeEnd(Integer.parseInt(line_string[4]));
|
|
|
|
- resultMappingFilters.add(resultMappingFilter);
|
|
|
|
- }
|
|
|
|
|
|
+ createDoc_result_mapping_filter_map();
|
|
|
|
+ }
|
|
|
|
+ return doc_result_mapping_filter_map;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static Map<String, Map<String, ResultMappingFilter>> createDoc_result_mapping_filter_map() {
|
|
|
|
+ Configuration configuration = new DefaultConfig();
|
|
|
|
+ List<String> fileContents = configuration.readFileContents("bigdata_sex_age_filter.dict");
|
|
|
|
+ String[] line_string;
|
|
|
|
+ List<ResultMappingFilter> resultMappingFilters = new ArrayList<>();
|
|
|
|
+ try {
|
|
|
|
+ for (int i = 0; i < fileContents.size(); i++) {
|
|
|
|
+ line_string = org.apache.commons.lang3.StringUtils.split(fileContents.get(i), "\\|");
|
|
|
|
+ if (line_string.length == 5) {
|
|
|
|
+ ResultMappingFilter resultMappingFilter = new ResultMappingFilter();
|
|
|
|
+ resultMappingFilter.setFeatureName(line_string[0]);
|
|
|
|
+ resultMappingFilter.setFeatureType(line_string[1]);
|
|
|
|
+ resultMappingFilter.setSex(line_string[2]);
|
|
|
|
+ resultMappingFilter.setAgeStart(Integer.parseInt(line_string[3]));
|
|
|
|
+ resultMappingFilter.setAgeEnd(Integer.parseInt(line_string[4]));
|
|
|
|
+ resultMappingFilters.add(resultMappingFilter);
|
|
}
|
|
}
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
}
|
|
}
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
|
|
- doc_result_mapping_filter_map = new HashMap<>();
|
|
|
|
- Map<String, ResultMappingFilter> filterMap = null;
|
|
|
|
- for (ResultMappingFilter resultMappingFilter : resultMappingFilters) {
|
|
|
|
- filterMap = doc_result_mapping_filter_map.get(resultMappingFilter.getFeatureType());
|
|
|
|
- if (filterMap == null) {
|
|
|
|
- filterMap = new HashMap<>();
|
|
|
|
- }
|
|
|
|
- filterMap.put(resultMappingFilter.getFeatureName(), resultMappingFilter);
|
|
|
|
- doc_result_mapping_filter_map.put(resultMappingFilter.getFeatureType(), filterMap);
|
|
|
|
|
|
+ doc_result_mapping_filter_map = new HashMap<>();
|
|
|
|
+ Map<String, ResultMappingFilter> filterMap = null;
|
|
|
|
+ for (ResultMappingFilter resultMappingFilter : resultMappingFilters) {
|
|
|
|
+ filterMap = doc_result_mapping_filter_map.get(resultMappingFilter.getFeatureType());
|
|
|
|
+ if (filterMap == null) {
|
|
|
|
+ filterMap = new HashMap<>();
|
|
}
|
|
}
|
|
|
|
+ filterMap.put(resultMappingFilter.getFeatureName(), resultMappingFilter);
|
|
|
|
+ doc_result_mapping_filter_map.put(resultMappingFilter.getFeatureType(), filterMap);
|
|
}
|
|
}
|
|
return doc_result_mapping_filter_map;
|
|
return doc_result_mapping_filter_map;
|
|
}
|
|
}
|
|
|
|
|
|
public static Map<String, List<Map<String, String>>> getKl_result_mapping_standword_map() {
|
|
public static Map<String, List<Map<String, String>>> getKl_result_mapping_standword_map() {
|
|
if (kl_result_mapping_standword_map == null) {
|
|
if (kl_result_mapping_standword_map == null) {
|
|
- kl_result_mapping_standword_map = new HashMap<>();
|
|
|
|
- Configuration configuration = new DefaultConfig();
|
|
|
|
- List<String> fileContents = configuration.readFileContents("kl_result_mapping_standword.dict");
|
|
|
|
- List<Map<String, String>> standWordObjValList = null;
|
|
|
|
- Map<String, String> standWordObjVal = null;
|
|
|
|
- String operation = ">=|≥|>|大于|>|超过|<=|≤|<|小于|<|少于";
|
|
|
|
- try {
|
|
|
|
- for (String fileContent : fileContents) {
|
|
|
|
- LexemePath<Lexeme> lexemes = null;
|
|
|
|
- String op = "";
|
|
|
|
- String[] fileContentSplit = null;
|
|
|
|
- //每一个标准词根据大于小于符号切开,不然进行分词时还是会得到原本的标准词
|
|
|
|
- if (fileContent.contains(">") || fileContent.contains("大于")
|
|
|
|
- || fileContent.contains(">") || fileContent.contains("超过")) {
|
|
|
|
- op = ">";
|
|
|
|
- fileContentSplit = fileContent.split(operation);
|
|
|
|
- } else if (fileContent.contains("<") || fileContent.contains("小于")
|
|
|
|
- || fileContent.contains("<") || fileContent.contains("少于")) {
|
|
|
|
- op = "<";
|
|
|
|
- fileContentSplit = fileContent.split(operation);
|
|
|
|
- } else if (fileContent.contains(">=") || fileContent.contains("≥")){
|
|
|
|
- op = ">=";
|
|
|
|
- fileContentSplit = fileContent.split(operation);
|
|
|
|
- } else if (fileContent.contains("<=") || fileContent.contains("≤")) {
|
|
|
|
- op = "<=";
|
|
|
|
- fileContentSplit = fileContent.split(operation);
|
|
|
|
- } else {
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- LexemePath<Lexeme> lexemeWord = null;
|
|
|
|
- //每一个标准词切开后进行分词
|
|
|
|
- for (String fileContentWords : fileContentSplit) {
|
|
|
|
- lexemeWord = ParticipleUtil.participle(fileContentWords);
|
|
|
|
- if (lexemeWord != null) {
|
|
|
|
- if (null == lexemes) {
|
|
|
|
- lexemes = lexemeWord;
|
|
|
|
- } else {
|
|
|
|
- for (Lexeme lexeme : lexemeWord) {
|
|
|
|
- lexemes.add(lexeme);
|
|
|
|
- }
|
|
|
|
|
|
+ createKl_result_mapping_standword_map();
|
|
|
|
+ }
|
|
|
|
+ return kl_result_mapping_standword_map;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static Map<String, List<Map<String, String>>> createKl_result_mapping_standword_map() {
|
|
|
|
+ kl_result_mapping_standword_map = new HashMap<>();
|
|
|
|
+ Configuration configuration = new DefaultConfig();
|
|
|
|
+ List<String> fileContents = configuration.readFileContents("kl_result_mapping_standword.dict");
|
|
|
|
+ List<Map<String, String>> standWordObjValList = null;
|
|
|
|
+ Map<String, String> standWordObjVal = null;
|
|
|
|
+ String operation = ">=|≥|>|大于|>|超过|<=|≤|<|小于|<|少于";
|
|
|
|
+ try {
|
|
|
|
+ for (String fileContent : fileContents) {
|
|
|
|
+ LexemePath<Lexeme> lexemes = null;
|
|
|
|
+ String op = "";
|
|
|
|
+ String[] fileContentSplit = null;
|
|
|
|
+ //每一个标准词根据大于小于符号切开,不然进行分词时还是会得到原本的标准词
|
|
|
|
+ if (fileContent.contains(">") || fileContent.contains("大于")
|
|
|
|
+ || fileContent.contains(">") || fileContent.contains("超过")) {
|
|
|
|
+ op = ">";
|
|
|
|
+ fileContentSplit = fileContent.split(operation);
|
|
|
|
+ } else if (fileContent.contains("<") || fileContent.contains("小于")
|
|
|
|
+ || fileContent.contains("<") || fileContent.contains("少于")) {
|
|
|
|
+ op = "<";
|
|
|
|
+ fileContentSplit = fileContent.split(operation);
|
|
|
|
+ } else if (fileContent.contains(">=") || fileContent.contains("≥")){
|
|
|
|
+ op = ">=";
|
|
|
|
+ fileContentSplit = fileContent.split(operation);
|
|
|
|
+ } else if (fileContent.contains("<=") || fileContent.contains("≤")) {
|
|
|
|
+ op = "<=";
|
|
|
|
+ fileContentSplit = fileContent.split(operation);
|
|
|
|
+ } else {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ LexemePath<Lexeme> lexemeWord = null;
|
|
|
|
+ //每一个标准词切开后进行分词
|
|
|
|
+ for (String fileContentWords : fileContentSplit) {
|
|
|
|
+ lexemeWord = ParticipleUtil.participle(fileContentWords);
|
|
|
|
+ if (lexemeWord != null) {
|
|
|
|
+ if (null == lexemes) {
|
|
|
|
+ lexemes = lexemeWord;
|
|
|
|
+ } else {
|
|
|
|
+ for (Lexeme lexeme : lexemeWord) {
|
|
|
|
+ lexemes.add(lexeme);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- String standWordObjKey = "";
|
|
|
|
- standWordObjValList = new ArrayList<>();
|
|
|
|
- standWordObjVal = new HashMap<>();
|
|
|
|
- int i = 0;
|
|
|
|
- for (Lexeme lexeme : lexemes) {
|
|
|
|
- i++;
|
|
|
|
- if (lexeme.getProperty().contains(",")) {
|
|
|
|
- setProterty(lexeme); //如果分词后词性有多个,只选一个(暂时只处理症状,体征)
|
|
|
|
- }
|
|
|
|
- NegativeEnum lexemeNegativeEnum = NegativeEnum.parseOfValue(lexeme.getProperty());
|
|
|
|
- if (lexemeNegativeEnum == NegativeEnum.SYMPTOM || lexemeNegativeEnum == NegativeEnum.CAUSE
|
|
|
|
- || lexemeNegativeEnum == NegativeEnum.VITAL_INDEX) {
|
|
|
|
- if (!kl_result_mapping_standword_map.containsKey(lexeme.getText())) {
|
|
|
|
- kl_result_mapping_standword_map.put(lexeme.getText(), standWordObjValList);
|
|
|
|
- } else {
|
|
|
|
- standWordObjKey = lexeme.getText();
|
|
|
|
- }
|
|
|
|
- } else if (lexemeNegativeEnum == NegativeEnum.DIGITS) {
|
|
|
|
- standWordObjVal.put("value", lexeme.getText());
|
|
|
|
- } else if (lexemeNegativeEnum == NegativeEnum.UNIT
|
|
|
|
- || lexemeNegativeEnum == NegativeEnum.EVENT_TIME) {
|
|
|
|
- standWordObjVal.put("unit", lexeme.getText().toLowerCase());
|
|
|
|
|
|
+ }
|
|
|
|
+ String standWordObjKey = "";
|
|
|
|
+ standWordObjValList = new ArrayList<>();
|
|
|
|
+ standWordObjVal = new HashMap<>();
|
|
|
|
+ int i = 0;
|
|
|
|
+ for (Lexeme lexeme : lexemes) {
|
|
|
|
+ i++;
|
|
|
|
+ if (lexeme.getProperty().contains(",")) {
|
|
|
|
+ setProterty(lexeme); //如果分词后词性有多个,只选一个(暂时只处理症状,体征)
|
|
|
|
+ }
|
|
|
|
+ NegativeEnum lexemeNegativeEnum = NegativeEnum.parseOfValue(lexeme.getProperty());
|
|
|
|
+ if (lexemeNegativeEnum == NegativeEnum.SYMPTOM || lexemeNegativeEnum == NegativeEnum.CAUSE
|
|
|
|
+ || lexemeNegativeEnum == NegativeEnum.VITAL_INDEX) {
|
|
|
|
+ if (!kl_result_mapping_standword_map.containsKey(lexeme.getText())) {
|
|
|
|
+ kl_result_mapping_standword_map.put(lexeme.getText(), standWordObjValList);
|
|
|
|
+ } else {
|
|
|
|
+ standWordObjKey = lexeme.getText();
|
|
}
|
|
}
|
|
- if (lexemes.size() == i) {
|
|
|
|
- standWordObjVal.put("op", op);
|
|
|
|
- standWordObjVal.put("standword", fileContent);
|
|
|
|
- if (kl_result_mapping_standword_map.containsKey(standWordObjKey)) {
|
|
|
|
- kl_result_mapping_standword_map.get(standWordObjKey).add(standWordObjVal);
|
|
|
|
- } else {
|
|
|
|
- standWordObjValList.add(standWordObjVal);
|
|
|
|
- }
|
|
|
|
|
|
+ } else if (lexemeNegativeEnum == NegativeEnum.DIGITS) {
|
|
|
|
+ standWordObjVal.put("value", lexeme.getText());
|
|
|
|
+ } else if (lexemeNegativeEnum == NegativeEnum.UNIT
|
|
|
|
+ || lexemeNegativeEnum == NegativeEnum.EVENT_TIME) {
|
|
|
|
+ standWordObjVal.put("unit", lexeme.getText().toLowerCase());
|
|
|
|
+ }
|
|
|
|
+ if (lexemes.size() == i) {
|
|
|
|
+ standWordObjVal.put("op", op);
|
|
|
|
+ standWordObjVal.put("standword", fileContent);
|
|
|
|
+ if (kl_result_mapping_standword_map.containsKey(standWordObjKey)) {
|
|
|
|
+ kl_result_mapping_standword_map.get(standWordObjKey).add(standWordObjVal);
|
|
|
|
+ } else {
|
|
|
|
+ standWordObjValList.add(standWordObjVal);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
}
|
|
}
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
}
|
|
}
|
|
return kl_result_mapping_standword_map;
|
|
return kl_result_mapping_standword_map;
|
|
}
|
|
}
|