|
@@ -4,12 +4,7 @@ import com.diagbot.biz.push.entity.Item;
|
|
|
import com.diagbot.biz.push.entity.Lis;
|
|
|
import com.diagbot.client.CRFServiceClient;
|
|
|
import com.diagbot.client.StandConvertServiceClient;
|
|
|
-import com.diagbot.dto.BillMsg;
|
|
|
-import com.diagbot.dto.RuleDTO;
|
|
|
-import com.diagbot.dto.RuleExtDTO;
|
|
|
-import com.diagbot.dto.StandConvertCrfBatchDTO;
|
|
|
-import com.diagbot.dto.StandConvertCrfDTO;
|
|
|
-import com.diagbot.dto.WordCrfDTO;
|
|
|
+import com.diagbot.dto.*;
|
|
|
import com.diagbot.enums.ConceptTypeEnum;
|
|
|
import com.diagbot.enums.LexiconEnum;
|
|
|
import com.diagbot.enums.RedisEnum;
|
|
@@ -17,38 +12,15 @@ import com.diagbot.enums.StandConvertEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
|
import com.diagbot.model.ai.AIAnalyze;
|
|
|
-import com.diagbot.model.entity.BodyPart;
|
|
|
-import com.diagbot.model.entity.Clinical;
|
|
|
-import com.diagbot.model.entity.Modification;
|
|
|
import com.diagbot.model.entity.Operation;
|
|
|
-import com.diagbot.model.entity.Pacs;
|
|
|
-import com.diagbot.model.entity.Vital;
|
|
|
-import com.diagbot.model.label.ChiefLabel;
|
|
|
-import com.diagbot.model.label.DiagLabel;
|
|
|
-import com.diagbot.model.label.PacsLabel;
|
|
|
-import com.diagbot.model.label.PastLabel;
|
|
|
-import com.diagbot.model.label.PresentLabel;
|
|
|
-import com.diagbot.model.label.VitalLabel;
|
|
|
+import com.diagbot.model.entity.*;
|
|
|
+import com.diagbot.model.label.*;
|
|
|
import com.diagbot.rule.CommonRule;
|
|
|
-import com.diagbot.util.BeanUtil;
|
|
|
-import com.diagbot.util.CoreUtil;
|
|
|
-import com.diagbot.util.ListUtil;
|
|
|
-import com.diagbot.util.RedisUtil;
|
|
|
-import com.diagbot.util.ReflectUtil;
|
|
|
-import com.diagbot.util.StringUtil;
|
|
|
-import com.diagbot.vo.NeoPushVO;
|
|
|
-import com.diagbot.vo.RuleVO;
|
|
|
-import com.diagbot.vo.SearchData;
|
|
|
-import com.diagbot.vo.StandConvert;
|
|
|
-import com.diagbot.vo.StandConvertCrfVO;
|
|
|
-import com.diagbot.vo.neoPushEntity.ChiefPushVo;
|
|
|
+import com.diagbot.util.*;
|
|
|
+import com.diagbot.vo.*;
|
|
|
import com.diagbot.vo.neoPushEntity.Diag;
|
|
|
-import com.diagbot.vo.neoPushEntity.DiagVo;
|
|
|
import com.diagbot.vo.neoPushEntity.Drug;
|
|
|
-import com.diagbot.vo.neoPushEntity.LisPushVo;
|
|
|
-import com.diagbot.vo.neoPushEntity.PacsPushVo;
|
|
|
-import com.diagbot.vo.neoPushEntity.PresentPushVo;
|
|
|
-import com.diagbot.vo.neoPushEntity.Symptom;
|
|
|
+import com.diagbot.vo.neoPushEntity.*;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import org.apache.commons.beanutils.BeanUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -58,11 +30,7 @@ import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.lang.reflect.Method;
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Iterator;
|
|
|
-import java.util.LinkedHashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -432,8 +400,8 @@ public class CommonFacade {
|
|
|
// // 3、开单辅检项目
|
|
|
// CoreUtil.setPropertyList(wordCrfDTO.getPacsOrder(), "name", "uniqueName", map.get(StandConvertEnum.pacs.toString()));
|
|
|
|
|
|
- // CoreUtil.setUninameFromDetail(wordCrfDTO.getLis(), "detailName");
|
|
|
- // CoreUtil.setUninameFromDetail(wordCrfDTO.getLisOrder(), "name");
|
|
|
+// CoreUtil.setUninameFromDetail(wordCrfDTO.getLis(), "detailName");
|
|
|
+// CoreUtil.setUninameFromDetail(wordCrfDTO.getLisOrder(), "name");
|
|
|
lisGetAndSet(wordCrfDTO);
|
|
|
pacsGetAndSet(wordCrfDTO);
|
|
|
|
|
@@ -465,7 +433,7 @@ public class CommonFacade {
|
|
|
* 类型,疾病: disease,症状: symptom,手术和操作:operation,药品: drug,实验室检查:lis,辅助检查:pacs, 辅助检查:vital"
|
|
|
*
|
|
|
* @param standConvert
|
|
|
- * @return Map<String , Map < String , String>> -->Map<类型, Map<原始词, 标准词>>
|
|
|
+ * @return Map<String,Map<String,String>> -->Map<类型, Map<原始词, 标准词>>
|
|
|
*/
|
|
|
public Map<String, Map<String, String>> standConvertCrf(StandConvert standConvert) {
|
|
|
Map<String, Map<String, String>> map = new LinkedHashMap<>();
|
|
@@ -690,25 +658,25 @@ public class CommonFacade {
|
|
|
.distinct()
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
- // Map<String, Map<String, Long>> configMap = new LinkedHashMap<>();
|
|
|
+// Map<String, Map<String, Long>> configMap = new LinkedHashMap<>();
|
|
|
if (ListUtil.isNotEmpty(operationList)) {
|
|
|
- // configMap = tranOperationConfigFacade.getConfigMap(wordCrfDTO.getHospitalId(), operationList, null);
|
|
|
+// configMap = tranOperationConfigFacade.getConfigMap(wordCrfDTO.getHospitalId(), operationList, null);
|
|
|
Map<String, Map<String, Map<String, List<String>>>> operstionMap = mappingConfigFacade.groupByHisNameWithName(operationList, ConceptTypeEnum.Operation.getKey(), wordCrfDTO.getHospitalId());
|
|
|
// 1、主诉手术
|
|
|
- // setListProperty(wordCrfDTO.getChiefLabel(), "operations", "standName", configMap);
|
|
|
- setListProperty(wordCrfDTO.getChiefLabel(), "operations", ConceptTypeEnum.Operation.getKey(), "StandName", operstionMap);
|
|
|
+// setListProperty(wordCrfDTO.getChiefLabel(), "operations", "standName", configMap);
|
|
|
+ setListProperty(wordCrfDTO.getChiefLabel(), "operations", ConceptTypeEnum.Operation.getKey(),"StandName",operstionMap);
|
|
|
// 2、现病史手术
|
|
|
- // setListProperty(wordCrfDTO.getPresentLabel(), "operations", "standName", configMap);
|
|
|
- setListProperty(wordCrfDTO.getPresentLabel(), "operations", ConceptTypeEnum.Operation.getKey(), "StandName", operstionMap);
|
|
|
+// setListProperty(wordCrfDTO.getPresentLabel(), "operations", "standName", configMap);
|
|
|
+ setListProperty(wordCrfDTO.getPresentLabel(),"operations", ConceptTypeEnum.Operation.getKey(),"StandName",operstionMap);
|
|
|
// 3、既往史手术
|
|
|
- // setListProperty(wordCrfDTO.getPastLabel(), "operations", "standName", configMap);
|
|
|
- setListProperty(wordCrfDTO.getPastLabel(), "operations", ConceptTypeEnum.Operation.getKey(), "StandName", operstionMap);
|
|
|
+// setListProperty(wordCrfDTO.getPastLabel(), "operations", "standName", configMap);
|
|
|
+ setListProperty(wordCrfDTO.getPastLabel(),"operations", ConceptTypeEnum.Operation.getKey(),"StandName",operstionMap);
|
|
|
// 4、结构化手术
|
|
|
- // setListProperty(wordCrfDTO, "operation", "uniqueName", configMap);
|
|
|
- setListProperty(wordCrfDTO, "operation", ConceptTypeEnum.Operation.getKey(), "UniqueName", operstionMap);
|
|
|
+// setListProperty(wordCrfDTO, "operation", "uniqueName", configMap);
|
|
|
+ setListProperty(wordCrfDTO, "operation", ConceptTypeEnum.Operation.getKey(),"UniqueName",operstionMap);
|
|
|
// 5、手术
|
|
|
- // setListProperty(wordCrfDTO, "operationOrder", "uniqueName", configMap);
|
|
|
- setListProperty(wordCrfDTO, "operationOrder", ConceptTypeEnum.Operation.getKey(), "UniqueName", operstionMap);
|
|
|
+// setListProperty(wordCrfDTO, "operationOrder", "uniqueName", configMap);
|
|
|
+ setListProperty(wordCrfDTO, "operationOrder", ConceptTypeEnum.Operation.getKey(),"UniqueName",operstionMap);
|
|
|
// 6、选中手术
|
|
|
if (wordCrfDTO.getOperationName() != null &&
|
|
|
StringUtil.isNotBlank(wordCrfDTO.getOperationName().getName()) &&
|
|
@@ -728,10 +696,10 @@ public class CommonFacade {
|
|
|
List<String> pacsList = new ArrayList<>();
|
|
|
// 1、结构化
|
|
|
CoreUtil.addList(pacsList, CoreUtil.filterUniqueList(wordCrfDTO.getPacs()));
|
|
|
- // // 2、开单
|
|
|
+// // 2、开单
|
|
|
CoreUtil.addList(pacsList, CoreUtil.filterUniqueList(wordCrfDTO.getPacsOrder()));
|
|
|
PacsLabel pacsLabel = wordCrfDTO.getPacsLabel();
|
|
|
- if (pacsLabel != null) {
|
|
|
+ if(pacsLabel != null){
|
|
|
pacsList = pacsLabel.getItem().stream()
|
|
|
.map(x -> x.getName())
|
|
|
.collect(Collectors.toList());
|
|
@@ -739,9 +707,9 @@ public class CommonFacade {
|
|
|
|
|
|
if (ListUtil.isNotEmpty(pacsList)) {
|
|
|
Map<String, Map<String, Map<String, List<String>>>> pacsMap = mappingConfigFacade.groupByHisNameWithName(pacsList, ConceptTypeEnum.Pacs.getKey(), wordCrfDTO.getHospitalId());
|
|
|
- setListProperty(wordCrfDTO, "pacs", ConceptTypeEnum.Pacs.getKey(), "UniqueName", pacsMap);
|
|
|
- setListProperty(wordCrfDTO, "pacsOrder", ConceptTypeEnum.Pacs.getKey(), "UniqueName", pacsMap);
|
|
|
- setListProperty(pacsLabel, "item", ConceptTypeEnum.Pacs.getKey(), "UniqueName", pacsMap);
|
|
|
+ setListProperty(wordCrfDTO, "pacs", ConceptTypeEnum.Pacs.getKey(),"UniqueName",pacsMap);
|
|
|
+ setListProperty(wordCrfDTO, "pacsOrder", ConceptTypeEnum.Pacs.getKey(),"UniqueName",pacsMap);
|
|
|
+ setListProperty(pacsLabel, "item", ConceptTypeEnum.Pacs.getKey(),"UniqueName",pacsMap);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -755,7 +723,7 @@ public class CommonFacade {
|
|
|
List<String> lisHisNameList = Lists.newArrayList();
|
|
|
// 【所有化验】
|
|
|
List<Lis> lisList = wordCrfDTO.getLis();
|
|
|
- if (ListUtil.isNotEmpty(lisList)) {
|
|
|
+ if(ListUtil.isNotEmpty(lisList)){
|
|
|
lisHisNameList.addAll(lisList
|
|
|
.stream()
|
|
|
.filter(i -> StringUtil.isNotBlank(i.getName()) || StringUtil.isNotBlank(i.getUniqueName()))
|
|
@@ -768,7 +736,7 @@ public class CommonFacade {
|
|
|
.collect(Collectors.toList());
|
|
|
if (ListUtil.isNotEmpty(lisHisNameList)) {
|
|
|
Map<String, Map<String, Map<String, List<String>>>> lisConfigMap = mappingConfigFacade.groupByHisNameWithName(lisHisNameList, ConceptTypeEnum.LisPack.getKey(), wordCrfDTO.getHospitalId());
|
|
|
- setListProperty(wordCrfDTO, "lis", ConceptTypeEnum.LisPack.getKey(), "UniqueName", lisConfigMap);
|
|
|
+ setListProperty(wordCrfDTO, "lis", ConceptTypeEnum.LisPack.getKey(),"UniqueName",lisConfigMap);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -787,9 +755,9 @@ public class CommonFacade {
|
|
|
ReflectUtil.setProperty(obj, listProperty, newList);
|
|
|
}
|
|
|
|
|
|
- public <T> void setListProperty(Object obj, String listProperty, Integer type, String propertyName, Map<String, Map<String, Map<String, List<String>>>> configMap) {
|
|
|
+ public <T> void setListProperty(Object obj, String listProperty,Integer type,String propertyName, Map<String, Map<String, Map<String, List<String>>>> configMap) {
|
|
|
Object tList = CoreUtil.getFieldValue(obj, listProperty);
|
|
|
- List<T> newList = convertStandName((List) tList, type, propertyName, configMap);
|
|
|
+ List<T> newList = convertStandName((List) tList,type, propertyName,configMap);
|
|
|
ReflectUtil.setProperty(obj, listProperty, newList);
|
|
|
}
|
|
|
|
|
@@ -851,7 +819,7 @@ public class CommonFacade {
|
|
|
* @param <T>
|
|
|
* @return
|
|
|
*/
|
|
|
- public <T> List<T> convertStandName(List<T> list, Integer type, String propertyName, Map<String, Map<String, Map<String, List<String>>>> configMap) {
|
|
|
+ public <T> List<T> convertStandName(List<T> list,Integer type,String propertyName, Map<String, Map<String, Map<String, List<String>>>> configMap) {
|
|
|
List<T> retList = new ArrayList<>();
|
|
|
if (ListUtil.isEmpty(list)) {
|
|
|
return list;
|
|
@@ -865,16 +833,16 @@ public class CommonFacade {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- // String uniqueName = item.getClass().getMethod("getUniqueName").invoke(item).toString();
|
|
|
+// String uniqueName = item.getClass().getMethod("getUniqueName").invoke(item).toString();
|
|
|
|
|
|
- String uniqueName = item.getClass().getMethod("get" + propertyName).invoke(item).toString();
|
|
|
+ String uniqueName = item.getClass().getMethod("get"+propertyName).invoke(item).toString();
|
|
|
if (StringUtil.isNotBlank(uniqueName) && !"StandName".equals(propertyName)) {
|
|
|
retList.add(item);
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
String hisDetailName = "";
|
|
|
- if (type.equals(ConceptTypeEnum.LisPack.getKey())) {
|
|
|
+ if(type.equals(ConceptTypeEnum.LisPack.getKey())) {
|
|
|
hisDetailName = item.getClass().getMethod("getDetailName").invoke(item).toString();
|
|
|
if (StringUtil.isBlank(hisDetailName)) {
|
|
|
hisDetailName = "";
|
|
@@ -890,7 +858,7 @@ public class CommonFacade {
|
|
|
for (String form : thirdEntry.getValue()) {
|
|
|
T o = (T) item.getClass().newInstance();
|
|
|
BeanUtil.copyProperties(item, o);
|
|
|
- Method setUniqueName = o.getClass().getMethod("set" + propertyName, String.class);
|
|
|
+ Method setUniqueName = o.getClass().getMethod("set"+propertyName, String.class);
|
|
|
setUniqueName.invoke(o, thirdEntry.getKey());
|
|
|
Method setForm = o.getClass().getMethod("setForm", String.class);
|
|
|
setForm.invoke(o, form);
|
|
@@ -899,7 +867,7 @@ public class CommonFacade {
|
|
|
} else {
|
|
|
T o = (T) item.getClass().newInstance();
|
|
|
BeanUtil.copyProperties(item, o);
|
|
|
- Method setUniqueName = o.getClass().getMethod("set" + propertyName, String.class);
|
|
|
+ Method setUniqueName = o.getClass().getMethod("set"+propertyName, String.class);
|
|
|
setUniqueName.invoke(o, thirdEntry.getKey());
|
|
|
retList.add(o);
|
|
|
}
|
|
@@ -910,7 +878,7 @@ public class CommonFacade {
|
|
|
for (String stdName : standNames) {
|
|
|
T o = (T) item.getClass().newInstance();
|
|
|
BeanUtil.copyProperties(item, o);
|
|
|
- Method setUniqueName = o.getClass().getMethod("set" + propertyName, String.class);
|
|
|
+ Method setUniqueName = o.getClass().getMethod("set"+propertyName, String.class);
|
|
|
setUniqueName.invoke(o, stdName);
|
|
|
retList.add(o);
|
|
|
}
|
|
@@ -1108,11 +1076,11 @@ public class CommonFacade {
|
|
|
getPacsStruct(pacsLabel, wordCrfDTO.getPresentLabel().getPacsLabel());
|
|
|
//结构化pacs
|
|
|
List<com.diagbot.biz.push.entity.Pacs> pacs = wordCrfDTO.getPacs();
|
|
|
- if (ListUtil.isNotEmpty(pacs)) {
|
|
|
- pacs.forEach(p -> {
|
|
|
+ if(ListUtil.isNotEmpty(pacs)){
|
|
|
+ pacs.forEach(p ->{
|
|
|
Item item = new Item();
|
|
|
- item.setName(p.getName() == null ? "" : p.getName());
|
|
|
- item.setUniqueName(p.getUniqueName() == null ? "" : p.getUniqueName());
|
|
|
+ item.setName(p.getName()==null?"":p.getName());
|
|
|
+ item.setUniqueName(p.getUniqueName()==null?"":p.getUniqueName());
|
|
|
pacsLabel.getItem().add(item);
|
|
|
});
|
|
|
}
|
|
@@ -1148,8 +1116,8 @@ public class CommonFacade {
|
|
|
if (ListUtil.isNotEmpty(res.getDisease())) {
|
|
|
for (Pacs pacs : res.getDisease()) {
|
|
|
Item item = new Item();
|
|
|
- item.setName(pacs.getName() == null ? "" : pacs.getName());
|
|
|
- item.setUniqueName(pacs.getStandName() == null ? "" : pacs.getStandName());
|
|
|
+ item.setName(pacs.getName()==null?"":pacs.getName());
|
|
|
+ item.setUniqueName(pacs.getStandName()==null?"":pacs.getStandName());
|
|
|
pacsResList.add(item);
|
|
|
}
|
|
|
}
|
|
@@ -1189,17 +1157,18 @@ public class CommonFacade {
|
|
|
*
|
|
|
* @param lises
|
|
|
* @param lisList
|
|
|
+ *
|
|
|
*/
|
|
|
public void getLisStruct(List<com.diagbot.model.entity.Lis> lises, List<Lis> lisList) {
|
|
|
if (ListUtil.isNotEmpty(lises)) {
|
|
|
- lises.stream().forEach(x -> {
|
|
|
- String bigName = x.getBigItem().getName();//大项名
|
|
|
- String detailName = x.getName();//小项名
|
|
|
- String value = x.getPd().getValue();
|
|
|
- String unit = x.getPd().getUnit();
|
|
|
- String standName = x.getStandName();
|
|
|
- lisList.add(getLis(bigName, detailName, value, unit, standName));
|
|
|
- });
|
|
|
+ lises.stream().forEach(x -> {
|
|
|
+ String bigName = x.getBigItem().getName();//大项名
|
|
|
+ String detailName = x.getName();//小项名
|
|
|
+ String value = x.getPd().getValue();
|
|
|
+ String unit = x.getPd().getUnit();
|
|
|
+ String standName = x.getStandName();
|
|
|
+ lisList.add(getLis(bigName,detailName,value,unit,standName));
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
|