|
@@ -4,33 +4,22 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.diagbot.client.TranServiceClient;
|
|
|
import com.diagbot.client.bean.FeatureRate;
|
|
|
import com.diagbot.client.bean.HosCodeVO;
|
|
|
-import com.diagbot.client.bean.MedicalIndication;
|
|
|
-import com.diagbot.client.bean.MedicalIndicationDetail;
|
|
|
import com.diagbot.client.bean.ResponseData;
|
|
|
-import com.diagbot.dto.ConceptPushDTO;
|
|
|
import com.diagbot.dto.LisResult;
|
|
|
import com.diagbot.dto.PushDTO;
|
|
|
import com.diagbot.dto.RespDTO;
|
|
|
import com.diagbot.dto.SysSetInfoDTO;
|
|
|
-import com.diagbot.entity.Concept;
|
|
|
-import com.diagbot.enums.ConceptTypeEnum;
|
|
|
import com.diagbot.enums.FeatureTypeEnum;
|
|
|
-import com.diagbot.enums.LexiconTypeEnum;
|
|
|
import com.diagbot.enums.LisSourceEnum;
|
|
|
import com.diagbot.enums.SysTypeEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
|
-import com.diagbot.util.EntityUtil;
|
|
|
-import com.diagbot.util.FastJsonUtils;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
-import com.diagbot.util.ParamConvertUtil;
|
|
|
import com.diagbot.util.RespDTOUtil;
|
|
|
import com.diagbot.util.StringUtil;
|
|
|
-import com.diagbot.vo.ConceptBaseVO;
|
|
|
import com.diagbot.vo.HospitalSetVO;
|
|
|
import com.diagbot.vo.LisConfigVO;
|
|
|
import com.diagbot.vo.SearchVo;
|
|
|
-import com.google.common.collect.Lists;
|
|
|
import io.github.lvyahui8.spring.aggregate.facade.DataBeanAggregateQueryFacade;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
@@ -53,8 +42,6 @@ import java.util.stream.Collectors;
|
|
|
public class PushFacade {
|
|
|
@Autowired
|
|
|
private ClinicalFacade clinicalFacade;
|
|
|
-// @Autowired
|
|
|
-// private ConceptFacade conceptFacade;
|
|
|
@Autowired
|
|
|
private TreatmentFacade treatmentFacade;
|
|
|
@Autowired
|
|
@@ -113,7 +100,6 @@ public class PushFacade {
|
|
|
|
|
|
//确定推送科室
|
|
|
List<FeatureRate> dis = data.getDis();
|
|
|
-// pushDTO.setDept(getDept(dis));
|
|
|
|
|
|
try {
|
|
|
Map<String, Object> invokeParams = new HashMap<>();
|
|
@@ -128,159 +114,6 @@ public class PushFacade {
|
|
|
} catch (Exception e) {
|
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR);
|
|
|
}
|
|
|
-// //症状 概念列表
|
|
|
-// if (featureTypeSet.contains(String.valueOf(FeatureTypeEnum.Feature_Type_Symptom.getKey()))) {
|
|
|
-// List<FeatureRate> symptom = data.getSymptom();
|
|
|
-// if (ListUtil.isNotEmpty(symptom)) {
|
|
|
-// List<String> nameList = symptom
|
|
|
-// .stream()
|
|
|
-// .map(featureRate -> featureRate.getFeatureName())
|
|
|
-// .collect(Collectors.toList());
|
|
|
-// if (ListUtil.isNotEmpty(nameList)) {
|
|
|
-// pushDTO.setSymptom(getConceptDTOList(nameList, LexiconTypeEnum.SYMPTOM.getKey()));
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// //查体 查体结果
|
|
|
-// if (featureTypeSet.contains(String.valueOf(FeatureTypeEnum.Feature_Type_Vital_Result.getKey()))) {
|
|
|
-// List<FeatureRate> vital = data.getVitals();
|
|
|
-// if (ListUtil.isNotEmpty(vital)) {
|
|
|
-// List<String> nameList = vital
|
|
|
-// .stream()
|
|
|
-// .map(featureRate -> featureRate.getFeatureName())
|
|
|
-// .collect(Collectors.toList());
|
|
|
-// if (ListUtil.isNotEmpty(nameList)) {
|
|
|
-// pushDTO.setVital(getConceptDTOList(nameList, LexiconTypeEnum.VITAL_RESULT.getKey()));
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// //查体 查体指标
|
|
|
-// if (featureTypeSet.contains(String.valueOf(FeatureTypeEnum.Feature_Type_Vital_Index.getKey()))) {
|
|
|
-// List<FeatureRate> vital = data.getVitals();
|
|
|
-// if (ListUtil.isNotEmpty(vital)) {
|
|
|
-// List<String> nameList = vital
|
|
|
-// .stream()
|
|
|
-// .map(featureRate -> featureRate.getFeatureName())
|
|
|
-// .collect(Collectors.toList());
|
|
|
-// if (ListUtil.isNotEmpty(nameList)) {
|
|
|
-// pushDTO.setVital(getConceptDTOList(nameList, LexiconTypeEnum.VITAL_INDEX.getKey()));
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-// //化验 概念列表-公表项
|
|
|
-// if (featureTypeSet.contains(String.valueOf(FeatureTypeEnum.Feature_Type_Lis.getKey()))) {
|
|
|
-// List<FeatureRate> lis = data.getLabs();
|
|
|
-// if (ListUtil.isNotEmpty(lis)) {
|
|
|
-// List<String> nameList = lis
|
|
|
-// .stream()
|
|
|
-// .map(featureRate -> featureRate.getFeatureName())
|
|
|
-// .collect(Collectors.toList());
|
|
|
-// if (ListUtil.isNotEmpty(nameList)) {
|
|
|
-// List<ConceptPushDTO> lisDTO = getConceptDTOList(nameList, LexiconTypeEnum.LIS_PACKAGE.getKey());
|
|
|
-// if (isConnect) {
|
|
|
-// lisDTO = addClientName(lisDTO, searchVo.getHosCode(), ConceptTypeEnum.Lis.getKey());
|
|
|
-// //lisDTO = removeLisDetail(lisDTO);
|
|
|
-// }
|
|
|
-// pushDTO.setLab(lisDTO);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// //辅检 概念列表
|
|
|
-// if (featureTypeSet.contains(String.valueOf(FeatureTypeEnum.Feature_Type_Pacs.getKey()))) {
|
|
|
-// List<FeatureRate> pacs = data.getPacs();
|
|
|
-// if (ListUtil.isNotEmpty(pacs)) {
|
|
|
-// List<String> nameList = pacs
|
|
|
-// .stream()
|
|
|
-// .map(featureRate -> featureRate.getFeatureName())
|
|
|
-// .collect(Collectors.toList());
|
|
|
-// if (ListUtil.isNotEmpty(nameList)) {
|
|
|
-// List<ConceptPushDTO> pacsDTO = getConceptDTOList(nameList, LexiconTypeEnum.PACS_ITEMS.getKey());
|
|
|
-// if (isConnect) {
|
|
|
-// pacsDTO = addClientName(pacsDTO, searchVo.getHosCode(), ConceptTypeEnum.Pacs.getKey());
|
|
|
-// }
|
|
|
-// pushDTO.setPacs(pacsDTO);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// //诊断 map
|
|
|
-// if (featureTypeSet.contains(String.valueOf(FeatureTypeEnum.Feature_Type_Disease.getKey()))) {
|
|
|
-// if (ListUtil.isNotEmpty(dis)) {
|
|
|
-// Map<String, List<ConceptPushDTO>> disMapDTO = new LinkedHashMap<>();
|
|
|
-// Map<String, List<FeatureRate>> disFeatureMap = new LinkedHashMap<>();
|
|
|
-// //诊断分类
|
|
|
-// 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<FeatureRate> featureRateList = Lists.newLinkedList();
|
|
|
-// if (disFeatureMap.get(disClass) != null) {
|
|
|
-// featureRateList = disFeatureMap.get(disClass);
|
|
|
-// }
|
|
|
-// featureRateList.add(featureRate);
|
|
|
-// disFeatureMap.put(disClass, featureRateList);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// for (Map.Entry<String, List<FeatureRate>> entry : disFeatureMap.entrySet()) {
|
|
|
-// List<String> nameListByDisClass = entry.getValue()
|
|
|
-// .stream()
|
|
|
-// .map(featureRate -> featureRate.getFeatureName())
|
|
|
-// .collect(Collectors.toList());
|
|
|
-// if (ListUtil.isNotEmpty(nameListByDisClass)) {
|
|
|
-// List<ConceptPushDTO> disDTO
|
|
|
-// = getConceptDTOList(nameListByDisClass, LexiconTypeEnum.DIAGNOSIS.getKey());
|
|
|
-// if (isConnect) {
|
|
|
-// disDTO = addClientName(disDTO, searchVo.getHosCode(), ConceptTypeEnum.Disease.getKey());
|
|
|
-// }
|
|
|
-// disMapDTO.put(entry.getKey(), disDTO);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// pushDTO.setDis(disMapDTO);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// //核心指标 list
|
|
|
-// if (featureTypeSet.contains(String.valueOf(FeatureTypeEnum.Feature_Type_Indication.getKey()))) {
|
|
|
-// List<MedicalIndication> medicalIndicationList = data.getMedicalIndications();
|
|
|
-// ConceptBaseVO conceptBaseVO = new ConceptBaseVO();
|
|
|
-// if (ListUtil.isNotEmpty(medicalIndicationList)) {
|
|
|
-// for (MedicalIndication medicalIndication : medicalIndicationList) {
|
|
|
-// medicalIndication.setLibType(LexiconTypeEnum.CORE_INDICATORS.getKey());
|
|
|
-// medicalIndication.setType(ConceptTypeEnum.Indication.getKey());
|
|
|
-// //关联概念,增加概念id
|
|
|
-// conceptBaseVO.setName(medicalIndication.getName());
|
|
|
-// conceptBaseVO.setLibType(LexiconTypeEnum.CORE_INDICATORS.getKey());
|
|
|
-// Concept medConcept = conceptFacade.getConcept(conceptBaseVO);
|
|
|
-// if (medConcept != null) {
|
|
|
-// medicalIndication.setConceptId(medConcept.getId());
|
|
|
-// }
|
|
|
-// if (ListUtil.isNotEmpty(medicalIndication.getDetails())) {
|
|
|
-// for (MedicalIndicationDetail detail : medicalIndication.getDetails()) {
|
|
|
-// //量表,增加概念id;其他类型保留图谱返回结果
|
|
|
-// if (detail.getType().equals(1)) {
|
|
|
-// JSONObject scaleJson = detail.getContent();
|
|
|
-// if (null != scaleJson.get("name")) {
|
|
|
-// String scaleName = scaleJson.get("name").toString();
|
|
|
-// conceptBaseVO.setName(scaleName);
|
|
|
-// conceptBaseVO.setLibType(LexiconTypeEnum.GAUGE.getKey());
|
|
|
-// Concept scaleConcept = conceptFacade.getConcept(conceptBaseVO);
|
|
|
-// scaleJson.put("libType", LexiconTypeEnum.GAUGE.getKey());
|
|
|
-// scaleJson.put("type", ConceptTypeEnum.Scale.getKey());
|
|
|
-// if (scaleConcept != null) {
|
|
|
-// scaleJson.put("conceptId", scaleConcept.getId());
|
|
|
-// } else {
|
|
|
-// scaleJson.put("conceptId", null);
|
|
|
-// }
|
|
|
-// detail.setContent(scaleJson);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// pushDTO.setMedicalIndications(medicalIndicationList);
|
|
|
-// }
|
|
|
-// }
|
|
|
return pushDTO;
|
|
|
}
|
|
|
|
|
@@ -331,69 +164,6 @@ public class PushFacade {
|
|
|
return treatmentMap;
|
|
|
}
|
|
|
|
|
|
-// /**
|
|
|
-// * 推理返回概念
|
|
|
-// *
|
|
|
-// * @param nameList
|
|
|
-// * @param libType
|
|
|
-// * @return
|
|
|
-// */
|
|
|
-// public List<ConceptPushDTO> getConceptDTOList(List<String> nameList, Integer libType) {
|
|
|
-// List<Concept> concepts = conceptFacade.getListByNamesAndType(nameList, libType);
|
|
|
-// Map<String, Concept> conceptMap = EntityUtil.makeEntityMap(concepts, "libName");
|
|
|
-// List<ConceptPushDTO> conceptDTOS = Lists.newLinkedList();
|
|
|
-// for (String name : nameList) {
|
|
|
-// ConceptPushDTO conceptDTO = new ConceptPushDTO();
|
|
|
-// conceptDTO.setName(name);
|
|
|
-// conceptDTO.setLibType(libType);
|
|
|
-// conceptDTO.setType(ParamConvertUtil.libConvert2Concept(libType));
|
|
|
-// if (conceptMap.containsKey(name) && conceptMap.get(name) != null) {
|
|
|
-// Concept concept = conceptMap.get(name);
|
|
|
-// conceptDTO.setConceptId(concept.getId());
|
|
|
-// }
|
|
|
-// conceptDTOS.add(conceptDTO);
|
|
|
-// }
|
|
|
-// return conceptDTOS;
|
|
|
-// }
|
|
|
-
|
|
|
-// /**
|
|
|
-// * 根据诊断推送确定科室
|
|
|
-// *
|
|
|
-// * @param dis
|
|
|
-// * @return
|
|
|
-// */
|
|
|
-// public ConceptPushDTO getDept(List<FeatureRate> dis) {
|
|
|
-// String deptName = "";
|
|
|
-// if (ListUtil.isNotEmpty(dis)) {
|
|
|
-// for (FeatureRate featureRate : dis) {
|
|
|
-// if (StringUtil.isNotBlank(featureRate.getExtraProperty())) {
|
|
|
-// deptName = featureRate.getExtraProperty();
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// //没有推送信息时,默认取全科模板
|
|
|
-// if (StringUtil.isBlank(deptName)) {
|
|
|
-// deptName = "全科";
|
|
|
-// }
|
|
|
-// ConceptBaseVO conceptBaseVO = new ConceptBaseVO();
|
|
|
-// conceptBaseVO.setName(deptName);
|
|
|
-// conceptBaseVO.setLibType(LexiconTypeEnum.DEPARTMENT.getKey());
|
|
|
-// ConceptPushDTO deptDTO = new ConceptPushDTO();
|
|
|
-// Concept dept = conceptFacade.getConcept(conceptBaseVO);
|
|
|
-// if (dept == null && deptName.equals("全科") == false) {
|
|
|
-// deptName = "全科";
|
|
|
-// conceptBaseVO.setName(deptName);
|
|
|
-// dept = conceptFacade.getConcept(conceptBaseVO);
|
|
|
-// }
|
|
|
-// if (dept != null) {
|
|
|
-// deptDTO.setName(deptName);
|
|
|
-// deptDTO.setConceptId(dept.getId());
|
|
|
-// deptDTO.setLibType(ConceptTypeEnum.DEPARTMENT.getKey());
|
|
|
-// }
|
|
|
-// return deptDTO;
|
|
|
-// }
|
|
|
-
|
|
|
/**
|
|
|
* 增加化验公表项
|
|
|
*
|
|
@@ -430,95 +200,4 @@ public class PushFacade {
|
|
|
}
|
|
|
return lisResults;
|
|
|
}
|
|
|
-
|
|
|
-// /**
|
|
|
-// * 添加外部名称(调用方)
|
|
|
-// *
|
|
|
-// * @param concepts
|
|
|
-// * @param hosCode
|
|
|
-// * @param type
|
|
|
-// * @return
|
|
|
-// */
|
|
|
-// public List<ConceptPushDTO> addClientName(List<ConceptPushDTO> concepts, String hosCode, Integer type) {
|
|
|
-// HosCodeVO hosCodeVO = new HosCodeVO();
|
|
|
-// hosCodeVO.setHosCode(hosCode);
|
|
|
-// LisConfigVO lisConfigVO = new LisConfigVO();
|
|
|
-// lisConfigVO.setHosCode(hosCode);
|
|
|
-// List<String> uniqueNameList = concepts
|
|
|
-// .stream()
|
|
|
-// .map(concept -> concept.getName())
|
|
|
-// .collect(Collectors.toList());
|
|
|
-// lisConfigVO.setUniqueNameList(uniqueNameList);
|
|
|
-// if (type.equals(ConceptTypeEnum.Lis.getKey())) {
|
|
|
-// RespDTO<Map<String, List<String>>> lisRes
|
|
|
-// = tranServiceClient.getLisConfigByUniqueNameAndHosCode(lisConfigVO);
|
|
|
-// if (RespDTOUtil.respIsOK(lisRes)) {
|
|
|
-// Map<String, List<String>> lisMappingByUniqueName = lisRes.data;
|
|
|
-// for (ConceptPushDTO concept : concepts) {
|
|
|
-// List<String> clientNames = lisMappingByUniqueName.get(concept.getName());
|
|
|
-// if (ListUtil.isNotEmpty(clientNames)) {
|
|
|
-// concept.setClientNames(clientNames);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// } else if (type.equals(ConceptTypeEnum.Pacs.getKey())) {
|
|
|
-// RespDTO<Map<String, List<String>>> pacsRes
|
|
|
-// = tranServiceClient.getPacsConfigByUniqueNameAndHosCode(hosCodeVO);
|
|
|
-// if (RespDTOUtil.respIsOK(pacsRes)) {
|
|
|
-// Map<String, List<String>> pacsConfigMapByUniqueName = pacsRes.data;
|
|
|
-// for (ConceptPushDTO concept : concepts) {
|
|
|
-// List<String> clientNames = pacsConfigMapByUniqueName.get(concept.getName());
|
|
|
-// if (ListUtil.isNotEmpty(clientNames)) {
|
|
|
-// concept.setClientNames(clientNames);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// } else if (type.equals(ConceptTypeEnum.Disease.getKey())) {
|
|
|
-// RespDTO<Map<String, String>> disRes = tranServiceClient.getDiseaseIcdByHosCode(hosCodeVO);
|
|
|
-// if (RespDTOUtil.respIsOK(disRes)) {
|
|
|
-// Map<String, String> disMap = disRes.data;
|
|
|
-// for (ConceptPushDTO concept : concepts) {
|
|
|
-// String clientName = disMap.get(concept.getName());
|
|
|
-// if (StringUtil.isNotBlank(clientName)) {
|
|
|
-// List<String> clientNames = Lists.newLinkedList();
|
|
|
-// clientNames.add(clientName);
|
|
|
-// concept.setClientNames(clientNames);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// return concepts;
|
|
|
-// }
|
|
|
-
|
|
|
- /**
|
|
|
- * 外部化验返回时,公表匹配出套餐,保留套餐,删除细项;否则保留公表
|
|
|
- *
|
|
|
- * @param lisDTO
|
|
|
- * @return
|
|
|
- */
|
|
|
- /*public List<ConceptPushDTO> removeLisDetail(List<ConceptPushDTO> lisDTO) {
|
|
|
- List<ConceptPushDTO> retLisDTO = Lists.newLinkedList();
|
|
|
- if (ListUtil.isEmpty(lisDTO)) {
|
|
|
- return retLisDTO;
|
|
|
- }
|
|
|
- List<String> mealNameList = lisDTO.stream().map(lis -> lis.getClientName()).filter(mealName -> mealName != null && mealName != "").distinct().collect(Collectors.toList());
|
|
|
- List<ConceptPushDTO> mealConceptList = getConceptDTOList(mealNameList, LexiconTypeEnum.LIS_TABLES.getKey());
|
|
|
- Map<String, ConceptPushDTO> mealConceptMap = EntityUtil.makeEntityMap(mealConceptList, "name");
|
|
|
- List<String> addedName = Lists.newLinkedList();
|
|
|
- for (ConceptPushDTO conceptPushDTO : lisDTO) {
|
|
|
- if (addedName.contains(conceptPushDTO.getName())) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- if (StringUtil.isBlank(conceptPushDTO.getClientName()) || conceptPushDTO.getClientName().equals(conceptPushDTO.getName())) {
|
|
|
- addedName.add(conceptPushDTO.getName());
|
|
|
- retLisDTO.add(conceptPushDTO);
|
|
|
- } else {
|
|
|
- ConceptPushDTO conceptPushDTOConvert = mealConceptMap.get(conceptPushDTO.getClientName());
|
|
|
- conceptPushDTOConvert.setClientName(conceptPushDTO.getClientName());
|
|
|
- addedName.add(conceptPushDTOConvert.getName());
|
|
|
- retLisDTO.add(conceptPushDTOConvert);
|
|
|
- }
|
|
|
- }
|
|
|
- return retLisDTO;
|
|
|
- }*/
|
|
|
}
|