|
@@ -1,13 +1,17 @@
|
|
|
package com.diagbot.facade;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.diagbot.client.AIServiceClient;
|
|
|
import com.diagbot.client.bean.CalculateData;
|
|
|
import com.diagbot.client.bean.GdbResponse;
|
|
|
import com.diagbot.client.bean.Response;
|
|
|
import com.diagbot.client.bean.ResponseData;
|
|
|
import com.diagbot.dto.LisResult;
|
|
|
+import com.diagbot.entity.ScaleContent;
|
|
|
+import com.diagbot.enums.ScaleTypeEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
|
+import com.diagbot.service.ScaleContentService;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
import com.diagbot.vo.SearchVo;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -30,6 +34,8 @@ public class ClinicalFacade {
|
|
|
|
|
|
@Autowired
|
|
|
private AIServiceClient aiServiceClient;
|
|
|
+ @Autowired
|
|
|
+ private ScaleContentService scaleContentService;
|
|
|
|
|
|
private static String up = "增高";
|
|
|
private static String down = "降低";
|
|
@@ -102,6 +108,34 @@ public class ClinicalFacade {
|
|
|
return response;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取量表内容
|
|
|
+ *
|
|
|
+ * @param searchVo
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<ScaleContent> getScale(SearchVo searchVo) {
|
|
|
+ Map<String, Object> response = aiServiceClient.scale(searchVo);
|
|
|
+ if (null == response) {
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "量表没有返回结果");
|
|
|
+ }
|
|
|
+ List<ScaleContent> list = getContent(searchVo.getScaleName(), JSON.toJSONString(response));
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public List<ScaleContent> getContent(String scaleName, String pushContent) {
|
|
|
+ List<ScaleContent> list = scaleContentService.getContentByName(scaleName);
|
|
|
+ for (ScaleContent scaleContent : list) {
|
|
|
+ if (ScaleTypeEnum.PUSH.getKey() == scaleContent.getType()) {
|
|
|
+ scaleContent.setContent(pushContent);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 高危诊断
|
|
|
*
|