package com.diagbot.rule; import com.diagbot.dto.BillMsg; import com.diagbot.dto.RuleBaseDTO; import com.diagbot.dto.RuleSimpleDTO; import com.diagbot.dto.WordCrfDTO; import com.diagbot.util.MsgUtil; import org.springframework.stereotype.Component; import java.util.List; /** * @description: 禁忌医疗器械及物品规则 * @author: zhoutg * @time: 2020/8/3 14:47 */ @Component public class MedEquRule { /** * 比较文本内容是否存在 * * @param wordCrfDTO * @param ruleBaseDTO * @param billMsgList * @param conType * @param ruleSimpleDTO */ public void bill(WordCrfDTO wordCrfDTO, RuleBaseDTO ruleBaseDTO, List billMsgList, String conType, RuleSimpleDTO ruleSimpleDTO) { String chief = wordCrfDTO.getChief(); String symptom = wordCrfDTO.getSymptom(); String pasts = wordCrfDTO.getPasts(); boolean flag = false; if (chief.contains(ruleBaseDTO.getBaseLibName()) || symptom.contains(ruleBaseDTO.getBaseLibName()) || pasts.contains(ruleBaseDTO.getBaseLibName())) { flag = true; } if (flag) { BillMsg billMsg = MsgUtil.getCommonBillMsg(ruleSimpleDTO.getInputName(), ruleSimpleDTO.getLibName(), ruleBaseDTO.getBaseLibName(), conType, ruleSimpleDTO.getLibTypeName()); billMsgList.add(billMsg); } } }