123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582 |
- package com.diagbot.rule;
- import com.diagbot.biz.push.entity.Lis;
- import com.diagbot.biz.push.entity.Pacs;
- import com.diagbot.dto.BaseDiagnoseDTO;
- import com.diagbot.dto.BillMsg;
- import com.diagbot.dto.DictionaryInfoDTO;
- import com.diagbot.dto.RuleBaseDTO;
- import com.diagbot.dto.RuleSimpleDTO;
- import com.diagbot.dto.WordCrfDTO;
- import com.diagbot.enums.BaseDiagnoseTypeEnum;
- import com.diagbot.enums.ConEnum;
- import com.diagbot.enums.LexiconEnum;
- import com.diagbot.enums.RedisEnum;
- import com.diagbot.enums.TypeEnum;
- import com.diagbot.facade.CommonFacade;
- import com.diagbot.facade.KlDictionaryInfoFacade;
- import com.diagbot.model.entity.Clinical;
- import com.diagbot.model.entity.Negative;
- import com.diagbot.util.BeanUtil;
- import com.diagbot.util.CatalogueUtil;
- import com.diagbot.util.CoreUtil;
- import com.diagbot.util.EntityUtil;
- import com.diagbot.util.ListUtil;
- import com.diagbot.util.MsgNewUtil;
- import com.diagbot.util.MsgUtil;
- import com.diagbot.util.RedisUtil;
- import com.diagbot.util.ReflectUtil;
- import com.diagbot.util.RegexUtil;
- import com.diagbot.util.StringUtil;
- import org.apache.commons.lang3.StringUtils;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Component;
- import java.util.ArrayList;
- import java.util.Collections;
- import java.util.Comparator;
- import java.util.Date;
- import java.util.LinkedHashMap;
- import java.util.List;
- import java.util.Map;
- import java.util.Set;
- import java.util.stream.Collectors;
- /**
- * @description: 通用规则提取
- * @author: kwz
- * @time: 2020/8/3 14:47
- */
- @Component
- public class CommonRule {
- @Autowired
- CommonFacade commonFacade;
- @Autowired
- GroupRule groupRule;
- @Autowired
- VitalRule vitalRule;
- @Autowired
- AgeRule ageRule;
- @Autowired
- LisRule lisRule;
- @Autowired
- KlDictionaryInfoFacade klDictionaryInfoFacade;
- @Autowired
- RedisUtil redisUtil;
- @Autowired
- MsgNewUtil msgNewUtil;
- /**
- * 比较阳性属性是否匹配
- *
- * @param input
- * @param ruleBaseDTO
- * @param billMsgList
- * @param conType
- * @param ruleSimpleDTO
- * @param <T>
- */
- public <T> void compareNameWithBill(List<T> input, RuleBaseDTO ruleBaseDTO, List<BillMsg> billMsgList,
- String conType, RuleSimpleDTO ruleSimpleDTO) {
- if (ListUtil.isNotEmpty(input)) {
- for (T d : input) {
- Negative val = (Negative) CoreUtil.getFieldValue(d, "negative");
- if (val == null) {
- String standName = (String) CoreUtil.getFieldValue(d, "standName");
- String name = (String) CoreUtil.getFieldValue(d, "name");
- if (StringUtils.isNotBlank(standName) && CoreUtil.compareName(ruleBaseDTO, standName)) {
- ruleSimpleDTO.setContent(name);
- ruleSimpleDTO.setConType(conType);
- BillMsg billMsg = msgNewUtil.getCommonBillMsg(ruleSimpleDTO);
- CoreUtil.addBeanToList(billMsgList, billMsg);
- }
- }
- }
- }
- }
- /**
- * 比较阳性属性是否匹配
- *
- * @param input
- * @param ruleBaseDTO
- * @param baseIdList
- * @param ids
- * @param <T>
- */
- public <T> void compareNameWithPush(List<T> input, RuleBaseDTO ruleBaseDTO, List<Long> baseIdList, String ids) {
- if (ListUtil.isNotEmpty(input)) {
- for (T d : input) {
- Negative val = (Negative) CoreUtil.getFieldValue(d, "negative");
- if (val == null) {
- String c = (String) CoreUtil.getFieldValue(d, "standName");
- if (StringUtils.isNotBlank(c) && CoreUtil.compareNameMulti(ruleBaseDTO, c)) {
- CoreUtil.addSplitString(baseIdList, ids);
- }
- }
- }
- }
- }
- /**
- * 比较是否包含
- *
- * @param input
- * @param name
- * @return
- */
- public <T> Boolean containsItem(List<T> input, String name) {
- if (ListUtil.isNotEmpty(input) && StringUtil.isNotBlank(name)) {
- for (T t : input) {
- String c = (String) CoreUtil.getFieldValue(t, "uniqueName"); // 标准名称
- if (c.contains(name)) {
- return true;
- }
- }
- }
- return false;
- }
- /**
- * 比较名称是否匹配
- *
- * @param input
- * @param ruleBaseDTO
- * @param <T>
- */
- public <T> Map compareItem(List<T> input, RuleBaseDTO ruleBaseDTO) {
- Map<String, Object> map = new LinkedHashMap<>();
- boolean flag = false;
- if (ruleBaseDTO == null || ListUtil.isEmpty(input)) {
- map.put("flag", flag);
- return map;
- }
- List<String> msgList = new ArrayList<>();
- for (T t : input) {
- String c = (String) CoreUtil.getFieldValue(t, "uniqueName"); // 标准名称
- String c_name = (String) CoreUtil.getFieldValue(t, "name"); // 界面名称
- if (CoreUtil.compareName(ruleBaseDTO, c)) {
- msgList.add(c_name);
- flag = true;
- }
- }
- map.put("flag", flag);
- map.put("msgList", msgList);
- return map;
- }
- /**
- * 比较名称是否匹配——开单
- *
- * @param input
- * @param ruleBaseDTO
- * @param billMsgList
- * @param conType
- * @param ruleSimpleDTO
- * @param <T>
- */
- public <T> void compareItemWithBill(List<T> input, RuleBaseDTO ruleBaseDTO, List<BillMsg> billMsgList,
- String conType, RuleSimpleDTO ruleSimpleDTO) {
- if (ListUtil.isNotEmpty(input)) {
- for (T t : input) {
- String uniqueName = (String) CoreUtil.getFieldValue(t, "uniqueName"); // 标准名称
- String inputName = (String) CoreUtil.getFieldValue(t, "name"); // 界面名称
- if (CoreUtil.compareName(ruleBaseDTO, uniqueName)) {
- ruleSimpleDTO.setContent(inputName);
- ruleSimpleDTO.setConType(conType);
- BillMsg billMsg = msgNewUtil.getCommonBillMsg(ruleSimpleDTO);
- CoreUtil.addBeanToList(billMsgList, billMsg);
- }
- }
- }
- }
- /**
- * 比较名称是否匹配——推理
- *
- * @param input
- * @param ruleBaseDTO
- * @param baseIdList
- * @param ids
- * @param <T>
- */
- public <T> void compareItemWithPush(List<T> input, RuleBaseDTO ruleBaseDTO, List<Long> baseIdList, String ids) {
- if (ListUtil.isNotEmpty(input)) {
- for (T t : input) {
- String c = (String) CoreUtil.getFieldValue(t, "uniqueName"); // 标准名称
- if (CoreUtil.compareNameMulti(ruleBaseDTO, c)) {
- CoreUtil.addSplitString(baseIdList, ids);
- }
- }
- }
- }
- /**
- * 比较名称是否匹配
- *
- * @param input
- * @param ruleBaseDTO
- * @param highRiskList
- * @param ruleSimpleDTO
- * @param <T>
- */
- public <T> void compareItemWithHighRisk(List<T> input, RuleBaseDTO ruleBaseDTO, List<BillMsg> highRiskList, RuleSimpleDTO ruleSimpleDTO) {
- if (ListUtil.isNotEmpty(input)) {
- for (T t : input) {
- String c = (String) CoreUtil.getFieldValue(t, "uniqueName"); // 标准名称
- String c_name = (String) CoreUtil.getFieldValue(t, "name"); // 界面名称
- if (CoreUtil.compareName(ruleBaseDTO, c)) {
- BillMsg billMsg = MsgUtil.getCommonHighRiskMsg(c_name, ruleSimpleDTO.getInputName(), ruleSimpleDTO.getLibTypeName());
- highRiskList.add(billMsg);
- }
- }
- }
- }
- /**
- * 正常结果,无需重复开单项——辅检
- *
- * @param wordCrfDTO
- * @param ruleBaseDTO
- * @param billMsgList
- * @param ruleSimpleDTO
- */
- public void needlessRepeatOrderPacs(WordCrfDTO wordCrfDTO, RuleBaseDTO ruleBaseDTO, List<BillMsg> billMsgList, String conType, RuleSimpleDTO ruleSimpleDTO) {
- String orderStandName = ruleBaseDTO.getBaseLibName();
- Map<String, List<Pacs>> map = EntityUtil.makeEntityListMap(wordCrfDTO.getPacs(), "uniqueName");
- List<Pacs> pacsList = map.get(orderStandName);
- if (ListUtil.isNotEmpty(pacsList)) {
- sortByProperty(pacsList, "dateValue");
- Pacs pacs = pacsList.get(pacsList.size() - 1); // 按时间排序,取最后一条
- String result = pacs.getResult();
- if (StringUtil.isNotBlank(result) && StringUtil.isNotBlank(ruleBaseDTO.getBaseEqValue())
- && RegexUtil.getRegexRes(result, ruleBaseDTO.getBaseEqValue())) {
- String dateValue = pacs.getDateValue(); // 结果日期
- String orderDateValue = ruleSimpleDTO.getDateValue(); // 开单项日期
- int flag = CoreUtil.compareTime(dateValue, orderDateValue, 60L * 24 * 7, false);
- if (flag == 1) {
- ruleSimpleDTO.setContent(result);
- ruleSimpleDTO.setConType(conType);
- BillMsg billMsg = msgNewUtil.getCommonBillMsg(ruleSimpleDTO);
- CoreUtil.addBeanToList(billMsgList, billMsg);
- }
- }
- }
- }
- /**
- * 正常结果,无需重复开单项——化验
- *
- * @param wordCrfDTO
- * @param ruleBaseDTO
- * @param billMsgList
- * @param ruleSimpleDTO
- */
- public void needlessRepeatOrderLis(WordCrfDTO wordCrfDTO, RuleBaseDTO ruleBaseDTO, List<BillMsg> billMsgList, String conType, RuleSimpleDTO ruleSimpleDTO) {
- String orderStandName = ruleBaseDTO.getBaseLibName();
- Map<String, List<Lis>> map = EntityUtil.makeEntityListMap(wordCrfDTO.getLis(), "uniqueName");
- List<Lis> lisList = map.get(orderStandName);
- if (ListUtil.isNotEmpty(lisList)) {
- sortByProperty(lisList, "dateValue");
- Lis lis = lisList.get(lisList.size() - 1); // 按时间排序,取最后一条
- Map<String, Object> lisMap = CoreUtil.compareLis(ruleBaseDTO, lis);
- if (CoreUtil.getMapFlag(lisMap)) {
- String dateValue = lis.getDateValue(); // 结果日期
- String orderDateValue = ruleSimpleDTO.getDateValue(); // 开单项日期
- int flag = CoreUtil.compareTime(dateValue, orderDateValue, 60L * 24 * 7, false);
- if (flag == 1) { // 有效期范围内
- ruleSimpleDTO.setContent(CoreUtil.getMapMsg(lisMap));
- ruleSimpleDTO.setConType(conType);
- BillMsg billMsg = msgNewUtil.getCommonBillMsg(ruleSimpleDTO);
- CoreUtil.addBeanToList(billMsgList, billMsg);
- }
- }
- }
- }
- /**
- * 正则匹配——推送
- *
- * @param content 文本内容
- * @param regex 表达式
- * @return
- */
- public void getRegexResPush(String content, String regex, List<Long> baseIdList, String ids) {
- // 是否有符合的数据
- boolean flag = RegexUtil.getRegexRes(content, regex);
- if (flag) {
- CoreUtil.addSplitString(baseIdList, ids);
- }
- }
- /**
- * 根据指定字段按照字符串排序
- *
- * @param tList
- * @param property
- * @param <T>
- */
- public <T> void sortByProperty(List<T> tList, String property) {
- if (ListUtil.isNotEmpty(tList) && tList.size() > 1) {
- // items 按照时间排序
- Collections.sort(tList, new Comparator<T>() {
- @Override
- public int compare(T o1, T o2) {
- String o1Str = (String) CoreUtil.getFieldValue(o1, property);
- String o2Str = (String) CoreUtil.getFieldValue(o2, property);
- if (StringUtil.isBlank(o1Str)) {
- return -1;
- }
- if (StringUtil.isBlank(o2Str)) {
- return 1;
- }
- return o1Str.compareTo(o2Str);
- }
- });
- }
- }
- /**
- * 24小时重复开单总入口
- *
- * @param wordCrfDTO
- * @param billMsgList
- */
- public void repeat24Bill(WordCrfDTO wordCrfDTO, List<BillMsg> billMsgList) {
- repeat24BillWithType(billMsgList, wordCrfDTO.getLisOrder(), TypeEnum.lis.getName(), ConEnum.repeat24.getName()); // 化验重复开单
- repeat24BillWithType(billMsgList, wordCrfDTO.getPacsOrder(), TypeEnum.pacs.getName(), ConEnum.repeat24.getName()); // 辅检重复开单
- // repeat24BillWithType(billMsgList, wordCrfDTO.getDrugOrder(), TypeEnum.drug.getName(), ConEnum.repeat24.getName()); // 药品重复开单
- // repeat24BillWithType(billMsgList, wordCrfDTO.getOperationOrder(), TypeEnum.operation.getName(), ConEnum.repeat24.getName()); // 手术重复开单
- // repeat24BillWithType(billMsgList, wordCrfDTO.getTransfusionOrder(), TypeEnum.transfusion.getName(), ConEnum.repeat24.getName()); // 输血重复开单
- }
- // /**
- // * 互斥开单项——辅检
- // *
- // * @param wordCrfDTO
- // * @param ruleBaseDTO
- // * @param billMsgList
- // * @param ruleSimpleDTO
- // * @param set 用于记录:A与B不宜同时进行, B与A不宜同时进行 只能提示一个
- // */
- // public void exclusionBill(WordCrfDTO wordCrfDTO, RuleBaseDTO ruleBaseDTO, List<BillMsg> billMsgList, String conType, RuleSimpleDTO ruleSimpleDTO, Set<String> set) {
- // // 辅检开单项互斥
- // List<Pacs> pacsOrder = wordCrfDTO.getPacsOrder();
- // if (ListUtil.isNotEmpty(pacsOrder) && pacsOrder.size() > 1) {
- // // 不同的辅检项目可能对应同一个uniqueName,提示显示多条
- // Map<String, List<Pacs>> map = EntityUtil.makeEntityListMap(pacsOrder, "uniqueName");
- // List<Pacs> orginNameList = map.get(ruleBaseDTO.getBaseLibName()); // 互斥名称
- // if (map.get(ruleBaseDTO.getBaseLibName()) != null) {
- // for (Pacs pacs : orginNameList) {
- // String orginName = pacs.getName();
- // // A与B不宜同时进行, B与A不宜同时进行 只能提示一个
- // if (!set.contains(ruleSimpleDTO.getLibName() + "******" + orginName)) {
- // set.add(ruleSimpleDTO.getLibName() + "******" + orginName);
- // set.add(orginName + "******" + ruleSimpleDTO.getLibName());
- // ruleSimpleDTO.setContent(orginName);
- // ruleSimpleDTO.setConType(conType);
- // BillMsg billMsg = msgNewUtil.getCommonBillMsg(ruleSimpleDTO);
- // CoreUtil.addBeanToList(billMsgList, billMsg);
- // }
- // }
- // }
- // }
- // }
- /**
- * 互斥开单项
- *
- * @param orderList 开单列表
- * @param ruleBaseDTO
- * @param billMsgList
- * @param ruleSimpleDTO
- * @param set 用于记录:A与B不宜同时进行, B与A不宜同时进行 只能提示一个
- */
- public <T> void exclusionBill(List<T> orderList, RuleBaseDTO ruleBaseDTO, List<BillMsg> billMsgList, String conType, RuleSimpleDTO ruleSimpleDTO, Set<String> set) {
- if (ListUtil.isNotEmpty(orderList) && orderList.size() > 1) {
- // 不同的项目可能对应同一个uniqueName,提示显示多条
- Map<String, List<T>> map = EntityUtil.makeEntityListMap(orderList, "uniqueName");
- List<T> orginNameList = map.get(ruleBaseDTO.getBaseLibName());
- if (map.get(ruleBaseDTO.getBaseLibName()) != null) {
- for (T bean : orginNameList) {
- String orginName = ReflectUtil.getProperty(bean, "name");
- // A与B不宜同时进行, B与A不宜同时进行 只能提示一个
- if (!set.contains(ruleSimpleDTO.getLibName() + "******" + orginName)) {
- set.add(ruleSimpleDTO.getLibName() + "******" + orginName);
- set.add(orginName + "******" + ruleSimpleDTO.getLibName());
- ruleSimpleDTO.setContent(orginName);
- ruleSimpleDTO.setConType(conType);
- BillMsg billMsg = msgNewUtil.getCommonBillMsg(ruleSimpleDTO);
- CoreUtil.addBeanToList(billMsgList, billMsg);
- }
- }
- }
- }
- }
- /**
- * 获取频次分组
- *
- * @param frequency
- * @return
- */
- public String getFrquenceType(String frequency) {
- if (StringUtil.isEmpty(frequency)) {
- frequency = "空";
- }
- List<DictionaryInfoDTO> listByGroupType = redisUtil.get(RedisEnum.frequency.getName());
- for (DictionaryInfoDTO dic : listByGroupType) {
- if (RegexUtil.getRegexRes(frequency, dic.getVal())) {
- return dic.getName();
- }
- }
- return "单次";
- }
- /**
- * 24小时重复开单入口
- *
- * @param billMsgList
- * @param itemList
- * @param type
- * @param conType 禁忌条件
- * @param <T>
- */
- public <T> void repeat24BillWithType(List<BillMsg> billMsgList, List<T> itemList, String type, String conType) {
- if (ListUtil.isEmpty(itemList)) {
- return;
- }
- Map<String, List<T>> map = CoreUtil.makeEntityListMap(itemList, "name", "uniqueName");
- for (String key : map.keySet()) {
- List<T> items = map.get(key);
- if (ListUtil.isNotEmpty(items) && items.size() > 1) {
- for (int i = 0; i < items.size() - 1; i++) {
- T it = items.get(i);
- String curDateValue = ReflectUtil.getProperty(it, "dateValue");
- if (StringUtil.isNotBlank(curDateValue)) {
- Date curDate = CatalogueUtil.parseStringDate(curDateValue);
- for (int j = i + 1; j < items.size(); j++) {
- T itNext = items.get(j);
- String nextDateValue = ReflectUtil.getProperty(itNext, "dateValue");
- if (StringUtil.isNotBlank(nextDateValue)) {
- Date nextDate = CatalogueUtil.parseStringDate(nextDateValue);
- if (!CatalogueUtil.compareTime(curDate, nextDate, 60L * 24, true)
- && getFrquenceType(ReflectUtil.getProperty(it, "frequency"))
- .equals(getFrquenceType(ReflectUtil.getProperty(itNext, "frequency")))) {
- String name = (String) CoreUtil.getFieldValue(it, "name");
- String uniqueName = (String) CoreUtil.getFieldValue(it, "uniqueName");
- RuleSimpleDTO ruleSimpleDTO = new RuleSimpleDTO();
- ruleSimpleDTO.setInputName(name);
- ruleSimpleDTO.setLibName(uniqueName);
- ruleSimpleDTO.setLibTypeName(type);
- ruleSimpleDTO.setContent(name);
- ruleSimpleDTO.setConType(ConEnum.repeat24.getName());
- BillMsg billMsg = msgNewUtil.getCommonBillMsg(ruleSimpleDTO);
- CoreUtil.addBeanToList(billMsgList, billMsg);
- break;
- }
- }
- }
- }
- }
- }
- }
- }
- /**
- * 高风险药品、手术
- *
- * @param ruleSimpleDTO
- * @param highRiskList
- */
- public void highRisk(RuleSimpleDTO ruleSimpleDTO, List<BillMsg> highRiskList) {
- BillMsg billMsg = MsgUtil.getCommonHighRiskMsg(ruleSimpleDTO.getMsg(),
- ruleSimpleDTO.getInputName(), ruleSimpleDTO.getLibTypeName());
- highRiskList.add(billMsg);
- }
- /**
- * 根据基础规则,通用
- *
- * @param wordCrfDTO
- */
- public List<Long> matchBase(WordCrfDTO wordCrfDTO, List<BaseDiagnoseDTO> baseList) {
- List<Long> baseIdList = new ArrayList<>();
- /**---------------------------数据统一处理开始--------------------------------- */
- // 【临床表现数据来源】(主诉、现病史)
- List<Clinical> clinicals = commonFacade.getClinicalSource(wordCrfDTO);
- /**---------------------------数据统一处理结束--------------------------------- */
- // 规则处理
- for (BaseDiagnoseDTO base : baseList) {
- RuleBaseDTO ruleBaseDTO = new RuleBaseDTO();
- BeanUtil.copyProperties(base, ruleBaseDTO);
- String baseIds = base.getIds();
- BaseDiagnoseTypeEnum baseEnum = BaseDiagnoseTypeEnum.getEnum(base.getBaseType());
- if (baseEnum == null) { // 防止报空指针
- continue;
- }
- switch (baseEnum) {
- case equals: // 等于术语本身
- switch (LexiconEnum.getEnum(base.getBaseLibType())) {
- case Symptom: // 症状
- compareNameWithPush(clinicals, ruleBaseDTO, baseIdList, baseIds);
- break;
- case Disease: // 疾病【病史】
- compareNameWithPush(wordCrfDTO.getPastLabel().getDiags(), ruleBaseDTO, baseIdList, baseIds);
- break;
- case VitalResult: // 体格检查结果
- vitalRule.push(wordCrfDTO.getVitalLabel(), ruleBaseDTO, baseIdList, baseIds);
- break;
- case Group: // 人群
- groupRule.push(wordCrfDTO, ruleBaseDTO, baseIdList, baseIds);
- break;
- case PacsResult: // 辅助检查结果
- compareItemWithPush(wordCrfDTO.getPacsLabel().getRes(), ruleBaseDTO, baseIdList, baseIds);
- break;
- }
- break;
- case compare: // 比较
- switch (LexiconEnum.getEnum(base.getBaseLibType())) {
- case LisSubName: // 化验
- lisRule.push(wordCrfDTO.getLis(), ruleBaseDTO, baseIdList, baseIds);
- break;
- case Age: // 年龄
- ageRule.push(wordCrfDTO, ruleBaseDTO, baseIdList, baseIds);
- break;
- case Vital: // 体格检查项目
- vitalRule.push(wordCrfDTO.getVitalLabel(), ruleBaseDTO, baseIdList, baseIds);
- break;
- }
- break;
- case regexChiefSymptom: // 主诉现病史正则
- getRegexResPush(wordCrfDTO.getChief() + wordCrfDTO.getSymptom(),
- base.getBaseEqValue(), baseIdList, baseIds);
- break;
- case regexPast: // 既往史正则
- getRegexResPush(wordCrfDTO.getPasts() + wordCrfDTO.getPersonal() + wordCrfDTO.getMenstrual() + wordCrfDTO.getMarital() + wordCrfDTO.getFamily(),
- base.getBaseEqValue(), baseIdList, baseIds);
- case regexVital: // 查体正则
- getRegexResPush(wordCrfDTO.getVital(),
- base.getBaseEqValue(), baseIdList, baseIds);
- case regexPacs: // 辅检正则
- if (ListUtil.isNotEmpty(wordCrfDTO.getPacs())) {
- String content = wordCrfDTO.getPacs().stream().map(r -> r.getResult())
- .filter(r -> StringUtil.isNotBlank(r)).collect(Collectors.joining("。"));
- getRegexResPush(content, base.getBaseEqValue(), baseIdList, baseIds);
- }
- break;
- }
- }
- Collections.sort(baseIdList); // id排序,方便调试查看
- return baseIdList;
- }
- public static void main(String[] args) {
- CommonRule commonRule = new CommonRule();
- System.out.println(commonRule.getFrquenceType(null));
- }
- }
|