|
@@ -7,19 +7,23 @@ import com.diagbot.client.bean.Response;
|
|
|
import com.diagbot.client.bean.ResponseData;
|
|
|
import com.diagbot.client.bean.SearchData;
|
|
|
import com.diagbot.dto.PushDTO;
|
|
|
+import com.diagbot.dto.QuestionDTO;
|
|
|
import com.diagbot.entity.DeptInfo;
|
|
|
import com.diagbot.entity.DeptVital;
|
|
|
import com.diagbot.entity.QuestionInfo;
|
|
|
import com.diagbot.entity.VitalOrder;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
+import com.diagbot.enums.QuestionTypeEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
|
import com.diagbot.util.EntityUtil;
|
|
|
import com.diagbot.vo.PushVO;
|
|
|
+import com.diagbot.vo.QuestionVO;
|
|
|
import com.diagbot.web.DeptInfoController;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.sun.corba.se.impl.ior.OldJIDLObjectKeyTemplate;
|
|
|
import com.sun.xml.internal.ws.config.metro.dev.FeatureReader;
|
|
|
+import org.aspectj.weaver.patterns.TypePatternQuestions;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
@@ -82,7 +86,6 @@ public class PushFacade {
|
|
|
String[] featureTypes = featureType.split(",|,");
|
|
|
Set<String> featureTypeSet = new HashSet(Arrays.asList(featureTypes));
|
|
|
|
|
|
-
|
|
|
searchData.setFeatureType(pushVO.getFeatureType());
|
|
|
searchData.setSysCode("1");
|
|
|
searchData.setLength(10);
|
|
@@ -99,51 +102,71 @@ public class PushFacade {
|
|
|
Map<String, Object> labMap = list2Map(labs);
|
|
|
Map<String, Object> pacsMap = list2Map(pacs);
|
|
|
|
|
|
- //症状(主诉 type=1;现病史 type=2) 返回 tagName+id
|
|
|
- if (featureTypeSet.contains("1") || featureTypeSet.contains("2")) {
|
|
|
+ if (featureTypeSet.contains(QuestionTypeEnum.Lis.getKey())) {
|
|
|
+ pushDTO.setLabMap(labMap);
|
|
|
+ } else if (featureTypeSet.contains(QuestionTypeEnum.Pacs.getKey())) {
|
|
|
+ pushDTO.setPacsMap(pacsMap);
|
|
|
+ } else if (featureTypeSet.contains(QuestionTypeEnum.Disease.getKey())) {
|
|
|
+ pushDTO.setDisMap(disMap);
|
|
|
+ }
|
|
|
+ //症状(主诉 type=1;现病史 type=2) 返回 tagName+填写单
|
|
|
+ else if (featureTypeSet.contains(QuestionTypeEnum.Mainsuit.getKey()) || featureTypeSet.contains(QuestionTypeEnum.Symptom.getKey())) {
|
|
|
QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper();
|
|
|
- questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).in("tag_name", symptomMap.keySet()).eq("type", "2");
|
|
|
+ questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).
|
|
|
+ in("tag_name", symptomMap.keySet()).
|
|
|
+ eq("type", QuestionTypeEnum.Symptom.getKey());
|
|
|
List<QuestionInfo> questionInfoList = questionFacade.list(questionInfoQueryWrapper);
|
|
|
Map<String, QuestionInfo> questionInfoMap = EntityUtil.makeEntityMap(questionInfoList, "tagName");
|
|
|
for (Map.Entry<String, Object> entry : symptomMap.entrySet()) {
|
|
|
- entry.setValue(questionInfoMap.get(entry.getKey()).getId());
|
|
|
+ if (questionInfoMap.get(entry.getKey()) != null) {
|
|
|
+ QuestionVO questionVO = new QuestionVO();
|
|
|
+ questionVO.setAge(pushVO.getAge());
|
|
|
+ questionVO.setSexType(pushVO.getSex());
|
|
|
+ questionVO.setId(questionInfoMap.get(entry.getKey()).getId());
|
|
|
+ entry.setValue(questionFacade.getById(questionVO));
|
|
|
+ }
|
|
|
}
|
|
|
pushDTO.setSymptomMap(symptomMap);
|
|
|
}
|
|
|
-
|
|
|
- pushDTO.setDisMap(disMap);
|
|
|
- pushDTO.setPacsMap(pacsMap);
|
|
|
- pushDTO.setLabMap(labMap);
|
|
|
-
|
|
|
//查体 返回模板
|
|
|
- if (featureTypeSet.contains("4") && dis != null && dis.size() > 0) {
|
|
|
+ else if (featureTypeSet.contains(QuestionTypeEnum.Vital.getKey()) && dis != null && dis.size() > 0) {
|
|
|
String deptName = dis.get(0).getExtraProperty();
|
|
|
QueryWrapper<DeptInfo> deptInfoQueryWrapper = new QueryWrapper<>();
|
|
|
- deptInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).eq("name", deptName);
|
|
|
+ deptInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).
|
|
|
+ eq("name", deptName);
|
|
|
DeptInfo deptInfo = deptInfoFacade.getOne(deptInfoQueryWrapper);
|
|
|
if (deptInfo == null) {
|
|
|
throw new CommonException(CommonErrorCode.NOT_EXISTS, "科室信息不存在");
|
|
|
}
|
|
|
|
|
|
QueryWrapper<DeptVital> deptVitalQueryWrapper = new QueryWrapper<>();
|
|
|
- deptVitalQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).eq("dept_id", deptInfo.getId());
|
|
|
+ deptVitalQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).
|
|
|
+ eq("dept_id", deptInfo.getId());
|
|
|
List<DeptVital> deptVitalList = deptVitalFacade.list(deptVitalQueryWrapper);
|
|
|
if (deptVitalList.size() > 0) {
|
|
|
Map<Long, DeptVital> deptVitalMap = EntityUtil.makeEntityMap(deptVitalList, "vitalId");
|
|
|
//排序
|
|
|
QueryWrapper<VitalOrder> vitalOrderQueryWrapper = new QueryWrapper<>();
|
|
|
- vitalOrderQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).in("question_id", deptVitalMap.keySet()).orderByAsc("order_no");
|
|
|
+ vitalOrderQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).
|
|
|
+ in("question_id", deptVitalMap.keySet()).
|
|
|
+ orderByAsc("order_no");
|
|
|
List<VitalOrder> vitalOrderList = vitalOrderFacade.list(vitalOrderQueryWrapper);
|
|
|
- Map<Long, VitalOrder> vitalOrderMap = EntityUtil.makeEntityMap(vitalOrderList, "id");
|
|
|
+ Map<Long, VitalOrder> vitalOrderMap = EntityUtil.makeEntityMap(vitalOrderList, "question_id");
|
|
|
//标签列表
|
|
|
- QueryWrapper<QuestionInfo> vitalQueryWrapper = new QueryWrapper<>();
|
|
|
- vitalQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).in("id", deptVitalMap.keySet());
|
|
|
+ /*QueryWrapper<QuestionInfo> vitalQueryWrapper = new QueryWrapper<>();
|
|
|
+ vitalQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).
|
|
|
+ in("id", deptVitalMap.keySet());
|
|
|
List<QuestionInfo> vitalList = questionFacade.list(vitalQueryWrapper);
|
|
|
- Map<Long, QuestionInfo> vitalQuestionMap = EntityUtil.makeEntityMap(vitalList, "id");
|
|
|
+ Map<Long, QuestionInfo> vitalQuestionMap = EntityUtil.makeEntityMap(vitalList, "id");*/
|
|
|
for (Map.Entry<Long, VitalOrder> entry : vitalOrderMap.entrySet()) {
|
|
|
- QuestionInfo vitalQuestion = vitalQuestionMap.get(entry.getKey());
|
|
|
- if (vitalQuestion != null) {
|
|
|
- vitalMap.put(vitalQuestion.getTagName(), vitalQuestion);
|
|
|
+ QuestionVO questionVO = new QuestionVO();
|
|
|
+ questionVO.setAge(pushVO.getAge());
|
|
|
+ questionVO.setSexType(pushVO.getSex());
|
|
|
+ questionVO.setId(entry.getKey());
|
|
|
+ QuestionDTO questionDTO = questionFacade.getById(questionVO);
|
|
|
+ //QuestionInfo vitalQuestion = vitalQuestionMap.get(entry.getKey());
|
|
|
+ if (questionDTO != null) {
|
|
|
+ vitalMap.put(questionDTO.getTagName(), questionDTO);
|
|
|
}
|
|
|
}
|
|
|
pushDTO.setVitalMap(vitalMap);
|
|
@@ -154,6 +177,7 @@ public class PushFacade {
|
|
|
|
|
|
/**
|
|
|
* 将list 转换成 map
|
|
|
+ *
|
|
|
* @param list
|
|
|
* @return
|
|
|
*/
|
|
@@ -164,4 +188,4 @@ public class PushFacade {
|
|
|
}
|
|
|
return map;
|
|
|
}
|
|
|
-}
|
|
|
+}
|