|
@@ -27,24 +27,29 @@ public class ConceptTest {
|
|
|
private static final String EXCEL_XLS = "xls";
|
|
|
private static final String EXCEL_XLSX = "xlsx";
|
|
|
|
|
|
- private static final String lis_path = "E:\\git\\docs\\医学知识库\\化验\\化验标准库第一期-邵启华0614.xlsx";
|
|
|
+ private static final String lis_path = "E:\\git\\docs\\医学知识库\\化验\\化验标准库第一期-邵启华0617.xlsx";
|
|
|
private static final String pacs_path = "E:\\git\\docs\\医学知识库\\辅检\\辅检标准库第一期-邵青华0612.xlsx";
|
|
|
- private static final String symptom_path = "E:\\git\\docs\\医学知识库\\症状\\症状标准库-王玲0613.xlsx";
|
|
|
- private static final String drug_path = "E:\\git\\docs\\医学知识库\\药品\\药品标准库-邵启华0515.xlsx";
|
|
|
- private static final String vital_path = "E:\\git\\docs\\医学知识库\\体征\\体征标准库第一阶段-吕纯0614.xlsx";
|
|
|
- private static final String part_path = "E:\\git\\docs\\医学知识库\\部位和科室\\部位标准库-最新结构0613.xlsx";
|
|
|
+ private static final String symptom_path = "E:\\git\\docs\\医学知识库\\症状\\症状标准库-王玲0619.xlsx";
|
|
|
+ private static final String drug_path = "E:\\git\\docs\\医学知识库\\药品\\药品标准库-邵启华0618.xlsx";
|
|
|
+ private static final String vital_path = "E:\\git\\docs\\医学知识库\\体征\\体征标准库第一阶段-吕纯0618.xlsx";
|
|
|
+ private static final String part_path = "E:\\git\\docs\\医学知识库\\部位和科室\\部位标准库-最新结构0617.xlsx";
|
|
|
private static final String disease_path = "E:\\git\\docs\\医学知识库\\诊断名和治疗方案\\知识库标准疾病名称和疾病治疗方案-邵青华0605.xlsx";
|
|
|
private static final String dept_path = "E:\\git\\docs\\医学知识库\\部位和科室\\科室标准库-邵启华0521.xlsx";
|
|
|
+ private static final String scale_path = "E:\\git\\docs\\医学知识库\\量表\\量表标准词-邵青华0618.xlsx";
|
|
|
+ private static final String other_path = "E:\\git\\docs\\医学知识库\\其他史\\其他史-邵青华0619.xls";
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
try {
|
|
|
-// insertSymptom();
|
|
|
+ insertSymptom();
|
|
|
// insertPart();
|
|
|
// insertVital();
|
|
|
// insertLis();
|
|
|
// insertPacs();
|
|
|
// insertDisease();
|
|
|
// insertDept();
|
|
|
+// insertDrug();
|
|
|
+// insertScale();
|
|
|
+// insertOther();
|
|
|
|
|
|
// insertStandardInfo();
|
|
|
// validateSplit();
|
|
@@ -54,176 +59,22 @@ public class ConceptTest {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static void validateSplit() {
|
|
|
- MysqlJdbc nlpJdbc = new MysqlJdbc("root", "diagbot@20180822", "jdbc:mysql://192.168.2.235:3306/diagbot-med-0606?useUnicode=true&characterEncoding=UTF-8");
|
|
|
- List<Map<String, String>> data = nlpJdbc.query("library_info", new String[]{"id", "name"}, "");
|
|
|
-
|
|
|
- Map<String, String> all_words = new HashMap<>();
|
|
|
- for (Map<String, String> map : data) {
|
|
|
- all_words.put(map.get("name"), map.get("name"));
|
|
|
- }
|
|
|
-
|
|
|
- nlpJdbc = new MysqlJdbc("root", "diagbot@20180822", "jdbc:mysql://192.168.2.235:3306/diagbot-rule?useUnicode=true&characterEncoding=UTF-8");
|
|
|
- data = nlpJdbc.query("medicine_rule_split", new String[]{"id", "split_word"}, "");
|
|
|
- String[] names = null;
|
|
|
- List<String> notin_words = new ArrayList<>();
|
|
|
- for (Map<String, String> map : data) {
|
|
|
- names = map.get("split_word").split(",");
|
|
|
- for (int i = 0; i < names.length; i++) {
|
|
|
- if (all_words.get(names[i]) == null) {
|
|
|
- notin_words.add(names[i]);
|
|
|
- all_words.put(names[i], names[i]);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- List<Map<String, Object>> notin_words_list = new ArrayList<>();
|
|
|
- for (String word : notin_words) {
|
|
|
- Map<String, Object> line = new HashMap<>();
|
|
|
- line.put("name", word);
|
|
|
- notin_words_list.add(line);
|
|
|
- }
|
|
|
- nlpJdbc = new MysqlJdbc("root", "diagbot@20180822", "jdbc:mysql://192.168.2.235:3306/diagbot-med-0606?useUnicode=true&characterEncoding=UTF-8");
|
|
|
- nlpJdbc.insert(notin_words_list, "kl_standard_notin", new String[]{"name"});
|
|
|
-
|
|
|
+ public static void insertScale() throws Exception {
|
|
|
+ insertOneColumn(0, scale_path, 0, "48", "量表");
|
|
|
+ insertOneColumn(1, scale_path, 0, "49", "不良反应");
|
|
|
+ insertOneColumn(2, scale_path, 0, "50", "核心指标");
|
|
|
}
|
|
|
|
|
|
public static void insertDept() throws Exception {
|
|
|
- File excelFile = new File(dept_path); // 创建文件对象
|
|
|
- FileInputStream in = new FileInputStream(excelFile); // 文件流
|
|
|
- Workbook workbook = getWorkbok(in, excelFile);
|
|
|
- Sheet sheet = workbook.getSheetAt(0);
|
|
|
-
|
|
|
- int count = 0;
|
|
|
- Map<String, String> concept_words = new HashMap<>();
|
|
|
- Map<String, String> all_words = new HashMap<>();
|
|
|
- for (Row row : sheet) {
|
|
|
- // 跳过第一和第二行的目录
|
|
|
- if (count < 1) {
|
|
|
- count++;
|
|
|
- continue;
|
|
|
- }
|
|
|
- count++;
|
|
|
- try {
|
|
|
- Cell cell0 = row.getCell(0);
|
|
|
- if (cell0 != null && StringUtils.isNotEmpty(cell0.getStringCellValue())) {
|
|
|
- concept_words.put(cell0.getStringCellValue(), cell0.getStringCellValue());
|
|
|
- all_words.put(cell0.getStringCellValue(), cell0.getStringCellValue());
|
|
|
- }
|
|
|
- Cell cell1 = row.getCell(1);
|
|
|
- if (cell1 != null && !"".equals(cell1.getStringCellValue())) {
|
|
|
- all_words.put(cell1.getStringCellValue(), cell0.getStringCellValue());
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- System.out.println("第" + count + "出现错误!");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- List<Map<String, Object>> all_words_list = new ArrayList<>();
|
|
|
- for (Map.Entry<String, String> entry : all_words.entrySet()) {
|
|
|
- Map<String, Object> line = new HashMap<>();
|
|
|
- if (StringUtils.isNotEmpty(entry.getKey())) {
|
|
|
- line.put("name", entry.getKey());
|
|
|
- line.put("type_id", "47");
|
|
|
- line.put("type", "科室");
|
|
|
- all_words_list.add(line);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- insertLibraryInfo(all_words_list, all_words, concept_words);
|
|
|
+ insertTwoColumn(dept_path, 0, 1, "47", "科室");
|
|
|
}
|
|
|
|
|
|
public static void insertSymptom() throws Exception {
|
|
|
- File excelFile = new File(symptom_path); // 创建文件对象
|
|
|
- FileInputStream in = new FileInputStream(excelFile); // 文件流
|
|
|
- Workbook workbook = getWorkbok(in, excelFile);
|
|
|
- Sheet sheet = workbook.getSheetAt(1);
|
|
|
-
|
|
|
- int count = 0;
|
|
|
- Map<String, String> concept_words = new HashMap<>();
|
|
|
- Map<String, String> all_words = new HashMap<>();
|
|
|
- for (Row row : sheet) {
|
|
|
- // 跳过第一和第二行的目录
|
|
|
- if (count < 1) {
|
|
|
- count++;
|
|
|
- continue;
|
|
|
- }
|
|
|
- count++;
|
|
|
- try {
|
|
|
- Cell cell0 = row.getCell(0);
|
|
|
- if (cell0 != null && !"".equals(cell0.getStringCellValue())) {
|
|
|
- put(concept_words, cell0);
|
|
|
- all_words.put(cell0.getStringCellValue(), cell0.getStringCellValue());
|
|
|
- }
|
|
|
- Cell cell1 = row.getCell(1);
|
|
|
- if (cell1 != null && !"".equals(cell1.getStringCellValue())) {
|
|
|
- all_words.put(cell1.getStringCellValue(), cell0.getStringCellValue());
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- System.out.println("第" + count + "出现错误!");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- List<Map<String, Object>> all_words_list = new ArrayList<>();
|
|
|
- for (Map.Entry<String, String> entry : all_words.entrySet()) {
|
|
|
- Map<String, Object> line = new HashMap<>();
|
|
|
- if (StringUtils.isNotEmpty(entry.getKey())) {
|
|
|
- line.put("name", entry.getKey());
|
|
|
- line.put("type_id", "1");
|
|
|
- line.put("type", "症状");
|
|
|
- all_words_list.add(line);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- insertLibraryInfo(all_words_list, all_words, concept_words);
|
|
|
+ insertTwoColumn(1, symptom_path, 0, 1, "1", "症状");
|
|
|
}
|
|
|
|
|
|
public static void insertPart() throws Exception {
|
|
|
- File excelFile = new File(part_path); // 创建文件对象
|
|
|
- FileInputStream in = new FileInputStream(excelFile); // 文件流
|
|
|
- Workbook workbook = getWorkbok(in, excelFile);
|
|
|
- Sheet sheet = workbook.getSheetAt(0);
|
|
|
-
|
|
|
- int count = 0;
|
|
|
- Map<String, String> concept_words = new HashMap<>();
|
|
|
- Map<String, String> all_words = new HashMap<>();
|
|
|
- for (Row row : sheet) {
|
|
|
- // 跳过第一和第二行的目录
|
|
|
- if (count < 1) {
|
|
|
- count++;
|
|
|
- continue;
|
|
|
- }
|
|
|
- count++;
|
|
|
- try {
|
|
|
- Cell cell0 = row.getCell(1);
|
|
|
- if (cell0 != null && !"".equals(cell0.getStringCellValue())) {
|
|
|
- concept_words.put(cell0.getStringCellValue(), cell0.getStringCellValue());
|
|
|
- all_words.put(cell0.getStringCellValue(), cell0.getStringCellValue());
|
|
|
- }
|
|
|
- Cell cell1 = row.getCell(0);
|
|
|
- if (cell1 != null && !"".equals(cell1.getStringCellValue())) {
|
|
|
- all_words.put(cell1.getStringCellValue(), cell0.getStringCellValue());
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- System.out.println("第" + count + "出现错误!");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- List<Map<String, Object>> all_words_list = new ArrayList<>();
|
|
|
- for (Map.Entry<String, String> entry : all_words.entrySet()) {
|
|
|
- Map<String, Object> line = new HashMap<>();
|
|
|
- if (StringUtils.isNotEmpty(entry.getKey())) {
|
|
|
- line.put("name", entry.getKey());
|
|
|
- line.put("type_id", "3");
|
|
|
- line.put("type", "部位");
|
|
|
- all_words_list.add(line);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- insertLibraryInfo(all_words_list, all_words, concept_words);
|
|
|
+ insertTwoColumn(part_path, 0, 1, "3", "部位");
|
|
|
}
|
|
|
|
|
|
public static void insertVital() throws Exception {
|
|
@@ -239,16 +90,43 @@ public class ConceptTest {
|
|
|
}
|
|
|
|
|
|
public static void insertLisMeal() throws Exception {
|
|
|
- File excelFile = new File(lis_path); // 创建文件对象
|
|
|
- FileInputStream in = new FileInputStream(excelFile); // 文件流
|
|
|
- Workbook workbook = getWorkbok(in, excelFile);
|
|
|
- Sheet sheet = workbook.getSheetAt(0);
|
|
|
+ insertTwoColumn(lis_path, 0, 1, "12", "化验套餐");
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void insertLisDetail() throws Exception {
|
|
|
+ insertTwoColumn(lis_path, 2, 3, "13", "化验明细");
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void insertLisPublic() throws Exception {
|
|
|
+ insertOneColumn(lis_path, 4, "46", "化验公表项");
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void insertOther() throws Exception {
|
|
|
+ insertOneColumn(other_path, 0, "55", "既往疾病史");
|
|
|
+ insertOneColumn(other_path, 1, "56", "外伤史");
|
|
|
+ insertOneColumn(other_path, 2, "57", "手术史");
|
|
|
+ insertOneColumn(other_path, 3, "58", "输血史");
|
|
|
+ insertOneColumn(other_path, 4, "59", "传染病史");
|
|
|
+ insertOneColumn(other_path, 5, "60", "不良习惯");
|
|
|
+ insertOneColumn(other_path, 6, "61", "冶游史");
|
|
|
+ insertOneColumn(other_path, 7, "62", "婚育史");
|
|
|
+ insertOneColumn(other_path, 8, "63", "生育史");
|
|
|
+ insertOneColumn(other_path, 9, "64", "家族史");
|
|
|
+ insertOneColumn(other_path, 10, "65", "食物过敏史");
|
|
|
+ insertOneColumn(other_path, 11, "66", "药物过敏史");
|
|
|
+ insertOneColumn(other_path, 12, "67", "家族相关传染病史");
|
|
|
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void insertOneColumn(String path, int columnIndex, String typeId, String typeName) throws Exception {
|
|
|
+ insertOneColumn(0, path, columnIndex, typeId, typeName);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void insertOneColumn(int sheetIndex, String path, int columnIndex, String typeId, String typeName) throws Exception {
|
|
|
+ Sheet sheet = loadSheet(path, sheetIndex);
|
|
|
int count = 0;
|
|
|
Map<String, String> concept_words = new HashMap<>();
|
|
|
Map<String, String> all_words = new HashMap<>();
|
|
|
-
|
|
|
- String[] self = null;
|
|
|
for (Row row : sheet) {
|
|
|
// 跳过第一和第二行的目录
|
|
|
if (count < 1) {
|
|
@@ -257,17 +135,10 @@ public class ConceptTest {
|
|
|
}
|
|
|
count++;
|
|
|
try {
|
|
|
- Cell cell0 = row.getCell(0);
|
|
|
- Cell cell1 = row.getCell(1);
|
|
|
- if (cell0 != null && !"".equals(cell0.getStringCellValue())) {
|
|
|
- put(concept_words, cell0);
|
|
|
- all_words.put(cell0.getStringCellValue(), cell0.getStringCellValue());
|
|
|
- }
|
|
|
- if (cell1 != null && StringUtils.isNotEmpty(cell1.getStringCellValue())) {
|
|
|
- self = cell1.getStringCellValue().split("、");
|
|
|
- for (int i = 0; i < self.length; i++) {
|
|
|
- all_words.put(self[i], cell0.getStringCellValue());
|
|
|
- }
|
|
|
+ Cell cell = row.getCell(columnIndex);
|
|
|
+ if (cell != null && StringUtils.isNotEmpty(cell.getStringCellValue())) {
|
|
|
+ all_words.put(cell.getStringCellValue().trim(), cell.getStringCellValue().trim());
|
|
|
+ concept_words.put(cell.getStringCellValue().trim(), cell.getStringCellValue().trim());
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
@@ -275,25 +146,15 @@ public class ConceptTest {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- List<Map<String, Object>> all_words_list = new ArrayList<>();
|
|
|
- for (Map.Entry<String, String> entry : all_words.entrySet()) {
|
|
|
- Map<String, Object> line = new HashMap<>();
|
|
|
- if (StringUtils.isNotEmpty(entry.getKey())) {
|
|
|
- line.put("name", entry.getKey());
|
|
|
- line.put("type_id", "12");
|
|
|
- line.put("type", "化验套餐");
|
|
|
- all_words_list.add(line);
|
|
|
- }
|
|
|
- }
|
|
|
+ convertAndSave(typeId, typeName, all_words, concept_words);
|
|
|
+ }
|
|
|
|
|
|
- insertLibraryInfo(all_words_list, all_words, concept_words);
|
|
|
+ public static void insertTwoColumn(String path, int columnIndex0, int columnIndex1, String typeId, String typeName) throws Exception {
|
|
|
+ insertTwoColumn(0, path, columnIndex0, columnIndex1, typeId, typeName);
|
|
|
}
|
|
|
|
|
|
- public static void insertLisDetail() throws Exception {
|
|
|
- File excelFile = new File(lis_path); // 创建文件对象
|
|
|
- FileInputStream in = new FileInputStream(excelFile); // 文件流
|
|
|
- Workbook workbook = getWorkbok(in, excelFile);
|
|
|
- Sheet sheet = workbook.getSheetAt(0);
|
|
|
+ public static void insertTwoColumn(int sheetIndex, String path, int columnIndex0, int columnIndex1, String typeId, String typeName) throws Exception {
|
|
|
+ Sheet sheet = loadSheet(path, sheetIndex);
|
|
|
|
|
|
int count = 0;
|
|
|
Map<String, String> concept_words = new HashMap<>();
|
|
@@ -308,16 +169,16 @@ public class ConceptTest {
|
|
|
}
|
|
|
count++;
|
|
|
try {
|
|
|
- Cell cell2 = row.getCell(2);
|
|
|
- Cell cell3 = row.getCell(3);
|
|
|
- if (cell2 != null && StringUtils.isNotEmpty(cell2.getStringCellValue())) {
|
|
|
- put(concept_words, cell2);
|
|
|
- all_words.put(cell2.getStringCellValue(), cell2.getStringCellValue());
|
|
|
+ Cell cell0 = row.getCell(columnIndex0);
|
|
|
+ Cell cell1 = row.getCell(columnIndex1);
|
|
|
+ if (cell0 != null && StringUtils.isNotEmpty(cell0.getStringCellValue())) {
|
|
|
+ concept_words.put(cell0.getStringCellValue().trim(), cell0.getStringCellValue().trim());
|
|
|
+ all_words.put(cell0.getStringCellValue().trim(), cell0.getStringCellValue().trim());
|
|
|
}
|
|
|
- if (cell3 != null && StringUtils.isNotEmpty(cell3.getStringCellValue())) {
|
|
|
- self = cell3.getStringCellValue().split("、");
|
|
|
+ if (cell1 != null && StringUtils.isNotEmpty(cell1.getStringCellValue()) && cell0 != null) {
|
|
|
+ self = cell1.getStringCellValue().split("、");
|
|
|
for (int i = 0; i < self.length; i++) {
|
|
|
- all_words.put(self[i], cell2.getStringCellValue());
|
|
|
+ all_words.put(self[i].trim(), cell0.getStringCellValue().trim());
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
@@ -326,61 +187,28 @@ public class ConceptTest {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- List<Map<String, Object>> all_words_list = new ArrayList<>();
|
|
|
- for (Map.Entry<String, String> entry : all_words.entrySet()) {
|
|
|
- Map<String, Object> line = new HashMap<>();
|
|
|
- if (StringUtils.isNotEmpty(entry.getKey())) {
|
|
|
- line.put("name", entry.getKey());
|
|
|
- line.put("type_id", "13");
|
|
|
- line.put("type", "化验明细");
|
|
|
- all_words_list.add(line);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- insertLibraryInfo(all_words_list, all_words, concept_words);
|
|
|
+ convertAndSave(typeId, typeName, all_words, concept_words);
|
|
|
}
|
|
|
|
|
|
- public static void insertLisPublic() throws Exception {
|
|
|
- File excelFile = new File(lis_path); // 创建文件对象
|
|
|
+ public static Sheet loadSheet(String path, int sheetIndex) throws Exception {
|
|
|
+ File excelFile = new File(path); // 创建文件对象
|
|
|
FileInputStream in = new FileInputStream(excelFile); // 文件流
|
|
|
Workbook workbook = getWorkbok(in, excelFile);
|
|
|
- Sheet sheet = workbook.getSheetAt(0);
|
|
|
-
|
|
|
- int count = 0;
|
|
|
- Map<String, String> concept_words = new HashMap<>();
|
|
|
- Map<String, String> all_words = new HashMap<>();
|
|
|
-
|
|
|
- String[] self = null;
|
|
|
- for (Row row : sheet) {
|
|
|
- // 跳过第一和第二行的目录
|
|
|
- if (count < 1) {
|
|
|
- count++;
|
|
|
- continue;
|
|
|
- }
|
|
|
- count++;
|
|
|
- try {
|
|
|
- Cell cell4 = row.getCell(4);
|
|
|
- if (cell4 != null && StringUtils.isNotEmpty(cell4.getStringCellValue())) {
|
|
|
- concept_words.put(cell4.getStringCellValue(), cell4.getStringCellValue());
|
|
|
- all_words.put(cell4.getStringCellValue(), cell4.getStringCellValue());
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- System.out.println("第" + count + "出现错误!");
|
|
|
- }
|
|
|
- }
|
|
|
+ Sheet sheet = workbook.getSheetAt(sheetIndex);
|
|
|
+ return sheet;
|
|
|
+ }
|
|
|
|
|
|
+ public static void convertAndSave(String typeId, String typeName, Map<String, String> all_words, Map<String, String> concept_words) {
|
|
|
List<Map<String, Object>> all_words_list = new ArrayList<>();
|
|
|
for (Map.Entry<String, String> entry : all_words.entrySet()) {
|
|
|
Map<String, Object> line = new HashMap<>();
|
|
|
if (StringUtils.isNotEmpty(entry.getKey())) {
|
|
|
line.put("name", entry.getKey());
|
|
|
- line.put("type_id", "46");
|
|
|
- line.put("type", "化验公表项");
|
|
|
+ line.put("type_id", typeId);
|
|
|
+ line.put("type", typeName);
|
|
|
all_words_list.add(line);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
insertLibraryInfo(all_words_list, all_words, concept_words);
|
|
|
}
|
|
|
|
|
@@ -453,58 +281,15 @@ public class ConceptTest {
|
|
|
}
|
|
|
|
|
|
public static void insertDisease() throws Exception {
|
|
|
- File excelFile = new File(disease_path); // 创建文件对象
|
|
|
- FileInputStream in = new FileInputStream(excelFile); // 文件流
|
|
|
- Workbook workbook = getWorkbok(in, excelFile);
|
|
|
- Sheet sheet = workbook.getSheetAt(0);
|
|
|
-
|
|
|
- int count = 0;
|
|
|
- Map<String, String> concept_words = new HashMap<>();
|
|
|
- Map<String, String> all_words = new HashMap<>();
|
|
|
-
|
|
|
- String[] self = null;
|
|
|
- for (Row row : sheet) {
|
|
|
- // 跳过第一和第二行的目录
|
|
|
- if (count < 1) {
|
|
|
- count++;
|
|
|
- continue;
|
|
|
- }
|
|
|
- count++;
|
|
|
- try {
|
|
|
- Cell cell0 = row.getCell(0);
|
|
|
- Cell cell1 = row.getCell(1);
|
|
|
- if (cell0 != null && StringUtils.isNotEmpty(cell0.getStringCellValue())) {
|
|
|
- concept_words.put(cell0.getStringCellValue(), cell0.getStringCellValue());
|
|
|
- all_words.put(cell0.getStringCellValue(), cell0.getStringCellValue());
|
|
|
- }
|
|
|
- if (cell1 != null && StringUtils.isNotEmpty(cell1.getStringCellValue()) && cell0 != null) {
|
|
|
- self = cell1.getStringCellValue().split("、");
|
|
|
- for (int i = 0; i < self.length; i++) {
|
|
|
- all_words.put(self[i], cell0.getStringCellValue());
|
|
|
- }
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- System.out.println("第" + count + "出现错误!");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- List<Map<String, Object>> all_words_list = new ArrayList<>();
|
|
|
- for (Map.Entry<String, String> entry : all_words.entrySet()) {
|
|
|
- Map<String, Object> line = new HashMap<>();
|
|
|
- if (StringUtils.isNotEmpty(entry.getKey())) {
|
|
|
- line.put("name", entry.getKey());
|
|
|
- line.put("type_id", "18");
|
|
|
- line.put("type", "疾病");
|
|
|
- all_words_list.add(line);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- insertLibraryInfo(all_words_list, all_words, concept_words);
|
|
|
+ insertTwoColumn(disease_path, 0, 1, "18", "疾病");
|
|
|
}
|
|
|
|
|
|
public static void insertDrug() throws Exception {
|
|
|
-
|
|
|
+ insertTwoColumn(drug_path, 0, 1, "53", "药品化学名");
|
|
|
+ insertTwoColumn(drug_path, 2, 3, "10", "药品通用名");
|
|
|
+ insertOneColumn(drug_path, 4, "54", "药品商品名");
|
|
|
+ insertOneColumn(drug_path, 5, "29", "药品大类");
|
|
|
+ insertOneColumn(drug_path, 6, "30", "药品小类");
|
|
|
}
|
|
|
|
|
|
public static void insertVitalIndex() throws Exception {
|
|
@@ -732,6 +517,7 @@ public class ConceptTest {
|
|
|
initInsertLine(line, updateDate);
|
|
|
}
|
|
|
MysqlJdbc nlpJdbc = new MysqlJdbc("root", "diagbot@20180822", "jdbc:mysql://192.168.2.235:3306/med-s?useUnicode=true&characterEncoding=UTF-8");
|
|
|
+// MysqlJdbc nlpJdbc = new MysqlJdbc("root", "diagbot@20180822", "jdbc:mysql://192.168.2.235:3306/diagbot-med-0606?useUnicode=true&characterEncoding=UTF-8");
|
|
|
int[] infoIds = nlpJdbc.insertBatch(list, "kl_library_info", new String[]{"name", "type_id", "is_concept", "creator", "modifier", "gmt_create", "gmt_modified", "is_deleted"});
|
|
|
|
|
|
List<Map<String, Object>> concept_words_list = new ArrayList<>();
|