|
@@ -26,7 +26,7 @@ public class CacheFileManagerTest {
|
|
|
}
|
|
|
|
|
|
public void contextMappingInitialized() {
|
|
|
- MysqlJdbc nlpJdbc = new MysqlJdbc("root", "diagbot@20180822", "jdbc:mysql://192.168.2.235:3306/bigdata-web?useUnicode=true&characterEncoding=UTF-8");
|
|
|
+ MysqlJdbc nlpJdbc = new MysqlJdbc("root", "diagbot@20180822", "jdbc:mysql://192.168.2.235:3306/med-s?useUnicode=true&characterEncoding=UTF-8");
|
|
|
Connection conn = nlpJdbc.connect();
|
|
|
Statement st = null;
|
|
|
ResultSet rs = null;
|
|
@@ -36,31 +36,36 @@ public class CacheFileManagerTest {
|
|
|
String path = this.getClass().getClassLoader().getResource("").getPath();
|
|
|
path = path.substring(0, path.indexOf("target"));
|
|
|
//体征衍射
|
|
|
- String sql = "select distinct name, name_mapping from doc_result_mapping_vital order by name";
|
|
|
- st = conn.createStatement();
|
|
|
- rs = st.executeQuery(sql);
|
|
|
- List<Map.Entry<String, String>> libraryList = rsToMap(rs, true);
|
|
|
-
|
|
|
- FileWriter fw = new FileWriter(path + "src/main/resources/doc_result_mapping_vital.dict");
|
|
|
- for (Map.Entry<String, String> entry : libraryList) {
|
|
|
- fw.write(encrypDES.encrytor(entry.getKey() + "|" + entry.getValue()));
|
|
|
- fw.write("\n");
|
|
|
- }
|
|
|
- fw.close();
|
|
|
+// String sql = "select distinct name, name_mapping from doc_result_mapping_vital order by name";
|
|
|
+// st = conn.createStatement();
|
|
|
+// rs = st.executeQuery(sql);
|
|
|
+// List<Map.Entry<String, String>> libraryList = rsToMap(rs, true);
|
|
|
+//
|
|
|
+// FileWriter fw = new FileWriter(path + "src/main/resources/doc_result_mapping_vital.dict");
|
|
|
+// for (Map.Entry<String, String> entry : libraryList) {
|
|
|
+// fw.write(encrypDES.encrytor(entry.getKey() + "|" + entry.getValue()));
|
|
|
+// fw.write("\n");
|
|
|
+// }
|
|
|
+// fw.close();
|
|
|
//疾病科室
|
|
|
- sql = "select distinct diag_name, dept_name from doc_result_mapping_diag order by diag_name";
|
|
|
+ String sql = "SELECT k1.lib_name diag_name, k2.lib_name dept_name FROM kl_concept_common kcc, kl_concept k1, kl_concept k2 " +
|
|
|
+ "where kcc.concept_id = k1.id and kcc.dept_id = k2.id " +
|
|
|
+ "and k1.lib_type = 18 and kcc.dept_id is not null";
|
|
|
st = conn.createStatement();
|
|
|
rs = st.executeQuery(sql);
|
|
|
- libraryList = rsToMap(rs, true);
|
|
|
+ List<Map.Entry<String, String>> libraryList = rsToMap(rs, true);
|
|
|
|
|
|
- fw = new FileWriter(path + "src/main/resources/doc_result_mapping_diag.dict");
|
|
|
+ FileWriter fw = new FileWriter(path + "src/main/resources/doc_result_mapping_diag.dict");
|
|
|
for (Map.Entry<String, String> entry : libraryList) {
|
|
|
fw.write(encrypDES.encrytor(entry.getKey() + "|" + entry.getValue()));
|
|
|
fw.write("\n");
|
|
|
}
|
|
|
fw.close();
|
|
|
//性别年龄
|
|
|
- sql = "select feature_name, feature_type, sex, age_start, age_end from doc_result_mapping_filter";
|
|
|
+ sql = "SELECT k1.lib_name, k1.lib_type, kcc.sex_type, kcc.min_age, kcc.max_age " +
|
|
|
+ "FROM kl_concept_common kcc, kl_concept k1 " +
|
|
|
+ "where kcc.concept_id = k1.id " +
|
|
|
+ "and k1.lib_type in (1, 18) and kcc.dept_id is not null;";
|
|
|
st = conn.createStatement();
|
|
|
rs = st.executeQuery(sql);
|
|
|
fw = new FileWriter(path + "src/main/resources/doc_result_mapping_filter.dict");
|
|
@@ -72,7 +77,9 @@ public class CacheFileManagerTest {
|
|
|
r3 = rs.getString(3);
|
|
|
r4 = rs.getString(4);
|
|
|
r5 = rs.getString(5);
|
|
|
-
|
|
|
+ if ("18".equals(r2)) {
|
|
|
+ r2 = "2";
|
|
|
+ }
|
|
|
fw.write(encrypDES.encrytor(r1 + "|" + r2 + "|" + r3 + "|" + r4 + "|" + r5));
|
|
|
fw.write("\n");
|
|
|
}
|