|
@@ -26,7 +26,7 @@ public class RuleTest {
|
|
}
|
|
}
|
|
|
|
|
|
private void validatePub() throws Exception {
|
|
private void validatePub() throws Exception {
|
|
- 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", "lantone", "jdbc:mysql://192.168.2.236:3306/med?useUnicode=true&characterEncoding=UTF-8");
|
|
List<Map<String, String>> data = nlpJdbc.query("kl_rule_pub",
|
|
List<Map<String, String>> data = nlpJdbc.query("kl_rule_pub",
|
|
new String[]{"id", "pub_name", "min_operator", "min_value", "min_unit",
|
|
new String[]{"id", "pub_name", "min_operator", "min_value", "min_unit",
|
|
"max_operator", "max_value", "max_unit", "eq_operator", "eq_value", "eq_unit", "remind", "suffix_info"}, "");
|
|
"max_operator", "max_value", "max_unit", "eq_operator", "eq_value", "eq_unit", "remind", "suffix_info"}, "");
|
|
@@ -64,7 +64,7 @@ public class RuleTest {
|
|
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/med-s?useUnicode=true&characterEncoding=UTF-8");
|
|
List<Map<String, String>> data = nlpJdbc.query("kl_rule_pub",
|
|
List<Map<String, String>> data = nlpJdbc.query("kl_rule_pub",
|
|
new String[]{"id", "pub_name", "min_operator", "min_value", "min_unit",
|
|
new String[]{"id", "pub_name", "min_operator", "min_value", "min_unit",
|
|
- "max_operator", "max_value", "max_unit", "eq_operator", "eq_value", "eq_unit", "remind", "suffix_info"}, "");
|
|
|
|
|
|
+ "max_operator", "max_value", "max_unit", "eq_operator", "eq_value", "eq_unit", "remind", "suffix_info"}, " where pub_name like '%体征%'");
|
|
|
|
|
|
Map<String, Map<String, String>> rulesMap = new HashMap<>();
|
|
Map<String, Map<String, String>> rulesMap = new HashMap<>();
|
|
for (Map<String, String> map : data) {
|
|
for (Map<String, String> map : data) {
|
|
@@ -84,32 +84,36 @@ public class RuleTest {
|
|
double value = 0.0;
|
|
double value = 0.0;
|
|
if (!StringUtils.isEmpty(map.get("eq_operator")) && "=".equals(map.get("eq_operator"))) {
|
|
if (!StringUtils.isEmpty(map.get("eq_operator")) && "=".equals(map.get("eq_operator"))) {
|
|
if ("诊断--".equals(map.get("pub_name"))) {
|
|
if ("诊断--".equals(map.get("pub_name"))) {
|
|
- searchData.setDiag(map.get("eq_value"));
|
|
|
|
|
|
+ searchData.setDiagString(map.get("eq_value"));
|
|
}
|
|
}
|
|
if ("体征--".equals(map.get("pub_name"))) {
|
|
if ("体征--".equals(map.get("pub_name"))) {
|
|
searchData.setVital(map.get("eq_value"));
|
|
searchData.setVital(map.get("eq_value"));
|
|
}
|
|
}
|
|
if ("开单--".equals(map.get("pub_name"))) {
|
|
if ("开单--".equals(map.get("pub_name"))) {
|
|
- searchData.setLisOrder(map.get("eq_value"));
|
|
|
|
- searchData.setPacsOrder(map.get("eq_value"));
|
|
|
|
|
|
+ List<PreResult> results = new ArrayList<>();
|
|
|
|
+ PreResult preResult = new PreResult();
|
|
|
|
+ preResult.setValue(map.get("eq_value"));
|
|
|
|
+ results.add(preResult);
|
|
|
|
+ searchData.setLisOrder(results);
|
|
|
|
+ searchData.setPacsOrder(results);
|
|
}
|
|
}
|
|
if ("症状--".equals(map.get("pub_name"))) {
|
|
if ("症状--".equals(map.get("pub_name"))) {
|
|
- searchData.setSymptom(map.get("eq_value"));
|
|
|
|
|
|
+ searchData.setChief(map.get("eq_value"));
|
|
}
|
|
}
|
|
if ("药品--".equals(map.get("pub_name"))) {
|
|
if ("药品--".equals(map.get("pub_name"))) {
|
|
- searchData.setPasts(map.get("eq_value"));
|
|
|
|
|
|
+ searchData.setDrugString(map.get("eq_value"));
|
|
}
|
|
}
|
|
if ("既往--".equals(map.get("pub_name"))) {
|
|
if ("既往--".equals(map.get("pub_name"))) {
|
|
searchData.setPasts(map.get("eq_value"));
|
|
searchData.setPasts(map.get("eq_value"));
|
|
}
|
|
}
|
|
if ("过敏--".equals(map.get("pub_name"))) {
|
|
if ("过敏--".equals(map.get("pub_name"))) {
|
|
- searchData.setPasts(map.get("eq_value"));
|
|
|
|
|
|
+ searchData.setAllergy(map.get("eq_value"));
|
|
}
|
|
}
|
|
if (map.get("pub_name").indexOf("其他--") > -1) {
|
|
if (map.get("pub_name").indexOf("其他--") > -1) {
|
|
searchData.setOther(map.get("pub_name") + map.get("eq_value"));
|
|
searchData.setOther(map.get("pub_name") + map.get("eq_value"));
|
|
}
|
|
}
|
|
if (map.get("pub_name").indexOf("检查--") > -1) {
|
|
if (map.get("pub_name").indexOf("检查--") > -1) {
|
|
- searchData.setPacs(map.get("pub_name") + map.get("eq_value"));
|
|
|
|
|
|
+ searchData.setPacsString(map.get("pub_name") + map.get("eq_value"));
|
|
}
|
|
}
|
|
} else if (!StringUtils.isEmpty(map.get("min_operator")) && !StringUtils.isEmpty(map.get("max_operator"))) {
|
|
} else if (!StringUtils.isEmpty(map.get("min_operator")) && !StringUtils.isEmpty(map.get("max_operator"))) {
|
|
if (map.get("pub_name").indexOf("体征--") > -1) {
|
|
if (map.get("pub_name").indexOf("体征--") > -1) {
|
|
@@ -128,7 +132,7 @@ public class RuleTest {
|
|
preResult.setValue(String.valueOf(value));
|
|
preResult.setValue(String.valueOf(value));
|
|
preResult.setUnits(map.get("min_unit"));
|
|
preResult.setUnits(map.get("min_unit"));
|
|
list.add(preResult);
|
|
list.add(preResult);
|
|
- searchData.setLisArr(list);
|
|
|
|
|
|
+ searchData.setLis(list);
|
|
}
|
|
}
|
|
if (map.get("pub_name").indexOf("年龄--") > -1) {
|
|
if (map.get("pub_name").indexOf("年龄--") > -1) {
|
|
int v = Integer.valueOf(map.get("min_value")) + 1;
|
|
int v = Integer.valueOf(map.get("min_value")) + 1;
|
|
@@ -151,7 +155,7 @@ public class RuleTest {
|
|
preResult.setValue(String.valueOf(value));
|
|
preResult.setValue(String.valueOf(value));
|
|
preResult.setUnits(map.get("min_unit"));
|
|
preResult.setUnits(map.get("min_unit"));
|
|
list.add(preResult);
|
|
list.add(preResult);
|
|
- searchData.setLisArr(list);
|
|
|
|
|
|
+ searchData.setLis(list);
|
|
}
|
|
}
|
|
if (map.get("pub_name").indexOf("年龄--") > -1) {
|
|
if (map.get("pub_name").indexOf("年龄--") > -1) {
|
|
int v = Integer.valueOf(map.get("min_value")) - 1;
|
|
int v = Integer.valueOf(map.get("min_value")) - 1;
|
|
@@ -174,7 +178,7 @@ public class RuleTest {
|
|
preResult.setValue(String.valueOf(value));
|
|
preResult.setValue(String.valueOf(value));
|
|
preResult.setUnits(map.get("max_unit"));
|
|
preResult.setUnits(map.get("max_unit"));
|
|
list.add(preResult);
|
|
list.add(preResult);
|
|
- searchData.setLisArr(list);
|
|
|
|
|
|
+ searchData.setLis(list);
|
|
}
|
|
}
|
|
if (map.get("pub_name").indexOf("年龄--") > -1) {
|
|
if (map.get("pub_name").indexOf("年龄--") > -1) {
|
|
int v = Integer.valueOf(map.get("max_value")) + 1;
|
|
int v = Integer.valueOf(map.get("max_value")) + 1;
|