|
@@ -11,7 +11,7 @@ import java.sql.Statement;
|
|
|
public class CacheFile {
|
|
|
public static void main(String[] args) {
|
|
|
CacheFile cacheFile = new CacheFile();
|
|
|
- cacheFile.sexAge();
|
|
|
+ cacheFile.vitalMaping();
|
|
|
}
|
|
|
//诊断和性别,年龄的对应
|
|
|
public void sexAge(){
|
|
@@ -75,4 +75,39 @@ public class CacheFile {
|
|
|
nlpJdbc.close(rs, st, conn);
|
|
|
}
|
|
|
}
|
|
|
+ //体征及体征结果
|
|
|
+ public void vitalMaping() {
|
|
|
+ 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;
|
|
|
+ try {
|
|
|
+ EncrypDES encrypDES = new EncrypDES();//加密对象
|
|
|
+ String path = this.getClass().getClassLoader().getResource("").getPath();
|
|
|
+ path = path.substring(0, path.indexOf("target"));
|
|
|
+ String sql = "SELECT\n" +
|
|
|
+ "\ti1.lib_name name1,\n" +
|
|
|
+ "\ti2.lib_name name2 \n" +
|
|
|
+ "FROM\n" +
|
|
|
+ "\t`kl_relation` l \n" +
|
|
|
+ "\tLEFT JOIN kl_concept i1 ON l.start_id = i1.id \n" +
|
|
|
+ "\tLEFT JOIN kl_concept i2 ON l.end_id = i2.id \n" +
|
|
|
+ "where l.relation_id=19 AND i1.lib_type=35 AND i2.lib_type=33";
|
|
|
+ st = conn.createStatement();
|
|
|
+ rs = st.executeQuery(sql);
|
|
|
+ FileWriter fw = new FileWriter(path + "src/main/resources/vital.dict");
|
|
|
+ String r1, r2;
|
|
|
+ while (rs.next()) {
|
|
|
+ r1 = rs.getString(1);//体征结果
|
|
|
+ r2 = rs.getString(2);//体征指标
|
|
|
+ fw.write(encrypDES.encrytor(r1 + "|" + r2));
|
|
|
+ fw.write("\n");
|
|
|
+ }
|
|
|
+ fw.close();
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ } finally {
|
|
|
+ nlpJdbc.close(rs, st, conn);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|