MedEquRule.java 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package com.diagbot.rule;
  2. import com.diagbot.dto.BillMsg;
  3. import com.diagbot.dto.RuleBaseDTO;
  4. import com.diagbot.dto.RuleSimpleDTO;
  5. import com.diagbot.dto.WordCrfDTO;
  6. import com.diagbot.util.MsgUtil;
  7. import org.springframework.stereotype.Component;
  8. import java.util.List;
  9. /**
  10. * @description: 禁忌医疗器械及物品规则
  11. * @author: zhoutg
  12. * @time: 2020/8/3 14:47
  13. */
  14. @Component
  15. public class MedEquRule {
  16. /**
  17. * 比较文本内容是否存在
  18. *
  19. * @param wordCrfDTO
  20. * @param ruleBaseDTO
  21. * @param billMsgList
  22. * @param conType
  23. * @param ruleSimpleDTO
  24. */
  25. public void bill(WordCrfDTO wordCrfDTO, RuleBaseDTO ruleBaseDTO, List<BillMsg> billMsgList, String conType,
  26. RuleSimpleDTO ruleSimpleDTO) {
  27. String chief = wordCrfDTO.getChief();
  28. String symptom = wordCrfDTO.getSymptom();
  29. String pasts = wordCrfDTO.getPasts();
  30. boolean flag = false;
  31. if (chief.contains(ruleBaseDTO.getBaseLibName()) || symptom.contains(ruleBaseDTO.getBaseLibName())
  32. || pasts.contains(ruleBaseDTO.getBaseLibName())) {
  33. flag = true;
  34. }
  35. if (flag) {
  36. BillMsg billMsg = MsgUtil.getCommonBillMsg(ruleSimpleDTO.getInputName(), ruleSimpleDTO.getLibName(),
  37. ruleBaseDTO.getBaseLibName(), conType, ruleSimpleDTO.getLibTypeName());
  38. billMsgList.add(billMsg);
  39. }
  40. }
  41. }