|
@@ -52,6 +52,7 @@ public class GraphCalculate {
|
|
|
Map<String, Map<String,String>> condition = neo4jAPI.getCondition((String[]) inputList.toArray(new String[inputList.size()]),webDiag );
|
|
|
List<FeatureRate> featureRates = new ArrayList<>();
|
|
|
for (Map.Entry<String, Map<String,String>> d : condition.entrySet()) {
|
|
|
+ if (!"低血糖反应".equals(d.getKey()) && !"胃肠道不良反应".equals(d.getKey())) {
|
|
|
FeatureRate featureRate = new FeatureRate();
|
|
|
featureRate.setFeatureName(d.getKey());
|
|
|
featureRate.setExtraProperty("");
|
|
@@ -60,6 +61,7 @@ public class GraphCalculate {
|
|
|
featureRate.setDesc(s);
|
|
|
featureRate.setRate("neo4j");
|
|
|
featureRates.add(featureRate);
|
|
|
+ }
|
|
|
}
|
|
|
Set<String> diseaseSet = condition.keySet();
|
|
|
logger.info("diseaseSet :" + diseaseSet);
|
|
@@ -77,6 +79,13 @@ public class GraphCalculate {
|
|
|
}
|
|
|
}
|
|
|
logger.info("页面导入的所有化验项为 :" +lisSet);
|
|
|
+ //鉴别诊断
|
|
|
+ /*if(webDiag != null && webDiag.trim() != ""){
|
|
|
+ String[] webDiagSplits = webDiag.split(",");
|
|
|
+ String mainDiag = webDiagSplits[0];
|
|
|
+ List<String> differentialDiagnose = neo4jAPI.getDifferentialDiagnose(mainDiag);
|
|
|
+ responseData.setDiffDiag(differentialDiagnose);
|
|
|
+ }*/
|
|
|
//走治疗
|
|
|
if (webDiag.trim() != null && webDiag.trim() != "" && featureTypeList.contains("8")) {
|
|
|
// 查找页面诊断里是否有不良反应
|
|
@@ -97,6 +106,9 @@ public class GraphCalculate {
|
|
|
Map<String, JSONObject> mangementEvaluation1 = mangementEvaluation.getMangementEvaluation();
|
|
|
responseData.setManagementEvaluation(mangementEvaluation1);
|
|
|
}
|
|
|
+// MangementEvaluation mangementEvaluation = this.getMangementEvaluation();
|
|
|
+// Map<String, JSONObject> mangementEvaluation1 = mangementEvaluation.getMangementEvaluation();
|
|
|
+// responseData.setManagementEvaluation(mangementEvaluation1);
|
|
|
}
|
|
|
int age = searchData.getAge();
|
|
|
String sex = searchData.getSex();
|
|
@@ -105,8 +117,15 @@ public class GraphCalculate {
|
|
|
//查找指标
|
|
|
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(indSet,age,sex);
|
|
|
+ if (medicalIndication != null) {
|
|
|
+ medicalIndicationList.add(medicalIndication);
|
|
|
+ }
|
|
|
+ responseData.setMedicalIndications(medicalIndicationList);*/
|
|
|
List<MedicalIndication> idn = neo4jAPI.getIdn(indSet, age, sex);
|
|
|
responseData.setMedicalIndications(idn);
|
|
|
+
|
|
|
}
|
|
|
//诊断推送
|
|
|
responseData.setDis(featureRates);
|
|
@@ -252,6 +271,186 @@ public class GraphCalculate {
|
|
|
return sortedMap;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 量表和指标
|
|
|
+ *
|
|
|
+ * @param idnSet
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public MedicalIndication getMedicalIndication(Set idnSet,Integer age,String sex) throws Exception {
|
|
|
+ MedicalIndication medicalIndication = new MedicalIndication();
|
|
|
+ if (idnSet.contains("肾功能不全")) {
|
|
|
+ logger.info("diseaseSet中包含肾功能不全");
|
|
|
+ //推送指标
|
|
|
+ medicalIndication.setName("肾功能不全");
|
|
|
+ List<MedicalIndicationDetail> medicalIndicationDetailList = new ArrayList<>();
|
|
|
+ //量表
|
|
|
+ MedicalIndicationDetail medicalIndicationDetail1 = new MedicalIndicationDetail();
|
|
|
+ medicalIndicationDetail1.setType(1);
|
|
|
+ JSONObject liangJson = new JSONObject();
|
|
|
+ liangJson.put("name", "密西根糖尿病周围神经病评分(MDNS)");
|
|
|
+ medicalIndicationDetail1.setContent(liangJson);
|
|
|
+ //公式
|
|
|
+ MedicalIndicationDetail medicalIndicationDetail2 = new MedicalIndicationDetail();
|
|
|
+ medicalIndicationDetail2.setType(2);
|
|
|
+ JSONObject gongshiJson = new JSONObject();
|
|
|
+ gongshiJson.put("name", "肾小球滤过率");
|
|
|
+ List<JSONObject> detailList = new ArrayList<>();
|
|
|
+ JSONObject ageJsonObject = new JSONObject();
|
|
|
+ ageJsonObject.put("controlType", 2);
|
|
|
+ ageJsonObject.put("name", "年龄");
|
|
|
+ ageJsonObject.put("value", age);
|
|
|
+ ageJsonObject.put("uint", "");
|
|
|
+ ageJsonObject.put("details", new ArrayList<>());
|
|
|
+ JSONObject indicationJsonObject = new JSONObject();
|
|
|
+ indicationJsonObject.put("controlType", 2);
|
|
|
+ indicationJsonObject.put("name", "血肌酐");
|
|
|
+ indicationJsonObject.put("value", "");
|
|
|
+ indicationJsonObject.put("uint", "mg/dL");
|
|
|
+ indicationJsonObject.put("details", new ArrayList<>());
|
|
|
+ JSONObject sexJson = new JSONObject();
|
|
|
+ sexJson.put("controlType", 1);
|
|
|
+ sexJson.put("name", "性别");
|
|
|
+ sexJson.put("value", "");
|
|
|
+ sexJson.put("uint", "");
|
|
|
+ List<JSONObject> sexList = new ArrayList<>();
|
|
|
+ JSONObject manJson = new JSONObject();
|
|
|
+ manJson.put("detailName", "男");
|
|
|
+ manJson.put("value", 1);
|
|
|
+ manJson.put("state", 0);
|
|
|
+ if("M".equals(sex)){
|
|
|
+ manJson.put("state", 1);
|
|
|
+ }
|
|
|
+ JSONObject womanJson = new JSONObject();
|
|
|
+ womanJson.put("detailName", "女");
|
|
|
+ womanJson.put("value", 1.018);
|
|
|
+ womanJson.put("state", 0);
|
|
|
+ if("F".equals(sex)){
|
|
|
+ womanJson.put("state", 1);
|
|
|
+ }
|
|
|
+ sexList.add(manJson);
|
|
|
+ sexList.add(womanJson);
|
|
|
+ sexJson.put("details", sexList);
|
|
|
+ detailList.add(ageJsonObject);
|
|
|
+ detailList.add(indicationJsonObject);
|
|
|
+ detailList.add(sexJson);
|
|
|
+ gongshiJson.put("details", detailList);
|
|
|
+ medicalIndicationDetail2.setContent(gongshiJson);
|
|
|
+ //其他
|
|
|
+ MedicalIndicationDetail medicalIndicationDetail3 = new MedicalIndicationDetail();
|
|
|
+ medicalIndicationDetail3.setType(3);
|
|
|
+ JSONObject shiFouJson = new JSONObject();
|
|
|
+ shiFouJson.put("name", "是否");
|
|
|
+ shiFouJson.put("controlType", 0);
|
|
|
+ List<JSONObject> shiFouList = new ArrayList<>();
|
|
|
+ JSONObject shiJsonObject = new JSONObject();
|
|
|
+ shiJsonObject.put("detailName", "是");
|
|
|
+ shiJsonObject.put("state", 1);
|
|
|
+ JSONObject fouJsonObject = new JSONObject();
|
|
|
+ fouJsonObject.put("detailName", "否");
|
|
|
+ fouJsonObject.put("state", 0);
|
|
|
+ shiFouList.add(shiJsonObject);
|
|
|
+ shiFouList.add(fouJsonObject);
|
|
|
+ shiFouJson.put("details", shiFouList);
|
|
|
+ medicalIndicationDetail3.setContent(shiFouJson);
|
|
|
+ medicalIndicationDetailList.add(medicalIndicationDetail1);
|
|
|
+ //Map<String, Object> maps = scaleCalcMethod(medicalIndicationDetail2);
|
|
|
+ JSONObject resultJson = new JSONObject();
|
|
|
+ JSONArray resultList = new JSONArray();
|
|
|
+ JSONObject result = new JSONObject();
|
|
|
+ result.put("text", "");
|
|
|
+ result.put("name", "GFR值");
|
|
|
+ resultList.add(result);
|
|
|
+ result = new JSONObject();
|
|
|
+ result.put("text", "");
|
|
|
+ result.put("name", "评估结论");
|
|
|
+ resultList.add(result);
|
|
|
+ gongshiJson.put("result", resultList);
|
|
|
+ medicalIndicationDetail2.setContent(gongshiJson);
|
|
|
+ medicalIndicationDetailList.add(medicalIndicationDetail2);
|
|
|
+ medicalIndicationDetailList.add(medicalIndicationDetail3);
|
|
|
+ medicalIndication.setDetails(medicalIndicationDetailList);
|
|
|
+ } else {
|
|
|
+ medicalIndication = null;
|
|
|
+ }
|
|
|
+ return medicalIndication;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 管理评估
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public MangementEvaluation getMangementEvaluation() {
|
|
|
+ MangementEvaluation mangementEvaluation = new MangementEvaluation();
|
|
|
+ Map<String, JSONObject> mangementMap = new HashMap<>();
|
|
|
+ JSONObject curativeJson = new JSONObject();
|
|
|
+ List<JSONObject> itemJson = new ArrayList<>();
|
|
|
+ JSONObject bloodPressure = new JSONObject();
|
|
|
+ bloodPressure.put("controltype", 0);
|
|
|
+ bloodPressure.put("name", "血压控制情况");
|
|
|
+ List<JSONObject> bloodPressureLevelList = new ArrayList<>();
|
|
|
+ String[] items = { "正常", "1级", "2级", "3级" };
|
|
|
+ for (String item : items) {
|
|
|
+ JSONObject iJson = new JSONObject();
|
|
|
+ iJson.put("detailName", item);
|
|
|
+ iJson.put("state", 0);
|
|
|
+ bloodPressureLevelList.add(iJson);
|
|
|
+ }
|
|
|
+ bloodPressure.put("details", bloodPressureLevelList);
|
|
|
+ itemJson.add(bloodPressure);
|
|
|
+
|
|
|
+ JSONObject bmiControl = new JSONObject();
|
|
|
+ bmiControl.put("controltype", 0);
|
|
|
+ bmiControl.put("name", "BMI控制情况");
|
|
|
+ List<JSONObject> bmiControlLevelList = new ArrayList<>();
|
|
|
+ String[] bmiControlitems = { "体重过低", "体重达标", "肥胖前期", "肥胖" };
|
|
|
+ for (String item : bmiControlitems) {
|
|
|
+ JSONObject iJson = new JSONObject();
|
|
|
+ iJson.put("detailName", item);
|
|
|
+ iJson.put("state", 0);
|
|
|
+ bmiControlLevelList.add(iJson);
|
|
|
+ }
|
|
|
+ bmiControl.put("details", bmiControlLevelList);
|
|
|
+ itemJson.add(bmiControl);
|
|
|
+
|
|
|
+ JSONObject bloodFatControl = new JSONObject();
|
|
|
+ bloodFatControl.put("controltype", 0);
|
|
|
+ bloodFatControl.put("name", "血脂控制情况");
|
|
|
+ List<JSONObject> bloodFatControlLevelList = new ArrayList<>();
|
|
|
+ String[] bloodFatControlitems = { "高血脂" };
|
|
|
+ for (String item : bloodFatControlitems) {
|
|
|
+ JSONObject iJson = new JSONObject();
|
|
|
+ iJson.put("detailName", item);
|
|
|
+ iJson.put("state", 0);
|
|
|
+ bloodFatControlLevelList.add(iJson);
|
|
|
+ }
|
|
|
+ bloodFatControl.put("details", bmiControlLevelList);
|
|
|
+ itemJson.add(bloodFatControl);
|
|
|
+ curativeJson.put("rows", itemJson);
|
|
|
+ //分级管理
|
|
|
+ JSONObject gradeJson = new JSONObject();
|
|
|
+ List<JSONObject> gradItemJson = new ArrayList<>();
|
|
|
+ JSONObject bigGrad = new JSONObject();
|
|
|
+ bigGrad.put("name", "血压控制情况");
|
|
|
+ bigGrad.put("controltype", 0);
|
|
|
+ List<JSONObject> gradItemJ = new ArrayList<>();
|
|
|
+ String[] gradItem = { "常规管理", "强化管理" };
|
|
|
+ for (String item : gradItem) {
|
|
|
+ JSONObject j = new JSONObject();
|
|
|
+ j.put("detailName", item);
|
|
|
+ j.put("state", 0);
|
|
|
+ gradItemJ.add(j);
|
|
|
+ }
|
|
|
+ bigGrad.put("details", gradItemJ);
|
|
|
+ gradItemJson.add(bigGrad);
|
|
|
+ gradeJson.put("rows", gradItemJson);
|
|
|
+ mangementMap.put("疗效评估", curativeJson);
|
|
|
+ mangementMap.put("糖尿病分级管理", gradeJson);
|
|
|
+ mangementEvaluation.setMangementEvaluation(mangementMap);
|
|
|
+ return mangementEvaluation;
|
|
|
+ }
|
|
|
+
|
|
|
public Map<String, Object> scaleCalcMethod(MedicalIndicationDetail medicalIndicationDetail) throws Exception {
|
|
|
Map<String, Object> scaleCalcResult = new HashMap<>();
|
|
|
Integer type = medicalIndicationDetail.getType();
|