|
@@ -5,15 +5,11 @@ import com.diagbot.client.AiptServiceClient;
|
|
|
import com.diagbot.client.TranServiceClient;
|
|
|
import com.diagbot.client.bean.ConceptBaseVO;
|
|
|
import com.diagbot.client.bean.ConceptExistVO;
|
|
|
-import com.diagbot.client.bean.FeatureRate;
|
|
|
-import com.diagbot.client.bean.GdbResponse;
|
|
|
import com.diagbot.client.bean.ResponseData;
|
|
|
import com.diagbot.client.bean.SearchData;
|
|
|
import com.diagbot.dto.ConceptBaseDTO;
|
|
|
import com.diagbot.dto.ConceptPushDTO;
|
|
|
-import com.diagbot.dto.EMRQuestionDTO;
|
|
|
import com.diagbot.dto.PushDTO;
|
|
|
-import com.diagbot.dto.PushEMRDTO;
|
|
|
import com.diagbot.dto.PushKYJDTO;
|
|
|
import com.diagbot.dto.QuestionDTO;
|
|
|
import com.diagbot.dto.QuestionPushDTO;
|
|
@@ -29,12 +25,8 @@ import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
|
import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.EntityUtil;
|
|
|
-import com.diagbot.util.FastJsonUtils;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
import com.diagbot.util.RespDTOUtil;
|
|
|
-import com.diagbot.util.StringUtil;
|
|
|
-import com.diagbot.vo.EMRPushVO;
|
|
|
-import com.diagbot.vo.HosCodeVO;
|
|
|
import com.diagbot.vo.LisResult;
|
|
|
import com.diagbot.vo.PushKYJVO;
|
|
|
import com.diagbot.vo.PushVO;
|
|
@@ -162,7 +154,7 @@ public class PushFacade {
|
|
|
List<ConceptPushDTO> vitalDTOList = addQuestionId(vitals, QuestionTypeEnum.Vital.getKey());
|
|
|
pushDTO.setVital(vitalDTOList);
|
|
|
if (ListUtil.isNotEmpty(vitalDTOList)) {
|
|
|
- List<Long> vitalIds = vitalDTOList.stream().map(vital -> vital.getId()).collect(Collectors.toList());
|
|
|
+ List<Long> vitalIds = vitalDTOList.stream().map(vital -> vital.getId()).filter(vitalId -> vitalId != null).collect(Collectors.toList());
|
|
|
pushDTO.setVitalIds(vitalIds);
|
|
|
}
|
|
|
}
|
|
@@ -360,174 +352,6 @@ public class PushFacade {
|
|
|
return vitalDTO;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 电子病历评级-数据服务模式推理
|
|
|
- *
|
|
|
- * @param emrPushVO
|
|
|
- * @return
|
|
|
- */
|
|
|
- public PushEMRDTO pushEMR(EMRPushVO emrPushVO) {
|
|
|
- Boolean isDocking = tranServiceClient.isDocking().data;
|
|
|
- PushEMRDTO pushEMRDTO = new PushEMRDTO();
|
|
|
- HosCodeVO hosCodeVO = new HosCodeVO();
|
|
|
- hosCodeVO.setHosCode(emrPushVO.getHosCode());
|
|
|
- PushVO pushVO = new PushVO();
|
|
|
- BeanUtil.copyProperties(emrPushVO, pushVO);
|
|
|
- //化验项转公表内容,参数处理
|
|
|
- if (ListUtil.isNotEmpty(pushVO.getLis())) {
|
|
|
- Map<String, Map<String, String>> lisConfigMap = new LinkedHashMap<>();
|
|
|
- Map<String, String> lisConfigMap_emptyItemName = new LinkedHashMap<>();
|
|
|
- if (isDocking) {
|
|
|
- lisConfigMap = tranServiceClient.getLisConfigByHosCode_NotEmptyItemName(hosCodeVO).data;
|
|
|
- lisConfigMap_emptyItemName = tranServiceClient.getLisConfigByHosCode_EmptyItemName(hosCodeVO).data;
|
|
|
- } else {
|
|
|
- lisConfigMap = lisMappingFacade.getLisMapping_NotEmptyItemName();
|
|
|
- lisConfigMap_emptyItemName = lisMappingFacade.getLisConfig_EmptyItemName();
|
|
|
- }
|
|
|
- List<LisResult> lisResultList = pushVO.getLis();
|
|
|
- for (LisResult lisResult : lisResultList) {
|
|
|
- if (StringUtil.isNotBlank(lisResult.getName())) {
|
|
|
- if (StringUtil.isNotBlank(lisResult.getDetailName())) {
|
|
|
- lisResult.setUniqueName(lisConfigMap.get(lisResult.getName()).get(lisResult.getDetailName()));
|
|
|
- } else {
|
|
|
- lisResult.setUniqueName(lisConfigMap_emptyItemName.get(lisResult.getName()));
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- pushVO.setLis(lisResultList);
|
|
|
- }
|
|
|
-
|
|
|
- SearchData searchData = assembleFacade.assembleData(pushVO);
|
|
|
- ResponseData data = pushAipt(searchData);
|
|
|
- String featureType = pushVO.getFeatureType();
|
|
|
- String[] featureTypes = featureType.split(",|,");
|
|
|
- Set<String> featureTypeSet = new HashSet(Arrays.asList(featureTypes));
|
|
|
-
|
|
|
- if (featureTypeSet.contains(String.valueOf(QuestionTypeEnum.Symptom.getKey()))) {
|
|
|
- List<FeatureRate> symptomFeature = data.getSymptom();
|
|
|
- if (symptomFeature.size() > 0) {
|
|
|
- List<EMRQuestionDTO> symptomList = Lists.newLinkedList();
|
|
|
- for (FeatureRate featureRate : symptomFeature) {
|
|
|
- EMRQuestionDTO symptom = new EMRQuestionDTO();
|
|
|
- symptom.setName(featureRate.getFeatureName());
|
|
|
- symptom.setUniqueName(featureRate.getFeatureName());
|
|
|
- symptomList.add(symptom);
|
|
|
- }
|
|
|
- pushEMRDTO.setSymptomList(symptomList);
|
|
|
- }
|
|
|
- }
|
|
|
- if (featureTypeSet.contains(String.valueOf(QuestionTypeEnum.Vital.getKey()))) {
|
|
|
- List<FeatureRate> vitalFeature = data.getVitals();
|
|
|
- if (vitalFeature.size() > 0) {
|
|
|
- List<EMRQuestionDTO> vitalList = Lists.newLinkedList();
|
|
|
- for (FeatureRate featureRate : vitalFeature) {
|
|
|
- EMRQuestionDTO vital = new EMRQuestionDTO();
|
|
|
- vital.setName(featureRate.getFeatureName());
|
|
|
- vital.setUniqueName(featureRate.getFeatureName());
|
|
|
- vitalList.add(vital);
|
|
|
- }
|
|
|
- pushEMRDTO.setVitalList(vitalList);
|
|
|
- }
|
|
|
- }
|
|
|
- if (featureTypeSet.contains(String.valueOf(QuestionTypeEnum.Lis.getKey()))) {
|
|
|
- List<FeatureRate> lisFeatures = data.getLabs();
|
|
|
- if (lisFeatures.size() > 0) {
|
|
|
- Map<String, List<String>> lisMappingByUniqueName = new LinkedHashMap<>();
|
|
|
- if (isDocking) {
|
|
|
- lisMappingByUniqueName = tranServiceClient.getLisConfigByUniqueNameAndHosCode(hosCodeVO).data;
|
|
|
- } else {
|
|
|
- lisMappingByUniqueName = lisMappingFacade.getLisMappingByUniqueName();
|
|
|
- }
|
|
|
- List<EMRQuestionDTO> lisList = Lists.newLinkedList();
|
|
|
- for (FeatureRate featureRate : lisFeatures) {
|
|
|
- EMRQuestionDTO lis = new EMRQuestionDTO();
|
|
|
- lis.setUniqueName(featureRate.getFeatureName());
|
|
|
- if (ListUtil.isNotEmpty(lisMappingByUniqueName.get(featureRate.getFeatureName()))) {
|
|
|
- lis.setName(lisMappingByUniqueName.get(featureRate.getFeatureName()).get(0));
|
|
|
- }
|
|
|
- lisList.add(lis);
|
|
|
- }
|
|
|
- pushEMRDTO.setLisList(lisList);
|
|
|
- }
|
|
|
- }
|
|
|
- if (featureTypeSet.contains(String.valueOf(QuestionTypeEnum.Pacs.getKey()))) {
|
|
|
- List<FeatureRate> pacsFeatures = data.getPacs();
|
|
|
- if (pacsFeatures.size() > 0) {
|
|
|
- Map<String, List<String>> pacsConfigMapByUniqueName = new LinkedHashMap<>();
|
|
|
- if (isDocking) {
|
|
|
- pacsConfigMapByUniqueName = tranServiceClient.getPacsConfigByUniqueNameAndHosCode(hosCodeVO).data;
|
|
|
- }
|
|
|
- List<EMRQuestionDTO> pacsList = Lists.newLinkedList();
|
|
|
- for (FeatureRate featureRate : pacsFeatures) {
|
|
|
- EMRQuestionDTO pacs = new EMRQuestionDTO();
|
|
|
- pacs.setUniqueName(featureRate.getFeatureName());
|
|
|
- if (isDocking) {
|
|
|
- if (ListUtil.isNotEmpty(pacsConfigMapByUniqueName.get(featureRate.getFeatureName()))) {
|
|
|
- pacs.setName(pacsConfigMapByUniqueName.get(featureRate.getFeatureName()).get(0));
|
|
|
- }
|
|
|
- } else {
|
|
|
- pacs.setName(featureRate.getFeatureName());
|
|
|
- }
|
|
|
- pacsList.add(pacs);
|
|
|
- }
|
|
|
- pushEMRDTO.setPacsList(pacsList);
|
|
|
- }
|
|
|
- }
|
|
|
- if (featureTypeSet.contains(String.valueOf(QuestionTypeEnum.Disease.getKey()))) {
|
|
|
- List<FeatureRate> dis = data.getDis();
|
|
|
- List<String> disNameList = dis.stream().map(disease -> disease.getFeatureName()).collect(Collectors.toList());
|
|
|
- Map<String, List<EMRQuestionDTO>> retDisMap = new LinkedHashMap<>();
|
|
|
- Map<String, String> disMap = tranServiceClient.getDiseaseIcdByHosCode(hosCodeVO).data;
|
|
|
-
|
|
|
- //诊断分类
|
|
|
- for (FeatureRate featureRate : dis) {
|
|
|
- if (StringUtil.isBlank(featureRate.getDesc())) {
|
|
|
- featureRate.setDesc("{\"可能诊断\":\"\"}");
|
|
|
- }
|
|
|
- Map<String, Object> descMap = FastJsonUtils.getJsonToMap(featureRate.getDesc());
|
|
|
- for (String disClass : descMap.keySet()) {
|
|
|
- List<EMRQuestionDTO> retDisList = Lists.newLinkedList();
|
|
|
- if (retDisMap.get(disClass) != null) {
|
|
|
- retDisList = retDisMap.get(disClass);
|
|
|
- }
|
|
|
- EMRQuestionDTO retDis = new EMRQuestionDTO();
|
|
|
- retDis.setUniqueName(featureRate.getFeatureName());
|
|
|
- if (isDocking) {
|
|
|
- //对接模式转icd10名称
|
|
|
- retDis.setName(disMap.get(featureRate.getFeatureName()));
|
|
|
- } else {
|
|
|
- retDis.setName(featureRate.getFeatureName());
|
|
|
- }
|
|
|
- retDisList.add(retDis);
|
|
|
- retDisMap.put(disClass, retDisList);
|
|
|
- }
|
|
|
- }
|
|
|
- //警惕
|
|
|
- searchData = new SearchData();
|
|
|
- searchData.setDiag(String.join(",", disNameList));
|
|
|
- RespDTO<GdbResponse> graphRes = aiptServiceClient.highRisk(searchData);
|
|
|
- Map<String, String> graphResult = graphRes.data.getResult();
|
|
|
- if (graphResult.size() > 0) {
|
|
|
- List<EMRQuestionDTO> highRiskDisList = Lists.newLinkedList();
|
|
|
- for (Map.Entry<String, String> entry : graphResult.entrySet()) {
|
|
|
- if (entry.getValue().equals("1")) {
|
|
|
- EMRQuestionDTO hrDis = new EMRQuestionDTO();
|
|
|
- hrDis.setUniqueName(entry.getKey());
|
|
|
- if (isDocking) {
|
|
|
- hrDis.setName(disMap.get(entry.getKey()));
|
|
|
- } else {
|
|
|
- hrDis.setName(entry.getValue());
|
|
|
- }
|
|
|
- highRiskDisList.add(hrDis);
|
|
|
- }
|
|
|
- }
|
|
|
- retDisMap.put("警惕", highRiskDisList);
|
|
|
- }
|
|
|
- pushEMRDTO.setDis(retDisMap);
|
|
|
- }
|
|
|
- return pushEMRDTO;
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
/**
|
|
|
* 概念关联标签,添加标签id ——症状,化验
|