|
@@ -28,13 +28,11 @@ public class CacheUtil {
|
|
|
public static Map<String,String> createDiagDepartCache(){
|
|
|
String path = "graph_diag_2_dept.dict";
|
|
|
Configuration configuration = new DefaultConfig();
|
|
|
- if(doc_result_mapping_diag_map == null){
|
|
|
- doc_result_mapping_diag_map = new HashMap<>();
|
|
|
- List<String> contentList = configuration.readFileContents(path);
|
|
|
- for (String s:contentList) {
|
|
|
- String[] splits = s.split("\\|");
|
|
|
- doc_result_mapping_diag_map.put(splits[0],splits[1]);
|
|
|
- }
|
|
|
+ doc_result_mapping_diag_map = new HashMap<>();
|
|
|
+ List<String> contentList = configuration.readFileContents(path);
|
|
|
+ for (String s:contentList) {
|
|
|
+ String[] splits = s.split("\\|");
|
|
|
+ doc_result_mapping_diag_map.put(splits[0],splits[1]);
|
|
|
}
|
|
|
return doc_result_mapping_diag_map;
|
|
|
}
|
|
@@ -50,27 +48,25 @@ public class CacheUtil {
|
|
|
public static Map<String,Integer> createDiagClassifyJiCache(){
|
|
|
String path = "graph_diag_normalize.dict";
|
|
|
Configuration configuration = new DefaultConfig();
|
|
|
- if(diagClassifyJiMap == null){
|
|
|
- diagClassifyJiMap = new HashMap<>();
|
|
|
- List<String> contentList = configuration.readFileContents(path);
|
|
|
- String diagName =null,bigdiagName=null;
|
|
|
- String[] diagSort =null;String[] split = null;
|
|
|
- for (String s:contentList) {
|
|
|
- String[] splits = s.split("\\|");
|
|
|
- if (splits.length >= 2) {
|
|
|
- diagName = splits[0].trim();//疾病本体
|
|
|
- bigdiagName = splits[1].trim();//疾病大类
|
|
|
- split = bigdiagName.split("\\、");
|
|
|
- for (String dis:split) {
|
|
|
- diagClassifyJiMap.put(dis, 2);
|
|
|
- }
|
|
|
- diagClassifyJiMap.put(diagName,1);
|
|
|
- if (splits.length == 3) {
|
|
|
- diagSort = splits[2].split("\\、");
|
|
|
- for (String dis : diagSort) {
|
|
|
- if (StringUtils.isNotEmpty(dis.trim())) {
|
|
|
- diagClassifyJiMap.put(dis.trim(), 3);
|
|
|
- }
|
|
|
+ diagClassifyJiMap = new HashMap<>();
|
|
|
+ List<String> contentList = configuration.readFileContents(path);
|
|
|
+ String diagName =null,bigdiagName=null;
|
|
|
+ String[] diagSort =null;String[] split = null;
|
|
|
+ for (String s:contentList) {
|
|
|
+ String[] splits = s.split("\\|");
|
|
|
+ if (splits.length >= 2) {
|
|
|
+ diagName = splits[0].trim();//疾病本体
|
|
|
+ bigdiagName = splits[1].trim();//疾病大类
|
|
|
+ split = bigdiagName.split("\\、");
|
|
|
+ for (String dis:split) {
|
|
|
+ diagClassifyJiMap.put(dis, 2);
|
|
|
+ }
|
|
|
+ diagClassifyJiMap.put(diagName,1);
|
|
|
+ if (splits.length == 3) {
|
|
|
+ diagSort = splits[2].split("\\、");
|
|
|
+ for (String dis : diagSort) {
|
|
|
+ if (StringUtils.isNotEmpty(dis.trim())) {
|
|
|
+ diagClassifyJiMap.put(dis.trim(), 3);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -90,28 +86,26 @@ public class CacheUtil {
|
|
|
public static Map<String,String> createDiagClassifyCache(){
|
|
|
String path = "graph_diag_normalize.dict";
|
|
|
Configuration configuration = new DefaultConfig();
|
|
|
- if(diagClassifyMap == null){
|
|
|
- diagClassifyMap = new HashMap<>();
|
|
|
- List<String> contentList = configuration.readFileContents(path);
|
|
|
- String diagName =null,bigdiagName=null;
|
|
|
- String[] diagSort =null;String[] split =null;
|
|
|
- for (String s:contentList) {
|
|
|
- String[] splits = s.split("\\|");
|
|
|
- if (splits.length >= 2) {
|
|
|
- diagName = splits[0].trim();//疾病本体
|
|
|
- bigdiagName = splits[1].trim();//疾病大类
|
|
|
- split = bigdiagName.split("\\、");
|
|
|
- for (String dis:split
|
|
|
- ) {
|
|
|
- diagClassifyMap.put(dis, diagName);
|
|
|
- }
|
|
|
+ diagClassifyMap = new HashMap<>();
|
|
|
+ List<String> contentList = configuration.readFileContents(path);
|
|
|
+ String diagName =null,bigdiagName=null;
|
|
|
+ String[] diagSort =null;String[] split =null;
|
|
|
+ for (String s:contentList) {
|
|
|
+ String[] splits = s.split("\\|");
|
|
|
+ if (splits.length >= 2) {
|
|
|
+ diagName = splits[0].trim();//疾病本体
|
|
|
+ bigdiagName = splits[1].trim();//疾病大类
|
|
|
+ split = bigdiagName.split("\\、");
|
|
|
+ for (String dis:split
|
|
|
+ ) {
|
|
|
+ diagClassifyMap.put(dis, diagName);
|
|
|
+ }
|
|
|
|
|
|
- if (splits.length == 3) {
|
|
|
- diagSort = splits[2].split("\\、");
|
|
|
- for (String dis : diagSort) {
|
|
|
- if (StringUtils.isNotEmpty(dis.trim())) {
|
|
|
- diagClassifyMap.put(dis.trim(), bigdiagName);
|
|
|
- }
|
|
|
+ if (splits.length == 3) {
|
|
|
+ diagSort = splits[2].split("\\、");
|
|
|
+ for (String dis : diagSort) {
|
|
|
+ if (StringUtils.isNotEmpty(dis.trim())) {
|
|
|
+ diagClassifyMap.put(dis.trim(), bigdiagName);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -151,20 +145,18 @@ public class CacheUtil {
|
|
|
public static Map<String,Map<String,String>> createSexAgeCache(){
|
|
|
String path = "graph_sex_age_filter.dict";
|
|
|
Configuration configuration = new DefaultConfig();
|
|
|
- if(sexAgeMap == null){
|
|
|
- sexAgeMap = new HashMap<>();
|
|
|
- List<String> contentList = configuration.readFileContents(path);
|
|
|
- for (String s:contentList) {
|
|
|
- Map<String,String> contentMap = new HashMap<>();
|
|
|
- String[] splits = s.split("\\|");
|
|
|
- String sexTyep = splits[1];
|
|
|
- String min_age = splits[2];
|
|
|
- String max_age = splits[3];
|
|
|
- contentMap.put("sexType",sexTyep);
|
|
|
- contentMap.put("min_age",min_age);
|
|
|
- contentMap.put("max_age",max_age);
|
|
|
- sexAgeMap.put(splits[0],contentMap);
|
|
|
- }
|
|
|
+ sexAgeMap = new HashMap<>();
|
|
|
+ List<String> contentList = configuration.readFileContents(path);
|
|
|
+ for (String s:contentList) {
|
|
|
+ Map<String,String> contentMap = new HashMap<>();
|
|
|
+ String[] splits = s.split("\\|");
|
|
|
+ String sexTyep = splits[1];
|
|
|
+ String min_age = splits[2];
|
|
|
+ String max_age = splits[3];
|
|
|
+ contentMap.put("sexType",sexTyep);
|
|
|
+ contentMap.put("min_age",min_age);
|
|
|
+ contentMap.put("max_age",max_age);
|
|
|
+ sexAgeMap.put(splits[0],contentMap);
|
|
|
}
|
|
|
return sexAgeMap;
|
|
|
}
|
|
@@ -179,13 +171,11 @@ public class CacheUtil {
|
|
|
public static Map<String,String> createVitalCache(){
|
|
|
String path = "graph_vital_convert.dict";
|
|
|
Configuration configuration = new DefaultConfig();
|
|
|
- if(vitalMap == null){
|
|
|
- vitalMap = new HashMap<>();
|
|
|
- List<String> contentList = configuration.readFileContents(path);
|
|
|
- for (String s:contentList) {
|
|
|
- String[] splits = s.split("\\|");
|
|
|
- vitalMap.put(splits[0],splits[1]);
|
|
|
- }
|
|
|
+ vitalMap = new HashMap<>();
|
|
|
+ List<String> contentList = configuration.readFileContents(path);
|
|
|
+ for (String s:contentList) {
|
|
|
+ String[] splits = s.split("\\|");
|
|
|
+ vitalMap.put(splits[0],splits[1]);
|
|
|
}
|
|
|
return vitalMap;
|
|
|
}
|