|
@@ -1,17 +1,10 @@
|
|
-package org.diagbot.bigdata.work;
|
|
|
|
|
|
+package org.diagbot.common.push.filter.rule;
|
|
|
|
|
|
|
|
|
|
-import org.diagbot.bigdata.common.ApplicationCacheUtil;
|
|
|
|
-import org.diagbot.common.javabean.Rule;
|
|
|
|
-import org.diagbot.common.push.filter.PreResult;
|
|
|
|
-import org.diagbot.common.push.filter.pretreat.Pretreatment;
|
|
|
|
-import org.diagbot.common.push.filter.pretreat.PretreatmentPacs;
|
|
|
|
-import org.diagbot.common.push.filter.pretreat.PretreatmentSymptom;
|
|
|
|
-import org.diagbot.common.push.filter.pretreat.PretreatmentVital;
|
|
|
|
-import org.diagbot.common.work.CrisisDetail;
|
|
|
|
-import org.diagbot.common.work.LisDetail;
|
|
|
|
-import org.diagbot.common.work.ResponseData;
|
|
|
|
-import org.diagbot.common.work.SearchData;
|
|
|
|
|
|
+import org.diagbot.common.push.bean.PreResult;
|
|
|
|
+import org.diagbot.common.push.bean.ResponseData;
|
|
|
|
+import org.diagbot.common.push.bean.SearchData;
|
|
|
|
+import org.diagbot.common.push.filter.pretreat.*;
|
|
import org.diagbot.pub.Constants;
|
|
import org.diagbot.pub.Constants;
|
|
import org.springframework.util.StringUtils;
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
@@ -19,53 +12,34 @@ import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
-public class PretreatmentFilter {
|
|
|
|
- public void crisisFilter(SearchData searchData, ResponseData responseData) throws java.io.IOException {
|
|
|
|
- //将数值类型内容全部转换为标准术语 依据kl_rule提供规则
|
|
|
|
-
|
|
|
|
- List<CrisisDetail> allCrisisDetailList = new ArrayList<>();
|
|
|
|
|
|
+public class PretreatmentRule {
|
|
|
|
+ public void rule(SearchData searchData) throws java.io.IOException {
|
|
//症状数据
|
|
//症状数据
|
|
if (!StringUtils.isEmpty(searchData.getSymptom())) {
|
|
if (!StringUtils.isEmpty(searchData.getSymptom())) {
|
|
- searchData.setSymptom(add2PreResultList(new PretreatmentSymptom(), searchData.getSymptom(), allCrisisDetailList));
|
|
|
|
|
|
+ searchData.setSymptom(add2PreResultList(new PretreatmentSymptom(), searchData.getSymptom(), "symptom"));
|
|
}
|
|
}
|
|
//体征数据
|
|
//体征数据
|
|
if (!StringUtils.isEmpty(searchData.getVital())) {
|
|
if (!StringUtils.isEmpty(searchData.getVital())) {
|
|
- searchData.setVital(add2PreResultList(new PretreatmentVital(), searchData.getVital(), allCrisisDetailList));
|
|
|
|
- }
|
|
|
|
- //lis文本非结构化数据
|
|
|
|
- if (!StringUtils.isEmpty(searchData.getLis())) {
|
|
|
|
- searchData.setLis(add2PreResultList(new PretreatmentVital(), searchData.getLis(), allCrisisDetailList));
|
|
|
|
|
|
+ searchData.setVital(add2PreResultList(new PretreatmentVital(), searchData.getVital(), "vital"));
|
|
}
|
|
}
|
|
//lis结构化信息
|
|
//lis结构化信息
|
|
if (searchData.getLisArr() != null && searchData.getLisArr().size() > 0) {
|
|
if (searchData.getLisArr() != null && searchData.getLisArr().size() > 0) {
|
|
- List<PreResult> preResultList = new ArrayList<>();
|
|
|
|
- for (LisDetail detail : searchData.getLisArr()) {
|
|
|
|
- PreResult result = new PreResult();
|
|
|
|
- result.setName(detail.getName());
|
|
|
|
- result.setDetailName(detail.getDetailName());
|
|
|
|
- result.setUnits(detail.getUnits());
|
|
|
|
- result.setMaxValue(String.valueOf(detail.getMaxValue()));
|
|
|
|
- result.setMinValue(String.valueOf(detail.getMinValue()));
|
|
|
|
- result.setOtherValue(detail.getOtherValue());
|
|
|
|
- result.setUniqueName(detail.getUniqueName());
|
|
|
|
- result.setValue(String.valueOf(detail.getValue()));
|
|
|
|
- preResultList.add(result);
|
|
|
|
- }
|
|
|
|
- searchData.setLis(add2PreResultList(preResultList, searchData.getLis(), allCrisisDetailList));
|
|
|
|
|
|
+ searchData.setLis(add2PreResultList(searchData.getLisArr(), searchData.getLis(), "lis"));
|
|
|
|
+ } else if (!StringUtils.isEmpty(searchData.getLis())) {
|
|
|
|
+ searchData.setLis(add2PreResultList(new PretreatmentLis(), searchData.getLis(), "lis"));
|
|
}
|
|
}
|
|
//pacs数据
|
|
//pacs数据
|
|
if (!StringUtils.isEmpty(searchData.getPacs())) {
|
|
if (!StringUtils.isEmpty(searchData.getPacs())) {
|
|
- searchData.setPacs(add2PreResultList(new PretreatmentPacs(), searchData.getPacs(), allCrisisDetailList));
|
|
|
|
|
|
+ searchData.setPacs(add2PreResultList(new PretreatmentPacs(), searchData.getPacs(), "pacs"));
|
|
}
|
|
}
|
|
- responseData.setCrisisDetails(allCrisisDetailList);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- private String add2PreResultList(Pretreatment pretreatment, String content, List<CrisisDetail> allCrisisDetailList) throws java.io.IOException {
|
|
|
|
|
|
+ private String add2PreResultList(Pretreatment pretreatment, String content, String ruleType) throws java.io.IOException {
|
|
List<PreResult> preResultList = pretreatment.analyze(content);
|
|
List<PreResult> preResultList = pretreatment.analyze(content);
|
|
- return add2PreResultList(preResultList, content, allCrisisDetailList);
|
|
|
|
|
|
+ return add2PreResultList(preResultList, content, ruleType);
|
|
}
|
|
}
|
|
|
|
|
|
- private String add2PreResultList(List<PreResult> preResultList, String content, List<CrisisDetail> allCrisisDetailList) throws java.io.IOException {
|
|
|
|
|
|
+ private String add2PreResultList(List<PreResult> preResultList, String content, String ruleType) throws java.io.IOException {
|
|
Map<String, List<Rule>> kl_rule_filter_map = ApplicationCacheUtil.getKl_rule_filter_map();
|
|
Map<String, List<Rule>> kl_rule_filter_map = ApplicationCacheUtil.getKl_rule_filter_map();
|
|
if (preResultList != null) {
|
|
if (preResultList != null) {
|
|
for (PreResult result : preResultList) {
|
|
for (PreResult result : preResultList) {
|