|
@@ -4,11 +4,14 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.diagbot.client.TranServiceClient;
|
|
|
import com.diagbot.client.bean.FeatureRate;
|
|
|
import com.diagbot.client.bean.GdbResponse;
|
|
|
+import com.diagbot.client.bean.MedicalIndication;
|
|
|
+import com.diagbot.client.bean.MedicalIndicationDetail;
|
|
|
import com.diagbot.client.bean.ResponseData;
|
|
|
import com.diagbot.client.bean.SearchData;
|
|
|
import com.diagbot.dto.ConceptPushDTO;
|
|
|
import com.diagbot.dto.PushDTO;
|
|
|
import com.diagbot.entity.Concept;
|
|
|
+import com.diagbot.enums.ConceptTypeEnum;
|
|
|
import com.diagbot.enums.FeatureTypeEnum;
|
|
|
import com.diagbot.enums.LexiconTypeEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
@@ -17,6 +20,7 @@ import com.diagbot.util.FastJsonUtils;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
import com.diagbot.util.ParamConvertUtil;
|
|
|
import com.diagbot.util.StringUtil;
|
|
|
+import com.diagbot.vo.ConceptBaseVO;
|
|
|
import com.diagbot.vo.SearchVo;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -61,24 +65,9 @@ public class PushFacade {
|
|
|
String[] featureTypes = featureType.split(",|,");
|
|
|
Set<String> featureTypeSet = new HashSet(Arrays.asList(featureTypes));
|
|
|
|
|
|
- //诊断
|
|
|
+ //确定推送科室
|
|
|
List<FeatureRate> dis = data.getDis();
|
|
|
- //推送科室
|
|
|
- String deptName = "";
|
|
|
- if (ListUtil.isNotEmpty(dis)) {
|
|
|
- for (FeatureRate featureRate : dis) {
|
|
|
- if (StringUtil.isNotBlank(featureRate.getExtraProperty())) {
|
|
|
- deptName = featureRate.getExtraProperty();
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- //没有推送信息时,默认取全科模板
|
|
|
- if (StringUtil.isBlank(deptName)) {
|
|
|
- deptName = "全科";
|
|
|
- }
|
|
|
- pushDTO.setDeptName(deptName);
|
|
|
-
|
|
|
+ pushDTO.setDept(getDept(dis));
|
|
|
|
|
|
//症状 概念列表
|
|
|
if (featureTypeSet.contains(String.valueOf(FeatureTypeEnum.Feature_Type_Symptom.getKey()))) {
|
|
@@ -172,9 +161,66 @@ public class PushFacade {
|
|
|
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) {
|
|
|
+ //关联概念,增加概念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);
|
|
|
+ if (scaleConcept != null) {
|
|
|
+ scaleJson.put("id", scaleConcept.getId());
|
|
|
+ } else {
|
|
|
+ scaleJson.put("id", null);
|
|
|
+ }
|
|
|
+ detail.setContent(scaleJson);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ pushDTO.setMedicalIndications(medicalIndicationList);
|
|
|
+ }
|
|
|
+ }
|
|
|
return pushDTO;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取管理评估大数据推理内容
|
|
|
+ *
|
|
|
+ * @param searchVo
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Map<String, JSONObject> getManagementEvaluationContent(SearchVo searchVo) {
|
|
|
+ ResponseData data = clinicalFacade.processClinicalData(searchVo);
|
|
|
+
|
|
|
+ String featureType = searchVo.getFeatureType();
|
|
|
+ String[] featureTypes = featureType.split(",|,");
|
|
|
+ Set<String> featureTypeSet = new HashSet(Arrays.asList(featureTypes));
|
|
|
+ if (featureTypeSet.contains(String.valueOf(FeatureTypeEnum.Feature_Type_ManagementEvaluation.getKey()))) {
|
|
|
+ return data.getManagementEvaluation();
|
|
|
+ } else {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 获取治疗方案
|
|
|
*
|
|
@@ -212,4 +258,42 @@ public class PushFacade {
|
|
|
}
|
|
|
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;
|
|
|
+ }
|
|
|
}
|