|
@@ -1,5 +1,7 @@
|
|
|
package com.diagbot.facade;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.diagbot.client.TreatServiceClient;
|
|
|
import com.diagbot.client.bean.Medicition;
|
|
@@ -46,7 +48,7 @@ public class TreatmentFacade {
|
|
|
* @param
|
|
|
* @return
|
|
|
*/
|
|
|
- public Map<String, Object> getTreatment(Map<String, String> treatmentMap, Long diseaseId) {
|
|
|
+ public Map<String, Object> getTreatment(Map<String, JSONObject> treatmentMap, Long diseaseId) {
|
|
|
Map<String, Object> retMap = new LinkedHashMap<>();
|
|
|
QuestionInfo disease = questionFacade.getById(diseaseId);
|
|
|
if (disease == null) {
|
|
@@ -68,12 +70,17 @@ public class TreatmentFacade {
|
|
|
retMap.put("surgeryTreatment", surgeryTreatmentDetailList.size() > 0 ? surgeryTreatmentDetailList.get(0).getContent() : "");
|
|
|
|
|
|
//获取知识图谱治疗方案
|
|
|
- String treatment = treatmentMap.get(disease.getTagName());
|
|
|
- if (StringUtil.isBlank(treatment)) {
|
|
|
+ JSONObject diseaseJson = treatmentMap.get(disease.getTagName());
|
|
|
+ if (diseaseJson == null || diseaseJson.isEmpty()) {
|
|
|
return retMap;
|
|
|
}
|
|
|
|
|
|
- List<MedicitionClass> drugsList = FastJsonUtils.getJsonToListByKey(treatment, "treatment", MedicitionClass.class);
|
|
|
+ JSONObject treatmentJson = diseaseJson.getJSONObject(disease.getTagName());
|
|
|
+ if (treatmentJson == null || treatmentJson.isEmpty()) {
|
|
|
+ return retMap;
|
|
|
+ }
|
|
|
+
|
|
|
+ List<MedicitionClass> drugsList = FastJsonUtils.getJsonToListByKey(treatmentJson.toString(), "treatment", MedicitionClass.class);
|
|
|
|
|
|
List<String> classNameList = drugsList.stream().map(drugs -> drugs.getDrugsName()).collect(Collectors.toList());
|
|
|
List<QuestionInfo> drugClassList = getTopQuestionList(classNameList, QuestionTypeEnum.DrugClass.getKey());
|