|
@@ -0,0 +1,43 @@
|
|
|
+package com.diagbot.rule;
|
|
|
+
|
|
|
+import com.diagbot.dto.BillMsg;
|
|
|
+import com.diagbot.dto.WordCrfDTO;
|
|
|
+import com.diagbot.model.entity.Diag;
|
|
|
+import com.diagbot.model.label.DiagLabel;
|
|
|
+import com.diagbot.util.StringUtil;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @description: 疾病规则
|
|
|
+ * @author: kwz
|
|
|
+ * @time: 2020/8/3 14:47
|
|
|
+ */
|
|
|
+public class DiseaseRule {
|
|
|
+ /**
|
|
|
+ * 比较疾病
|
|
|
+ *
|
|
|
+ * @param diseases
|
|
|
+ * @param wordCrfDTO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static BillMsg compareDiseaseWithBill(List<String> diseases, WordCrfDTO wordCrfDTO, String name) {
|
|
|
+ List<String> tipDiseases = new ArrayList<>();
|
|
|
+ DiagLabel diagLabel = wordCrfDTO.getDiagLabel();
|
|
|
+ if (diseases.size() > 0 && diagLabel != null && diagLabel.getDiags().size() > 0) {
|
|
|
+ List<Diag> diags = diagLabel.getDiags();
|
|
|
+ for (Diag diag:diags) {
|
|
|
+ if(diag.getNegative() == null){
|
|
|
+ tipDiseases.add(diag.getStandName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (tipDiseases.size() > 0) {
|
|
|
+ BillMsg billMsg = new BillMsg();
|
|
|
+ billMsg.setMsg(name + tipDiseases.toString());
|
|
|
+ return billMsg;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+}
|