|
@@ -39,6 +39,9 @@ public class GraphCalculate {
|
|
|
Map<String, Map<String, String>> inputs = searchData.getInputs();
|
|
|
Set<String> ss = inputs.keySet();
|
|
|
logger.info("从分词系统接收到的词 :" + ss);
|
|
|
+ String[] featureTypes = searchData.getFeatureType().split(",");
|
|
|
+ List<String> featureTypeList = Arrays.asList(featureTypes);
|
|
|
+ logger.info("featureTypeList : " + featureTypeList);
|
|
|
inputList.addAll(ss);
|
|
|
// Driver driver = DriverManager.newDrive("192.168.2.232", "neo4j", "root");
|
|
|
Neo4jAPI neo4jAPI = new Neo4jAPI(DriverManager.newDrive());
|
|
@@ -47,8 +50,7 @@ public class GraphCalculate {
|
|
|
Map<String, String> condition = neo4jAPI.getCondition((String[]) inputList.toArray(new String[inputList.size()]));
|
|
|
List<FeatureRate> featureRates = new ArrayList<>();
|
|
|
for (Map.Entry<String, String> d : condition.entrySet()) {
|
|
|
- if (!"低血糖反应".equals(d.getKey()) && !"胃肠道不良反应".equals(d.getKey())
|
|
|
- && !"肾功能不全".equals(d.getKey())) {
|
|
|
+ if (!"低血糖反应".equals(d.getKey()) && !"胃肠道不良反应".equals(d.getKey())) {
|
|
|
FeatureRate featureRate = new FeatureRate();
|
|
|
featureRate.setFeatureName(d.getKey());
|
|
|
featureRate.setExtraProperty("");
|
|
@@ -59,9 +61,6 @@ public class GraphCalculate {
|
|
|
}
|
|
|
String webDiag = searchData.getDiag();
|
|
|
Set<String> diseaseSet = condition.keySet();
|
|
|
- String[] featureTypes = searchData.getFeatureType().split(",");
|
|
|
- List<String> featureTypeList = Arrays.asList(featureTypes);
|
|
|
- logger.info("featureTypeList : " + featureTypeList);
|
|
|
logger.info("diseaseSet :" + diseaseSet);
|
|
|
Integer diseaseType = searchData.getDisType();
|
|
|
//走治疗
|
|
@@ -77,11 +76,15 @@ public class GraphCalculate {
|
|
|
Map<String, JSONObject> mangementEvaluation1 = mangementEvaluation.getMangementEvaluation();
|
|
|
responseData.setManagementEvaluation(mangementEvaluation1);
|
|
|
}
|
|
|
+ int age = searchData.getAge();
|
|
|
+ String sex = searchData.getSex();
|
|
|
//指标推送
|
|
|
- if (featureTypeList.contains("22") && diseaseSet != null && diseaseSet.size() > 0) {
|
|
|
- logger.info("featureTypeList 包含22,走指标推送!!!,图谱推出的诊断为:" + diseaseSet);
|
|
|
+ if (featureTypeList.contains("22") ) {
|
|
|
+ //查找指标
|
|
|
+ Set<String> indSet = neo4jAPI.getInd((String[]) inputList.toArray(new String[inputList.size()]));
|
|
|
+ logger.info("featureTypeList 包含22,走指标推送!!!,图谱推出的指标为:" + indSet);
|
|
|
List<MedicalIndication> medicalIndicationList = new ArrayList<>();
|
|
|
- MedicalIndication medicalIndication = this.getMedicalIndication(diseaseSet);
|
|
|
+ MedicalIndication medicalIndication = this.getMedicalIndication(indSet,age,sex);
|
|
|
if (medicalIndication != null) {
|
|
|
medicalIndicationList.add(medicalIndication);
|
|
|
}
|
|
@@ -234,12 +237,12 @@ public class GraphCalculate {
|
|
|
/**
|
|
|
* 量表和指标
|
|
|
*
|
|
|
- * @param diseaseSet
|
|
|
+ * @param idnSet
|
|
|
* @return
|
|
|
*/
|
|
|
- public MedicalIndication getMedicalIndication(Set diseaseSet) throws Exception {
|
|
|
+ public MedicalIndication getMedicalIndication(Set idnSet,Integer age,String sex) throws Exception {
|
|
|
MedicalIndication medicalIndication = new MedicalIndication();
|
|
|
- if (diseaseSet.contains("肾功能不全")) {
|
|
|
+ if (idnSet.contains("肾功能不全")) {
|
|
|
logger.info("diseaseSet中包含肾功能不全");
|
|
|
//推送指标
|
|
|
medicalIndication.setName("肾功能不全");
|
|
@@ -259,7 +262,7 @@ public class GraphCalculate {
|
|
|
JSONObject ageJsonObject = new JSONObject();
|
|
|
ageJsonObject.put("controlType", 2);
|
|
|
ageJsonObject.put("name", "年龄");
|
|
|
- ageJsonObject.put("value", "");
|
|
|
+ ageJsonObject.put("value", age);
|
|
|
ageJsonObject.put("uint", "");
|
|
|
ageJsonObject.put("details", new ArrayList<>());
|
|
|
JSONObject indicationJsonObject = new JSONObject();
|
|
@@ -278,10 +281,16 @@ public class GraphCalculate {
|
|
|
manJson.put("detailName", "男");
|
|
|
manJson.put("value", 1);
|
|
|
manJson.put("state", 0);
|
|
|
+ if(manJson.get("detailName").equals(sex)){
|
|
|
+ manJson.put("state", 1);
|
|
|
+ }
|
|
|
JSONObject womanJson = new JSONObject();
|
|
|
womanJson.put("detailName", "女");
|
|
|
womanJson.put("value", 1.018);
|
|
|
- womanJson.put("state", 1);
|
|
|
+ womanJson.put("state", 0);
|
|
|
+ if(womanJson.get("detailName").equals(sex)){
|
|
|
+ womanJson.put("state", 1);
|
|
|
+ }
|
|
|
sexList.add(manJson);
|
|
|
sexList.add(womanJson);
|
|
|
sexJson.put("details", sexList);
|