|
@@ -40,6 +40,7 @@ import java.util.*;
|
|
|
@RequestMapping("/algorithm")
|
|
|
public class AlgorithmController extends BaseController {
|
|
|
Logger logger = LoggerFactory.getLogger(AlgorithmController.class);
|
|
|
+
|
|
|
{
|
|
|
listView = "/pages/algorithm/list.html";
|
|
|
}
|
|
@@ -88,7 +89,7 @@ public class AlgorithmController extends BaseController {
|
|
|
Map<String, Object> line = new HashMap<>();
|
|
|
Map<String, Object> where = new HashMap<>();
|
|
|
|
|
|
- String push_diag = "";
|
|
|
+ String push_diag = "";
|
|
|
for (int i = 0; i < featureRates.size(); i++) {
|
|
|
FeatureRate fr = featureRates.get(i);
|
|
|
if ((fr.getFeatureName().equals(map.get("diag")) || fr.getFeatureName().equals(diags.get(map.get("diag")))) && i < 3) {
|
|
@@ -147,7 +148,7 @@ public class AlgorithmController extends BaseController {
|
|
|
//推送出的诊断信息作为参数传入知识图谱
|
|
|
List<FeatureRate> pushDiags = new ArrayList<>();
|
|
|
for (FeatureRate fr : bigDataResponseData.getDis()) {
|
|
|
- pushDiags.add(fr);
|
|
|
+ pushDiags.add(fr);
|
|
|
logger.info("合并知识图谱、大数据后推送的诊断信息....: " + fr.getFeatureName());
|
|
|
}
|
|
|
searchData.setPushDiags(pushDiags);
|
|
@@ -155,22 +156,18 @@ public class AlgorithmController extends BaseController {
|
|
|
bigDataResponseData.setTreat(graphResponseData.getTreat());
|
|
|
//量表和指标推送
|
|
|
List<MedicalIndication> medicalIndications = graphResponseData.getMedicalIndications();
|
|
|
- if(medicalIndications !=null && medicalIndications.size()>0){
|
|
|
+ if (medicalIndications != null && medicalIndications.size() > 0) {
|
|
|
logger.info("指标推送!!!!!!!!!");
|
|
|
bigDataResponseData.setMedicalIndications(medicalIndications);
|
|
|
}
|
|
|
//推送管理评估
|
|
|
bigDataResponseData.setManagementEvaluation(graphResponseData.getManagementEvaluation());
|
|
|
//知识图谱直接替换大数据中的检验检查数据
|
|
|
- List<String> featrueList = Arrays.asList(searchData.getFeatureType().split(","));
|
|
|
- if(searchData.getDiag() !=null || searchData.getPushDiags() != null){
|
|
|
- graphResponseData = lisPacsCalculate.getLisPacs(request, searchData);
|
|
|
- if(featrueList.contains("5")){
|
|
|
- bigDataResponseData.setLabs(graphResponseData.getLabs());
|
|
|
- }else if(featrueList.contains("6")){
|
|
|
- bigDataResponseData.setPacs(graphResponseData.getPacs());
|
|
|
- }
|
|
|
- }
|
|
|
+// if(searchData.getDiag() !=null || searchData.getPushDiags() != null){
|
|
|
+ graphResponseData = lisPacsCalculate.getLisPacs(request, searchData);
|
|
|
+ bigDataResponseData.setLabs(graphResponseData.getLabs());
|
|
|
+ bigDataResponseData.setPacs(graphResponseData.getPacs());
|
|
|
+// }
|
|
|
response.setData(bigDataResponseData);
|
|
|
return response;
|
|
|
}
|
|
@@ -225,19 +222,19 @@ public class AlgorithmController extends BaseController {
|
|
|
private ResponseData map2ResponseData(LinkedHashMap linkedHashMap) {
|
|
|
ResponseData responseData = new ResponseData();
|
|
|
if (linkedHashMap.get("dis") != null) {
|
|
|
- responseData.setDis(map2FeatureRates((List<LinkedHashMap<String, String>>)linkedHashMap.get("dis")));
|
|
|
+ responseData.setDis(map2FeatureRates((List<LinkedHashMap<String, String>>) linkedHashMap.get("dis")));
|
|
|
}
|
|
|
if (linkedHashMap.get("symptom") != null) {
|
|
|
- responseData.setSymptom(map2FeatureRates((List<LinkedHashMap<String, String>>)linkedHashMap.get("symptom")));
|
|
|
+ responseData.setSymptom(map2FeatureRates((List<LinkedHashMap<String, String>>) linkedHashMap.get("symptom")));
|
|
|
}
|
|
|
if (linkedHashMap.get("vitals") != null) {
|
|
|
- responseData.setVitals(map2FeatureRates((List<LinkedHashMap<String, String>>)linkedHashMap.get("vitals")));
|
|
|
+ responseData.setVitals(map2FeatureRates((List<LinkedHashMap<String, String>>) linkedHashMap.get("vitals")));
|
|
|
}
|
|
|
if (linkedHashMap.get("labs") != null) {
|
|
|
- responseData.setLabs(map2FeatureRates((List<LinkedHashMap<String, String>>)linkedHashMap.get("labs")));
|
|
|
+ responseData.setLabs(map2FeatureRates((List<LinkedHashMap<String, String>>) linkedHashMap.get("labs")));
|
|
|
}
|
|
|
if (linkedHashMap.get("pacs") != null) {
|
|
|
- responseData.setPacs(map2FeatureRates((List<LinkedHashMap<String, String>>)linkedHashMap.get("pacs")));
|
|
|
+ responseData.setPacs(map2FeatureRates((List<LinkedHashMap<String, String>>) linkedHashMap.get("pacs")));
|
|
|
}
|
|
|
return responseData;
|
|
|
}
|
|
@@ -256,21 +253,21 @@ public class AlgorithmController extends BaseController {
|
|
|
|
|
|
private ResponseData addInputs(ResponseData bigDataResponseData, LinkedHashMap linkedHashMap) {
|
|
|
if (linkedHashMap.get("inputs") != null) {
|
|
|
- bigDataResponseData.setInputs((Map<String, Map<String, String>>)linkedHashMap.get("inputs"));
|
|
|
+ bigDataResponseData.setInputs((Map<String, Map<String, String>>) linkedHashMap.get("inputs"));
|
|
|
}
|
|
|
return bigDataResponseData;
|
|
|
}
|
|
|
|
|
|
private ResponseData addTreat(ResponseData graphResponseData, LinkedHashMap linkedHashMap) {
|
|
|
- Map<String,Filnlly> treatResult = new HashMap<String,Filnlly>();
|
|
|
- if(linkedHashMap.get("treat")!=null){
|
|
|
- LinkedHashMap<String, LinkedHashMap<String,ArrayList<LinkedHashMap>>> data= (LinkedHashMap<String, LinkedHashMap<String,ArrayList<LinkedHashMap>>>)linkedHashMap.get("treat");
|
|
|
- for (Map.Entry<String, LinkedHashMap<String,ArrayList<LinkedHashMap>>> fd:data.entrySet()) {
|
|
|
+ Map<String, Filnlly> treatResult = new HashMap<String, Filnlly>();
|
|
|
+ if (linkedHashMap.get("treat") != null) {
|
|
|
+ LinkedHashMap<String, LinkedHashMap<String, ArrayList<LinkedHashMap>>> data = (LinkedHashMap<String, LinkedHashMap<String, ArrayList<LinkedHashMap>>>) linkedHashMap.get("treat");
|
|
|
+ for (Map.Entry<String, LinkedHashMap<String, ArrayList<LinkedHashMap>>> fd : data.entrySet()) {
|
|
|
String diseaseName = fd.getKey();
|
|
|
LinkedHashMap<String, ArrayList<LinkedHashMap>> value = fd.getValue();
|
|
|
ArrayList<LinkedHashMap> treament = value.get("treatment");
|
|
|
ArrayList<Drugs> drugsList = new ArrayList<Drugs>();
|
|
|
- for (LinkedHashMap sd: treament) {
|
|
|
+ for (LinkedHashMap sd : treament) {
|
|
|
//创建药类对象,对药类对象进行封装
|
|
|
Drugs drugs = new Drugs();
|
|
|
|
|
@@ -278,15 +275,15 @@ public class AlgorithmController extends BaseController {
|
|
|
String subdrugsName = String.valueOf(sd.get("subdrugsName"));
|
|
|
int drugsForbidden = Integer.parseInt(sd.get("drugsForbidden").toString());
|
|
|
ArrayList<LinkedHashMap<String, Object>> medicitionsList = (ArrayList<LinkedHashMap<String, Object>>) sd.get("medicitionsList");
|
|
|
- LinkedList<Medicition> medicitionObjectList=new LinkedList<>();
|
|
|
- for (LinkedHashMap<String, Object> ds: medicitionsList) {
|
|
|
+ LinkedList<Medicition> medicitionObjectList = new LinkedList<>();
|
|
|
+ for (LinkedHashMap<String, Object> ds : medicitionsList) {
|
|
|
//创建药对象,进行封装
|
|
|
Medicition medicitionObject = new Medicition();
|
|
|
|
|
|
String medicitionName = String.valueOf(ds.get("medicitionName"));
|
|
|
String rate = String.valueOf(ds.get("rate"));
|
|
|
Integer isShow = Integer.parseInt(ds.get("isShow").toString());
|
|
|
- Integer forbidden =Integer.parseInt(ds.get("forbidden").toString());
|
|
|
+ Integer forbidden = Integer.parseInt(ds.get("forbidden").toString());
|
|
|
medicitionObject.setMedicitionName(medicitionName);//设置药名
|
|
|
medicitionObject.setRate(rate);//设置药的使用率
|
|
|
medicitionObject.setIsShow(isShow);//设置这个药是否展示
|
|
@@ -301,7 +298,7 @@ public class AlgorithmController extends BaseController {
|
|
|
}
|
|
|
Filnlly filnlly = new Filnlly();
|
|
|
filnlly.setTreatment(drugsList);
|
|
|
- treatResult.put(diseaseName,filnlly);
|
|
|
+ treatResult.put(diseaseName, filnlly);
|
|
|
}
|
|
|
}
|
|
|
graphResponseData.setTreat(treatResult);
|