|
@@ -20,6 +20,7 @@ import com.diagbot.enums.FeatureTypeEnum;
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
import com.diagbot.enums.LisSourceEnum;
|
|
import com.diagbot.enums.LisSourceEnum;
|
|
import com.diagbot.enums.QuestionTypeEnum;
|
|
import com.diagbot.enums.QuestionTypeEnum;
|
|
|
|
+import com.diagbot.enums.TagTypeEnum;
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
import com.diagbot.exception.CommonException;
|
|
import com.diagbot.exception.CommonException;
|
|
import com.diagbot.util.BeanUtil;
|
|
import com.diagbot.util.BeanUtil;
|
|
@@ -29,8 +30,10 @@ import com.diagbot.util.RespDTOUtil;
|
|
import com.diagbot.vo.LisResult;
|
|
import com.diagbot.vo.LisResult;
|
|
import com.diagbot.vo.PushKYJVO;
|
|
import com.diagbot.vo.PushKYJVO;
|
|
import com.diagbot.vo.PushVO;
|
|
import com.diagbot.vo.PushVO;
|
|
|
|
+import com.diagbot.vo.QuestionIds2VO;
|
|
import com.diagbot.vo.QuestionVO;
|
|
import com.diagbot.vo.QuestionVO;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
|
|
+import org.aspectj.weaver.patterns.TypePatternQuestions;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
@@ -144,14 +147,14 @@ public class PushFacade {
|
|
}
|
|
}
|
|
//化验 标签列表
|
|
//化验 标签列表
|
|
if (featureTypeSet.contains(String.valueOf(FeatureTypeEnum.Lis.getKey()))) {
|
|
if (featureTypeSet.contains(String.valueOf(FeatureTypeEnum.Lis.getKey()))) {
|
|
- List<ConceptPushDTO> labs = data.getLab();
|
|
|
|
|
|
+ List<QuestionPushDTO> labs = data.getLab();
|
|
if (ListUtil.isNotEmpty(labs)) {
|
|
if (ListUtil.isNotEmpty(labs)) {
|
|
//公表项转套餐项
|
|
//公表项转套餐项
|
|
Map<String, List<String>> lisMapping = lisMappingFacade.getLisMappingByUniqueName();
|
|
Map<String, List<String>> lisMapping = lisMappingFacade.getLisMappingByUniqueName();
|
|
List<String> nameList = Lists.newLinkedList();
|
|
List<String> nameList = Lists.newLinkedList();
|
|
Map<String, Long> lisMap = new LinkedHashMap<>();
|
|
Map<String, Long> lisMap = new LinkedHashMap<>();
|
|
- List<ConceptPushDTO> lisDTO = Lists.newLinkedList();
|
|
|
|
- for (ConceptPushDTO lab : labs) {
|
|
|
|
|
|
+ List<QuestionPushDTO> lisDTO = Lists.newLinkedList();
|
|
|
|
+ for (QuestionPushDTO lab : labs) {
|
|
if (ListUtil.isNotEmpty(lisMapping.get(lab.getName()))) {
|
|
if (ListUtil.isNotEmpty(lisMapping.get(lab.getName()))) {
|
|
//匹配出多个套餐项默认取第一个
|
|
//匹配出多个套餐项默认取第一个
|
|
String name = lisMapping.get(lab.getName()).get(0);
|
|
String name = lisMapping.get(lab.getName()).get(0);
|
|
@@ -170,18 +173,16 @@ public class PushFacade {
|
|
lisMap = respDTO.data;
|
|
lisMap = respDTO.data;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ Map<String, QuestionDTO> questionDTOMap = addLisQuestion(nameList, pushVO.getAge(), pushVO.getSex());
|
|
for (String name : nameList) {
|
|
for (String name : nameList) {
|
|
- ConceptPushDTO conceptPushDTO = new ConceptPushDTO();
|
|
|
|
- conceptPushDTO.setName(name);
|
|
|
|
- conceptPushDTO.setType(ConceptTypeEnum.Lis.getKey());
|
|
|
|
- conceptPushDTO.setLibType(12);
|
|
|
|
|
|
+ QuestionPushDTO questionPushDTO = new QuestionPushDTO();
|
|
|
|
+ QuestionDTO questionDTO = questionDTOMap.get(name);
|
|
|
|
+ BeanUtil.copyProperties(questionDTO, questionPushDTO);
|
|
|
|
+ questionPushDTO.setLibType(12);
|
|
if (lisMap.containsKey(name) && lisMap.get(name) != null) {
|
|
if (lisMap.containsKey(name) && lisMap.get(name) != null) {
|
|
- conceptPushDTO.setConceptId(lisMap.get(name));
|
|
|
|
|
|
+ questionPushDTO.setConceptId(lisMap.get(name));
|
|
}
|
|
}
|
|
- lisDTO.add(conceptPushDTO);
|
|
|
|
- }
|
|
|
|
- if (ListUtil.isNotEmpty(lisDTO)) {
|
|
|
|
- lisDTO = addQuestionId(lisDTO, ConceptTypeEnum.Lis.getKey());
|
|
|
|
|
|
+ lisDTO.add(questionPushDTO);
|
|
}
|
|
}
|
|
pushDTO.setLab(lisDTO);
|
|
pushDTO.setLab(lisDTO);
|
|
}
|
|
}
|
|
@@ -307,7 +308,7 @@ public class PushFacade {
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 概念关联标签,添加标签id ——症状,化验
|
|
|
|
|
|
+ * 概念关联标签,添加标签id ——症状
|
|
*
|
|
*
|
|
* @param concepts
|
|
* @param concepts
|
|
* @param type
|
|
* @param type
|
|
@@ -334,4 +335,35 @@ public class PushFacade {
|
|
}
|
|
}
|
|
return concepts;
|
|
return concepts;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取化验填写单
|
|
|
|
+ *
|
|
|
|
+ * @param nameList
|
|
|
|
+ * @param age
|
|
|
|
+ * @param sex
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public Map<String, QuestionDTO> addLisQuestion(List<String> nameList, Integer age, Integer sex) {
|
|
|
|
+ Map<String, QuestionDTO> mapDTO = new LinkedHashMap<>();
|
|
|
|
+ QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).
|
|
|
|
+ in("name", nameList).
|
|
|
|
+ eq("tag_type", TagTypeEnum.T7.getKey());
|
|
|
|
+ List<QuestionInfo> lisList = questionFacade.list(questionInfoQueryWrapper);
|
|
|
|
+ if (ListUtil.isNotEmpty(lisList)) {
|
|
|
|
+ List<Long> lisIds = lisList.stream().map(lis -> lis.getId()).collect(Collectors.toList());
|
|
|
|
+ QuestionIds2VO questionIds2VO = new QuestionIds2VO();
|
|
|
|
+ questionIds2VO.setAge(age);
|
|
|
|
+ questionIds2VO.setSexType(sex);
|
|
|
|
+ questionIds2VO.setIds(lisIds);
|
|
|
|
+ Map<Long, Object> questionDTOMap = questionFacade.getByIds(questionIds2VO);
|
|
|
|
+ for (Map.Entry<Long, Object> entry : questionDTOMap.entrySet()) {
|
|
|
|
+ QuestionDTO questionDTO = new QuestionDTO();
|
|
|
|
+ BeanUtil.copyProperties(entry.getValue(), questionDTO);
|
|
|
|
+ mapDTO.put(questionDTO.getName(), questionDTO);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return mapDTO;
|
|
|
|
+ }
|
|
}
|
|
}
|