|
@@ -22,7 +22,7 @@ import java.util.stream.Collectors;
|
|
|
public class DrugRule {
|
|
|
|
|
|
/**
|
|
|
- * 比较药品是否存在(图谱返回的是药品大类,需要从缓存中获取大类对应的药品名称)
|
|
|
+ * 比较药品是否存在(图谱返回的是药品通用名,直接比较)
|
|
|
*
|
|
|
* @param drugLises
|
|
|
* @param inputLises
|
|
@@ -31,6 +31,46 @@ public class DrugRule {
|
|
|
public static <T> void compareDrugWithBill(List<NodeNeoDTO> drugLises, List<T> inputLises, BillNeoMaxDTO billNeoMaxDTO,
|
|
|
List<BillMsg> billMsgList, Map<String, List<String>> drugMap, String type) {
|
|
|
Map<String, String> old_stand = new HashMap<>();
|
|
|
+ if (ListUtil.isNotEmpty(drugLises) && ListUtil.isNotEmpty(inputLises)) {
|
|
|
+ List<String> allDrug = drugLises.stream().map(x -> x.getName()).collect(Collectors.toList());
|
|
|
+ for (T d : inputLises) {
|
|
|
+ Negative val = (Negative) CoreUtil.getFieldValue(d, "negative");
|
|
|
+ if (val == null) {
|
|
|
+ String c = (String) CoreUtil.getFieldValue(d, "standName");
|
|
|
+ String c_name = (String) CoreUtil.getFieldValue(d, "name");
|
|
|
+ if (StringUtils.isNotBlank(c) && allDrug.contains(c)) {
|
|
|
+ old_stand.put(c_name, c);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (old_stand.size() > 0) {
|
|
|
+ for (Map.Entry<String, String> d : old_stand.entrySet()) {
|
|
|
+ String message = "";
|
|
|
+ if ("禁忌过敏药品".equals(type)) {
|
|
|
+ message = d.getKey() + "过敏";
|
|
|
+ } else {
|
|
|
+ message = "已开" + d.getKey();
|
|
|
+ }
|
|
|
+ BillMsg commonBillMsg = CoreUtil.getCommonBillMsg(
|
|
|
+ billNeoMaxDTO.getOrderName(), billNeoMaxDTO.getOrderStandName(),
|
|
|
+ message, type);
|
|
|
+ billMsgList.add(commonBillMsg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 比较药品是否存在(图谱返回的是药品大类,需要从缓存中获取大类对应的药品名称)
|
|
|
+ *
|
|
|
+ * @param drugLises
|
|
|
+ * @param inputLises
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static <T> void compareDrugWithBillWithType(List<NodeNeoDTO> drugLises, List<T> inputLises, BillNeoMaxDTO billNeoMaxDTO,
|
|
|
+ List<BillMsg> billMsgList, Map<String, List<String>> drugMap, String type) {
|
|
|
+ Map<String, String> old_stand = new HashMap<>();
|
|
|
if (ListUtil.isNotEmpty(drugLises) && ListUtil.isNotEmpty(inputLises)) {
|
|
|
List<String> drugType = drugLises.stream().map(x -> x.getName()).collect(Collectors.toList());
|
|
|
List<String> allDrug = new ArrayList<>(); // 所有的药品名称
|