|
@@ -1,14 +1,11 @@
|
|
|
package com.diagbot.facade;
|
|
|
|
|
|
-import com.diagbot.client.AIServiceClient;
|
|
|
-import com.diagbot.client.bean.Response;
|
|
|
-import com.diagbot.client.bean.ResponseData;
|
|
|
import com.diagbot.dto.LisResult;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import com.diagbot.vo.SearchVo;
|
|
|
|
|
|
+import javax.print.attribute.standard.MediaSize;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -22,43 +19,52 @@ import java.util.List;
|
|
|
@Component
|
|
|
public class ClinicalFacade {
|
|
|
|
|
|
- @Autowired
|
|
|
- private AIServiceClient aiServiceClient;
|
|
|
+ private static String up = "增高";
|
|
|
+ private static String down = "降低";
|
|
|
+ private static String normal = "正常";
|
|
|
+
|
|
|
+ private static String pos = "阳性";
|
|
|
+ private static String neg = "阴性";
|
|
|
|
|
|
/**
|
|
|
* 处理临床数据
|
|
|
*
|
|
|
* @param searchVo
|
|
|
- * @return ResponseData
|
|
|
+ * @return SearchVo
|
|
|
*/
|
|
|
- public ResponseData processClinicalData(@RequestBody SearchVo searchVo) {
|
|
|
- processLis(searchVo);
|
|
|
- Response<ResponseData> res = aiServiceClient.bayesPageData(searchVo);
|
|
|
+ public SearchVo processClinicalData(@RequestBody SearchVo searchVo) {
|
|
|
+ SearchVo sData = searchVo;
|
|
|
+
|
|
|
+ sData.setLisArr(processLis(sData.getLisArr()));
|
|
|
|
|
|
- return res.getData();
|
|
|
+ return sData;
|
|
|
}
|
|
|
|
|
|
- private void processLis(SearchVo sData) {
|
|
|
+ private List<LisResult> processLis(List<LisResult> lisArr) {
|
|
|
|
|
|
String Otherval = "";
|
|
|
- String lisresult = "";
|
|
|
- List<LisResult> lisArr = sData.getLisArr();
|
|
|
|
|
|
for (int i=0; i<lisArr.size(); i++) {
|
|
|
LisResult lisres = lisArr.get(i);
|
|
|
|
|
|
- Otherval = (lisres.getOtherValue().trim().length() > 0)? lisres.getOtherValue().trim()+"\n":"";
|
|
|
-
|
|
|
- if (lisres.getMaxValue() != null && lisres.getValue() > lisres.getMaxValue()) {
|
|
|
- lisres.setOtherValue(Otherval + "\n" + lisres.getDetailName() + "升高");
|
|
|
+ Otherval = lisres.getOtherValue();
|
|
|
|
|
|
+ if (Otherval.indexOf(pos) >= 0 || Otherval.indexOf(neg) >= 0) {
|
|
|
+ lisres.setOtherValue(lisres.getDetailName() + Otherval);
|
|
|
}
|
|
|
- else if (lisres.getMinValue() != null && lisres.getValue() < lisres.getMinValue()) {
|
|
|
- lisres.setOtherValue(Otherval + "\n" + lisres.getDetailName() + "下降");
|
|
|
+ else {
|
|
|
+ Otherval = (Otherval.trim().length() > 0) ? Otherval.trim() + "\n" : "";
|
|
|
+
|
|
|
+ if (lisres.getMaxValue() != null && lisres.getValue() > lisres.getMaxValue()) {
|
|
|
+ lisres.setOtherValue(Otherval + lisres.getDetailName() + up);
|
|
|
+ } else if (lisres.getMinValue() != null && lisres.getValue() < lisres.getMinValue()) {
|
|
|
+ lisres.setOtherValue(Otherval + lisres.getDetailName() + down);
|
|
|
+ } else {
|
|
|
+ lisres.setOtherValue(Otherval + lisres.getDetailName() + normal);
|
|
|
+ }
|
|
|
}
|
|
|
- lisresult += lisres.getOtherValue() + "\n";
|
|
|
}
|
|
|
|
|
|
- sData.setLis(lisresult);
|
|
|
+ return lisArr;
|
|
|
}
|
|
|
}
|