|
@@ -1,14 +1,14 @@
|
|
|
package com.diagbot.util;
|
|
|
|
|
|
+import com.diagbot.biz.push.entity.Lis;
|
|
|
import com.diagbot.dto.BillMsg;
|
|
|
import com.diagbot.dto.NodeNeoDTO;
|
|
|
-import com.diagbot.model.entity.Clinical;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
|
|
import java.lang.reflect.Field;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
+import java.util.LinkedHashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
@@ -215,38 +215,25 @@ public class CoreUtil {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 开单合理性通用提示信息
|
|
|
- *
|
|
|
- * @param errMsg 提心信息
|
|
|
- * @param name 项目名称
|
|
|
- * @return
|
|
|
- */
|
|
|
- public static BillMsg getCommonBillMsg(String errMsg, String name,String standName) {
|
|
|
- BillMsg billMsg = new BillMsg();
|
|
|
- String msg = String.format(errMsg + ",不宜开%s", name);
|
|
|
- billMsg.setMsg(msg);
|
|
|
- billMsg.setCompareName(errMsg);
|
|
|
- billMsg.setCompareStandName(standName);
|
|
|
- return billMsg;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 开单合理性通用提示信息
|
|
|
+ * 危急值通用提示信息
|
|
|
*
|
|
|
* @param orderName 原开单项
|
|
|
* @param orderStandName 标准开单项
|
|
|
* @param compareName 匹配名称
|
|
|
* @param compareStandName 匹配标准名称
|
|
|
+ * @param type 类型
|
|
|
* @return
|
|
|
*/
|
|
|
- public static BillMsg getCommonBillMsg(String orderName, String orderStandName, String compareName, String compareStandName) {
|
|
|
+ public static BillMsg getCommonCriticalMsg(String orderName, String orderStandName, String compareName,
|
|
|
+ String compareStandName, String type) {
|
|
|
BillMsg billMsg = new BillMsg();
|
|
|
- String msg = String.format(compareName + ",不宜开%s", orderName);
|
|
|
+ String msg = String.format("该患者" + compareName + ",不宜开%s", orderName);
|
|
|
billMsg.setMsg(msg);
|
|
|
billMsg.setCompareName(compareName);
|
|
|
billMsg.setCompareStandName(compareStandName);
|
|
|
billMsg.setOrderName(orderName);
|
|
|
billMsg.setOrderStandName(orderStandName);
|
|
|
+ billMsg.setType(type);
|
|
|
return billMsg;
|
|
|
}
|
|
|
|
|
@@ -302,6 +289,55 @@ public class CoreUtil {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 比较化验是否匹配
|
|
|
+ *
|
|
|
+ * @param nodeNeoDTO
|
|
|
+ * @param lis
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static Map<String, Object> compareLis(NodeNeoDTO nodeNeoDTO, Lis lis) {
|
|
|
+ Map<String, Object> map = new LinkedHashMap<>();
|
|
|
+ boolean flag = false;
|
|
|
+ if (nodeNeoDTO == null || lis == null) {
|
|
|
+ map.put("flag", flag);
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+ if (StringUtil.isNotBlank(lis.getOtherValue())) {
|
|
|
+ if (lis.getOtherValue().equals(nodeNeoDTO.getVal())) {
|
|
|
+ map.put("msg", lis.getName() + lis.getDetailName() + lis.getOtherValue());
|
|
|
+ flag = true;
|
|
|
+ }
|
|
|
+ } else if (lis.getValue() != null) {
|
|
|
+ double value = lis.getValue();
|
|
|
+ BigDecimal min = nodeNeoDTO.getMin();
|
|
|
+ BigDecimal max = nodeNeoDTO.getMax();
|
|
|
+
|
|
|
+ if (min != null && max != null) {
|
|
|
+ int minAge = min.intValue();
|
|
|
+ int maxAge = max.intValue();
|
|
|
+ if (minAge <= value && value <= maxAge) {
|
|
|
+ flag = true;
|
|
|
+ }
|
|
|
+ } else if (min != null && max == null) {
|
|
|
+ int minAge = min.intValue();
|
|
|
+ if (minAge <= value) {
|
|
|
+ flag = true;
|
|
|
+ }
|
|
|
+ } else if (min == null && max != null) {
|
|
|
+ int maxAge = max.intValue();
|
|
|
+ if (value <= maxAge) {
|
|
|
+ flag = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (flag) {
|
|
|
+ map.put("msg", lis.getName() + lis.getDetailName() + lis.getValue());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ map.put("flag", flag);
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 比较字符串是否相等
|
|
|
*
|
|
@@ -485,24 +521,6 @@ public class CoreUtil {
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
|
- System.out.println(getCommonBillMsg("男性", "尿常规",""));
|
|
|
-
|
|
|
- List<Clinical> clinicals = new ArrayList<>();
|
|
|
- Clinical c1 = new Clinical();
|
|
|
- c1.setName("a");
|
|
|
- clinicals.add(c1);
|
|
|
- Clinical c2 = new Clinical();
|
|
|
- c2.setName("b");
|
|
|
- clinicals.add(c2);
|
|
|
- Clinical c3 = new Clinical();
|
|
|
- c3.setName("c");
|
|
|
- clinicals.add(c3);
|
|
|
-
|
|
|
- System.out.println(getPropertyList(clinicals));
|
|
|
- Map<String, String> map = new HashMap<>();
|
|
|
- map.put("a", "A");
|
|
|
- map.put("b", "B");
|
|
|
-
|
|
|
- setPropertyList(clinicals, map);
|
|
|
+
|
|
|
}
|
|
|
}
|