|
@@ -62,7 +62,7 @@ public class AlgorithmController extends BaseController {
|
|
|
listView = "/pages/algorithm/list.html";
|
|
|
}
|
|
|
|
|
|
- @RequestMapping({"/index"})
|
|
|
+ @RequestMapping({ "/index" })
|
|
|
public String index() {
|
|
|
return listView;
|
|
|
}
|
|
@@ -85,7 +85,7 @@ public class AlgorithmController extends BaseController {
|
|
|
Response<ResponseData> response = new Response<>();
|
|
|
|
|
|
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("doc_info_validate", new String[]{"pk_dcpv", "present", "diag", "sex", "age"}, "");
|
|
|
+ List<Map<String, String>> data = nlpJdbc.query("doc_info_validate", new String[] { "pk_dcpv", "present", "diag", "sex", "age" }, "");
|
|
|
|
|
|
Map<String, String> diags = NlpCache.getStandard_info_synonym_map().get(Constants.word_property_diagnose);
|
|
|
|
|
@@ -184,7 +184,9 @@ public class AlgorithmController extends BaseController {
|
|
|
Map<String, List<CrisisDetail>> crisisDetails = responseData.getCrisisDetails();
|
|
|
List<MedicalIndication> crisisDetailsList = this.getCrisisDetails(crisisDetails);
|
|
|
List<MedicalIndication> medicalIndications = graphResponseData.getMedicalIndications();
|
|
|
- if (medicalIndications == null) medicalIndications = new ArrayList<>();
|
|
|
+ if (medicalIndications == null) {
|
|
|
+ medicalIndications = new ArrayList<>();
|
|
|
+ }
|
|
|
medicalIndications.addAll(crisisDetailsList);
|
|
|
if (medicalIndications != null && medicalIndications.size() > 0) {
|
|
|
logger.info("指标推送!!!!!!!!!");
|
|
@@ -205,11 +207,11 @@ public class AlgorithmController extends BaseController {
|
|
|
Map<String, String> vitalCache = CacheUtil.getVitalCache();
|
|
|
List<String> featureList = Arrays.asList(searchData.getFeatureTypes());
|
|
|
List<FeatureRate> vitals = graphResponseData.getVitals();
|
|
|
- if(featureList.contains(Constants.feature_type_vital_index) && this.getVital(vitalCache,vitals).size() > 0){
|
|
|
- bigDataResponseData.setVitals(this.getVital(vitalCache,vitals));
|
|
|
+ if (featureList.contains(Constants.feature_type_vital_index) && this.getVital(vitalCache, vitals).size() > 0) {
|
|
|
+ bigDataResponseData.setVitals(this.getVital(vitalCache, vitals));
|
|
|
|
|
|
}
|
|
|
- if(featureList.contains(Constants.feature_type_vital) && vitals.size() > 0){
|
|
|
+ if (featureList.contains(Constants.feature_type_vital) && vitals.size() > 0) {
|
|
|
bigDataResponseData.setVitals(vitals);
|
|
|
}
|
|
|
|
|
@@ -220,30 +222,31 @@ public class AlgorithmController extends BaseController {
|
|
|
List<FeatureRate> featureRates = classifyDiag.sortDiag(classify);
|
|
|
bigDataResponseData.setDis(featureRates);
|
|
|
//返回结果化验、辅检、体征、进行性别年龄过滤
|
|
|
- resultDataProxys.proxy(request ,bigDataResponseData,searchData);
|
|
|
+ resultDataProxys.proxy(request, bigDataResponseData, searchData);
|
|
|
response.setData(bigDataResponseData);
|
|
|
return response;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 包装输出的危急值
|
|
|
+ *
|
|
|
* @param crisisDetails
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<MedicalIndication> getCrisisDetails(Map<String, List<CrisisDetail>> crisisDetails){
|
|
|
+ public List<MedicalIndication> getCrisisDetails(Map<String, List<CrisisDetail>> crisisDetails) {
|
|
|
List<MedicalIndication> crisisDetailList = new ArrayList<>();
|
|
|
- for(Map.Entry<String, List<CrisisDetail>> entry : crisisDetails.entrySet()) {
|
|
|
- for (CrisisDetail crisisDetail:entry.getValue()) {
|
|
|
+ for (Map.Entry<String, List<CrisisDetail>> entry : crisisDetails.entrySet()) {
|
|
|
+ for (CrisisDetail crisisDetail : entry.getValue()) {
|
|
|
String originText = crisisDetail.getOriginText();//文本输入的数据
|
|
|
String remindText = crisisDetail.getRemindText();//危机警示指标
|
|
|
String standardText = crisisDetail.getStandardText();//评判标准
|
|
|
- if(StringUtils.isNotEmpty(remindText)){
|
|
|
+ if (StringUtils.isNotEmpty(remindText)) {
|
|
|
MedicalIndication medicalIndication = new MedicalIndication();
|
|
|
List<MedicalIndicationDetail> crisisMid = new ArrayList<>();
|
|
|
MedicalIndicationDetail medicalIndicationDetail = new MedicalIndicationDetail();
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
- jsonObject.put("controlType",2);
|
|
|
- jsonObject.put("name",standardText);
|
|
|
+ jsonObject.put("controlType", 2);
|
|
|
+ jsonObject.put("name", standardText);
|
|
|
medicalIndicationDetail.setType(4);
|
|
|
medicalIndicationDetail.setContent(jsonObject);
|
|
|
crisisMid.add(medicalIndicationDetail);
|
|
@@ -256,26 +259,27 @@ public class AlgorithmController extends BaseController {
|
|
|
return crisisDetailList;
|
|
|
}
|
|
|
|
|
|
- public List<FeatureRate> getVital(Map<String, String> vitalCache,List<FeatureRate> vitals){
|
|
|
+ public List<FeatureRate> getVital(Map<String, String> vitalCache, List<FeatureRate> vitals) {
|
|
|
Set<String> vitalSet = new LinkedHashSet<>();
|
|
|
List<FeatureRate> vitalList = new ArrayList<>();
|
|
|
- if(vitals != null){
|
|
|
- for (FeatureRate f:vitals) {
|
|
|
+ if (vitals != null) {
|
|
|
+ for (FeatureRate f : vitals) {
|
|
|
String s = vitalCache.get(f.getFeatureName());
|
|
|
- if(StringUtils.isNotEmpty(s)){
|
|
|
+ if (StringUtils.isNotEmpty(s)) {
|
|
|
vitalSet.add(s);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if(vitalSet != null){
|
|
|
- for (String vi:vitalSet) {
|
|
|
- FeatureRate featureRate= new FeatureRate();
|
|
|
+ if (vitalSet != null) {
|
|
|
+ for (String vi : vitalSet) {
|
|
|
+ FeatureRate featureRate = new FeatureRate();
|
|
|
featureRate.setFeatureName(vi);
|
|
|
vitalList.add(featureRate);
|
|
|
}
|
|
|
}
|
|
|
return vitalList;
|
|
|
}
|
|
|
+
|
|
|
public Response<ResponseData> algorithm(HttpServletRequest request, SearchData searchData) throws Exception {
|
|
|
Response<ResponseData> response = new Response();
|
|
|
|