|
@@ -1,5 +1,6 @@
|
|
package org.diagbot.push.controller;
|
|
package org.diagbot.push.controller;
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
import org.diagbot.common.javabean.MedicalIndication;
|
|
import org.diagbot.common.javabean.MedicalIndication;
|
|
import org.diagbot.common.javabean.MedicalIndicationDetail;
|
|
import org.diagbot.common.javabean.MedicalIndicationDetail;
|
|
import org.diagbot.common.work.ResponseData;
|
|
import org.diagbot.common.work.ResponseData;
|
|
@@ -10,6 +11,7 @@ import org.diagbot.graph.jdbc.Neo4jAPI;
|
|
import org.diagbot.graphWeb.work.GraphCalculate;
|
|
import org.diagbot.graphWeb.work.GraphCalculate;
|
|
import org.diagbot.graphWeb.work.HighRiskCalculate;
|
|
import org.diagbot.graphWeb.work.HighRiskCalculate;
|
|
import org.diagbot.graphWeb.work.LisPacsCalculate;
|
|
import org.diagbot.graphWeb.work.LisPacsCalculate;
|
|
|
|
+import org.diagbot.graphWeb.work.ScaleCalculate;
|
|
import org.diagbot.pub.api.Response;
|
|
import org.diagbot.pub.api.Response;
|
|
import org.diagbot.pub.web.BaseController;
|
|
import org.diagbot.pub.web.BaseController;
|
|
import org.neo4j.driver.v1.Driver;
|
|
import org.neo4j.driver.v1.Driver;
|
|
@@ -102,32 +104,25 @@ public class GraphController extends BaseController {
|
|
return scale;
|
|
return scale;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //测试用
|
|
@RequestMapping(value = "/scaleTest", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/scaleTest", method = RequestMethod.POST)
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public Map<String, Object> scaleTest(HttpServletRequest request, @RequestBody SearchData searchData) throws Exception {
|
|
public Map<String, Object> scaleTest(HttpServletRequest request, @RequestBody SearchData searchData) throws Exception {
|
|
- Driver driver = DriverManager.newDrive("192.168.2.233", "neo4j", "root");
|
|
|
|
|
|
+ Driver driver = DriverManager.newDrive();
|
|
Neo4jAPI neo4jAPI = new Neo4jAPI(driver);
|
|
Neo4jAPI neo4jAPI = new Neo4jAPI(driver);
|
|
-
|
|
|
|
- Map<String, Object> scale = neo4jAPI.getScaleCalc2( searchData.getScaleName());
|
|
|
|
|
|
+ Map<String, Object> scale = neo4jAPI.getScaleCalc2(searchData.getScaleName());
|
|
return scale;
|
|
return scale;
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/scaleCalc", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/scaleCalc", method = RequestMethod.POST)
|
|
@ResponseBody
|
|
@ResponseBody
|
|
- public Map<String, Object> scaleCalc(HttpServletRequest request, @RequestBody SearchData searchData) throws Exception {
|
|
|
|
|
|
+ public Map<String, Object> scaleCalc(HttpServletRequest request, @RequestBody JSONObject jsonObject) throws Exception {
|
|
Map<String, Object> maps = null;
|
|
Map<String, Object> maps = null;
|
|
- GraphCalculate graphCalculate = new GraphCalculate();
|
|
|
|
- ResponseData responseData = graphCalculate.calculate(request, searchData);
|
|
|
|
- List<MedicalIndication> medicalIndications = responseData.getMedicalIndications();
|
|
|
|
- for (MedicalIndication medicalIndication : medicalIndications) {
|
|
|
|
- List<MedicalIndicationDetail> details = medicalIndication.getDetails();
|
|
|
|
- for (MedicalIndicationDetail medicalIndicationDetail : details) {
|
|
|
|
- if (medicalIndicationDetail.getType() == 2) {
|
|
|
|
- if ("肾小球滤过率".equals(medicalIndicationDetail.getContent().get("name"))) {
|
|
|
|
- maps = graphCalculate.scaleCalcMethod(medicalIndicationDetail);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ ScaleCalculate scaleCalculate = new ScaleCalculate();
|
|
|
|
+ if (Integer.parseInt(jsonObject.get("type").toString()) == 1) {
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ maps = scaleCalculate.scaleCalcMethod(jsonObject);
|
|
}
|
|
}
|
|
return maps;
|
|
return maps;
|
|
}
|
|
}
|