Browse Source

医学规则测试

zhaops 4 years atrás
parent
commit
690a53d340

+ 42 - 0
cdssman-service/src/main/java/com/diagbot/entity/ResultOtherTransfusion.java

@@ -9,6 +9,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import java.io.Serializable;
 import java.math.BigDecimal;
 import java.util.Date;
+import java.util.Objects;
 
 /**
  * <p>
@@ -420,4 +421,45 @@ public class ResultOtherTransfusion implements Serializable {
                 ", inputParams=" + inputParams +
                 "}";
     }
+
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o)
+            return true;
+        if (o == null || getClass() != o.getClass())
+            return false;
+        ResultOtherTransfusion resultOtherTransfusion = (ResultOtherTransfusion) o;
+        return Objects.equals(id, resultOtherTransfusion.id)
+                && Objects.equals(isDeleted, resultOtherTransfusion.isDeleted)
+                && Objects.equals(resultId, resultOtherTransfusion.resultId)
+                && Objects.equals(otherItemName, resultOtherTransfusion.otherItemName)
+                && Objects.equals(otherItemHisName, resultOtherTransfusion.otherItemHisName)
+                && Objects.equals(otherItemHisDetailName, resultOtherTransfusion.otherItemHisDetailName)
+                && Objects.equals(otherItemRange, resultOtherTransfusion.otherItemRange)
+                && Objects.equals(otherItemMaxValue, resultOtherTransfusion.otherItemMaxValue)
+                && Objects.equals(otherItemMinValue, resultOtherTransfusion.otherItemMinValue)
+                && Objects.equals(otherItemUnit, resultOtherTransfusion.otherItemUnit)
+                && Objects.equals(otherItemInputValue, resultOtherTransfusion.otherItemInputValue)
+                && Objects.equals(transfusionType, resultOtherTransfusion.transfusionType)
+                && Objects.equals(transfusionTypeHisName, resultOtherTransfusion.transfusionTypeHisName)
+                && Objects.equals(conflictItemType, resultOtherTransfusion.conflictItemType)
+                && Objects.equals(conflictItemName, resultOtherTransfusion.conflictItemName)
+                && Objects.equals(conflictItemHisName, resultOtherTransfusion.conflictItemHisName)
+                && Objects.equals(conflictItemHisDetailName, resultOtherTransfusion.conflictItemHisDetailName)
+                && Objects.equals(referenceValue, resultOtherTransfusion.referenceValue)
+                && Objects.equals(output, resultOtherTransfusion.output)
+                && Objects.equals(expectedOutput, resultOtherTransfusion.expectedOutput)
+                && Objects.equals(success, resultOtherTransfusion.success)
+                && Objects.equals(message, resultOtherTransfusion.message)
+                && Objects.equals(inputParams, resultOtherTransfusion.inputParams);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(id, isDeleted, resultId, otherItemName, otherItemHisName, otherItemHisDetailName,
+                otherItemRange, otherItemMaxValue, otherItemMinValue, otherItemUnit, otherItemInputValue,
+                transfusionType, transfusionTypeHisName, conflictItemType, conflictItemName, conflictItemHisName,
+                conflictItemHisDetailName, referenceValue, output, expectedOutput, success, message, inputParams);
+    }
 }

+ 4 - 1
cdssman-service/src/main/java/com/diagbot/facade/RuleConvertFacade.java

@@ -1360,7 +1360,10 @@ public class RuleConvertFacade {
             }
         }
 
-        for (ResultOtherTransfusion result : retOtherList) {
+
+        List<ResultOtherTransfusion> distinctList = retOtherList.stream().distinct().collect(Collectors.toList());
+
+        for (ResultOtherTransfusion result : distinctList) {
             Map<String, Map<String, List<Long>>> subMap = lisConfigMap.get(result.getOtherItemName());
             if (subMap != null && subMap.size() > 0) {
                 subMap.entrySet().forEach(subEntry -> {

+ 12 - 10
cdssman-service/src/main/java/com/diagbot/facade/SearchDataFacade.java

@@ -437,16 +437,18 @@ public class SearchDataFacade {
         }
         indicationPushVO.getLis().add(lis);
 
-        if (result.getConflictItemType().equals(GraphLabelEnum.YiBaoOperationName.getName())) {
-            Item item = new Item();
-            item.setName(result.getConflictItemHisName());
-            item.setUniqueName(result.getConflictItemName());
-            indicationPushVO.getOperation().add(item);
-        } else if (result.getConflictItemType().equals(GraphLabelEnum.YiBaoDiseaseName.getName())) {
-            Item item = new Item();
-            item.setName(result.getConflictItemHisName());
-            item.setUniqueName(result.getConflictItemName());
-            indicationPushVO.getDiag().add(item);
+        if (StringUtil.isNotBlank(result.getConflictItemType())) {
+            if (result.getConflictItemType().equals(GraphLabelEnum.YiBaoOperationName.getName())) {
+                Item item = new Item();
+                item.setName(result.getConflictItemHisName());
+                item.setUniqueName(result.getConflictItemName());
+                indicationPushVO.getOperation().add(item);
+            } else if (result.getConflictItemType().equals(GraphLabelEnum.YiBaoDiseaseName.getName())) {
+                Item item = new Item();
+                item.setName(result.getConflictItemHisName());
+                item.setUniqueName(result.getConflictItemName());
+                indicationPushVO.getDiag().add(item);
+            }
         }
         return indicationPushVO;
     }