|
@@ -6,13 +6,11 @@ import com.diagbot.dto.BillNeoMaxDTO;
|
|
|
import com.diagbot.dto.NodeNeoDTO;
|
|
|
import com.diagbot.util.CoreUtil;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
+import com.diagbot.util.StringUtil;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
|
-import java.math.BigDecimal;
|
|
|
-import java.util.HashMap;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @description: 化验规则
|
|
@@ -20,42 +18,33 @@ import java.util.stream.Collectors;
|
|
|
* @time: 2020/8/3 14:47
|
|
|
*/
|
|
|
public class LisRule {
|
|
|
+
|
|
|
/**
|
|
|
- * 比较辅检
|
|
|
+ * 比较化验
|
|
|
*
|
|
|
- * @param drugLis
|
|
|
* @param inputLis
|
|
|
+ * @param billNeoMaxDTO
|
|
|
* @return
|
|
|
*/
|
|
|
- public static BillMsg compareLisWithBill(List<NodeNeoDTO> drugLis, List<Lis> inputLis, BillNeoMaxDTO billNeoMaxDTO) {
|
|
|
-
|
|
|
- Map<String,String> old_stand = new HashMap<>();
|
|
|
- if(ListUtil.isNotEmpty(drugLis) && ListUtil.isNotEmpty(inputLis)){
|
|
|
- Map<String, BigDecimal> nameMax = drugLis.stream().collect(Collectors.toMap(NodeNeoDTO::getName, NodeNeoDTO::getMax));
|
|
|
- Map<String, BigDecimal> nameMin = drugLis.stream().collect(Collectors.toMap(NodeNeoDTO::getName, NodeNeoDTO::getMin));
|
|
|
-
|
|
|
- for (Lis lis:inputLis) {
|
|
|
- String val =lis.getUniqueName();
|
|
|
- String val_name = lis.getDetailName();
|
|
|
-
|
|
|
- if(StringUtils.isNotBlank(val)){
|
|
|
- if(nameMax.containsKey(val) && lis.getValue() > nameMax.get(val).doubleValue()){
|
|
|
- old_stand.put(val_name,"大于"+lis.getValue().toString());
|
|
|
+ public static BillMsg compareLisWithBill(List<Lis> inputLis, BillNeoMaxDTO billNeoMaxDTO) {
|
|
|
+ List<String> msgList = new ArrayList<>();
|
|
|
+ List<NodeNeoDTO> neoList = billNeoMaxDTO.getLis();
|
|
|
+ if(ListUtil.isNotEmpty(neoList) && ListUtil.isNotEmpty(inputLis)){
|
|
|
+ for (NodeNeoDTO neo : neoList) {
|
|
|
+ for (Lis lis : inputLis) {
|
|
|
+ String val = lis.getUniqueName();
|
|
|
+ if (StringUtil.isNotBlank(val) && neo.getName().equals(val)) {
|
|
|
+ String val_name = lis.getDetailName();
|
|
|
+ boolean flag = CoreUtil.compareValue(neo, lis.getValue());
|
|
|
+ if (flag) {
|
|
|
+ msgList.add(CoreUtil.getValueMsg(neo, val_name, lis.getValue(), lis.getUnits()));
|
|
|
+ }
|
|
|
}
|
|
|
- if(nameMin.containsKey(val) && lis.getValue() < nameMin.get(val).doubleValue()){
|
|
|
- old_stand.put(val_name,"小于"+lis.getValue().toString());
|
|
|
- }
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if(old_stand.size() > 0){
|
|
|
- String message =null;
|
|
|
- for (Map.Entry<String,String> ds:old_stand.entrySet()) {
|
|
|
- message +=ds.getKey()+ds.getValue()+",";
|
|
|
- }
|
|
|
-// String message = StringUtils.join(old_stand.keySet(), ",");
|
|
|
-// String standNames = StringUtils.join(old_stand.values().stream().collect(Collectors.toList()),",");
|
|
|
+ if (ListUtil.isNotEmpty(msgList)){
|
|
|
+ String message = StringUtils.join(msgList, ",");
|
|
|
BillMsg commonBillMsg = CoreUtil.getCommonBillMsg(billNeoMaxDTO.getOrderName(),billNeoMaxDTO.getOrderStandName(),message,null);
|
|
|
return commonBillMsg;
|
|
|
}
|