|
@@ -8,6 +8,7 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.boot.ApplicationArguments;
|
|
|
import org.springframework.boot.ApplicationRunner;
|
|
|
import org.springframework.stereotype.Component;
|
|
@@ -29,6 +30,9 @@ public class CacheUtil implements ApplicationRunner {
|
|
|
@Autowired
|
|
|
private RedisUtil redisUtil;
|
|
|
|
|
|
+ @Value("${qc.hospital_id}")
|
|
|
+ private String hospitalId;
|
|
|
+
|
|
|
public void run(ApplicationArguments var1) {
|
|
|
try {
|
|
|
this.putConceptDiagPropertyMap();//疾病相关信息放入缓存 包括疾病是否是慢病、传染病、常见症状、同义词
|
|
@@ -48,7 +52,7 @@ public class CacheUtil implements ApplicationRunner {
|
|
|
*/
|
|
|
public void putConceptDiagPropertyMap() throws Exception {
|
|
|
Configuration configuration = new DefaultConfig();
|
|
|
- List<String> lines = configuration.readTargetFileContents("cache/concept_diag_properties.dict");
|
|
|
+ List<String> lines = configuration.readTargetFileContents("cache/" + hospitalId + "/concept_diag_properties.dict");
|
|
|
|
|
|
Map<String, Map<String, Object>> diagMap = new HashMap<>();
|
|
|
for (String line : lines) {
|
|
@@ -57,14 +61,16 @@ public class CacheUtil implements ApplicationRunner {
|
|
|
List<String> synonymsList = new ArrayList<>();
|
|
|
List<String> symptomsList = new ArrayList<>();
|
|
|
if (StringUtils.isNotEmpty(line_arr[3])) {
|
|
|
+ line_arr[3] = line_arr[3].trim();
|
|
|
synonymsList = java.util.Arrays.asList(line_arr[3].split(","));
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(line_arr[4])) {
|
|
|
+ line_arr[4] = line_arr[4].trim();
|
|
|
symptomsList = java.util.Arrays.asList(line_arr[4].split(","));
|
|
|
}
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
- map.put("infectious", line_arr[2]);
|
|
|
- map.put("chronic", line_arr[1]);
|
|
|
+ map.put("infectious", line_arr[2].trim());
|
|
|
+ map.put("chronic", line_arr[1].trim());
|
|
|
map.put("synonyms", synonymsList);
|
|
|
map.put("symptoms", symptomsList);
|
|
|
diagMap.put(line_arr[0], map);
|
|
@@ -79,7 +85,7 @@ public class CacheUtil implements ApplicationRunner {
|
|
|
*/
|
|
|
public void putHospitalDoctorInfoMap() throws Exception {
|
|
|
Configuration configuration = new DefaultConfig();
|
|
|
- List<String> lines = configuration.readTargetFileContents("cache/hospital_doctor_info.dict");
|
|
|
+ List<String> lines = configuration.readTargetFileContents("cache/" + hospitalId + "/hospital_doctor_info.dict");
|
|
|
|
|
|
Map<String, Map<String, Object>> hospitalDoctorMap = new HashMap<>();
|
|
|
for (String line : lines) {
|
|
@@ -101,11 +107,11 @@ public class CacheUtil implements ApplicationRunner {
|
|
|
*/
|
|
|
public void putHospitalDiagMap() throws Exception {
|
|
|
Configuration configuration = new DefaultConfig();
|
|
|
- List<String> lines = configuration.readTargetFileContents("cache/hospital_diag_info.dict");
|
|
|
+ List<String> lines = configuration.readTargetFileContents("cache/" + hospitalId + "/hospital_diag_info.dict");
|
|
|
Map<String, Map<String, String>> hospitalDiagMap = new HashMap<>();
|
|
|
for (String line : lines) {
|
|
|
Map<String, String> detail = new HashMap<>();
|
|
|
- detail.put("name", line);
|
|
|
+ detail.put("name", line.trim());
|
|
|
detail.put("icd10", "A001");
|
|
|
hospitalDiagMap.put(line, detail);
|
|
|
}
|
|
@@ -117,11 +123,11 @@ public class CacheUtil implements ApplicationRunner {
|
|
|
*/
|
|
|
public void putHospitalDiagHuaZMap() throws Exception {
|
|
|
Configuration configuration = new DefaultConfig();
|
|
|
- List<String> lines = configuration.readTargetFileContents("cache/hospital_diag_info.dict");
|
|
|
+ List<String> lines = configuration.readTargetFileContents("cache/" + hospitalId + "/hospital_diag_info.dict");
|
|
|
Map<String, Map<String, String>> hospitalDiagMap = new HashMap<>();
|
|
|
for (String line : lines) {
|
|
|
Map<String, String> detail = new HashMap<>();
|
|
|
- detail.put("name", line);
|
|
|
+ detail.put("name", line.trim());
|
|
|
detail.put("icd10", "A001");
|
|
|
hospitalDiagMap.put(line, detail);
|
|
|
}
|
|
@@ -133,11 +139,11 @@ public class CacheUtil implements ApplicationRunner {
|
|
|
*/
|
|
|
public void putLantoneDiagHuaZMap() throws Exception {
|
|
|
Configuration configuration = new DefaultConfig();
|
|
|
- List<String> lines = configuration.readTargetFileContents("cache/hospital_diag_info.dict");
|
|
|
+ List<String> lines = configuration.readTargetFileContents("cache/" + hospitalId + "/hospital_diag_info.dict");
|
|
|
Map<String, Map<String, String>> hospitalDiagMap = new HashMap<>();
|
|
|
for (String line : lines) {
|
|
|
Map<String, String> detail = new HashMap<>();
|
|
|
- detail.put("name", line);
|
|
|
+ detail.put("name", line.trim());
|
|
|
detail.put("icd10", "A001");
|
|
|
hospitalDiagMap.put(line, detail);
|
|
|
}
|
|
@@ -148,7 +154,7 @@ public class CacheUtil implements ApplicationRunner {
|
|
|
*/
|
|
|
public void putClinicBodyPartMap() throws Exception {
|
|
|
Configuration configuration = new DefaultConfig();
|
|
|
- List<String> lines = configuration.readTargetFileContents("cache/concept_clinic_bodypart_properties.dict");
|
|
|
+ List<String> lines = configuration.readTargetFileContents("cache/" + hospitalId + "/concept_clinic_bodypart_properties.dict");
|
|
|
List<String> clinicBodyPartList = new ArrayList<>();
|
|
|
for (String line : lines) {
|
|
|
clinicBodyPartList.add(line);
|