|
@@ -1,8 +1,10 @@
|
|
|
package com.diagbot.facade;
|
|
|
|
|
|
+import com.diagbot.dto.DictionaryInfoDTO;
|
|
|
import com.diagbot.entity.node.Indication;
|
|
|
import com.diagbot.entity.node.IndicationCondition;
|
|
|
import com.diagbot.repository.IndicationRepository;
|
|
|
+import com.diagbot.util.EntityUtil;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
import com.diagbot.vo.ConditionIndexVO;
|
|
|
import com.diagbot.vo.IndicationPageVO;
|
|
@@ -14,6 +16,7 @@ import org.springframework.data.domain.Pageable;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -25,6 +28,8 @@ import java.util.stream.Collectors;
|
|
|
public class IndicationManFacade {
|
|
|
@Autowired
|
|
|
IndicationRepository indicationRepository;
|
|
|
+ @Autowired
|
|
|
+ DictionaryFacade dictionaryFacade;
|
|
|
|
|
|
/**
|
|
|
* 获取开单合理项列表
|
|
@@ -33,6 +38,22 @@ public class IndicationManFacade {
|
|
|
* @return
|
|
|
*/
|
|
|
public Page<Indication> getPage(IndicationPageVO indicationPageVO) {
|
|
|
+ List<DictionaryInfoDTO> dicTypeConvert = dictionaryFacade.getListByGroupType(8);
|
|
|
+ List<DictionaryInfoDTO> dicIndicationManType = dictionaryFacade.getListByGroupType(11);
|
|
|
+ Map<String, String> dicTypeConvertMap
|
|
|
+ = EntityUtil.makeMapWithKeyValue(dicTypeConvert, "name", "val");
|
|
|
+ Map<String, String> dicIndicationManTypeMap
|
|
|
+ = EntityUtil.makeMapWithKeyValue(dicIndicationManType, "val", "name");
|
|
|
+ List<String> labels = Lists.newArrayList();
|
|
|
+ if (ListUtil.isNotEmpty(indicationPageVO.getTypes())) {
|
|
|
+ for (Integer type : indicationPageVO.getTypes()) {
|
|
|
+ if (dicIndicationManTypeMap.containsKey(type.toString())
|
|
|
+ && dicTypeConvertMap.containsKey(dicIndicationManTypeMap.containsKey(type.toString()))) {
|
|
|
+ labels.add(dicTypeConvertMap.get(dicIndicationManTypeMap.get(type.toString())));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
Pageable pageable = PageRequest.of(indicationPageVO.getNumber(), indicationPageVO.getSize());
|
|
|
Page<Indication> page = indicationRepository.getPage(indicationPageVO.getLabels(),
|
|
|
indicationPageVO.getConceptName(),
|
|
@@ -49,6 +70,19 @@ public class IndicationManFacade {
|
|
|
* @return
|
|
|
*/
|
|
|
public List<IndicationCondition> conditionIndex(ConditionIndexVO conditionIndexVO) {
|
|
|
+ //TODO 输血单独处理
|
|
|
+
|
|
|
+
|
|
|
+ List<DictionaryInfoDTO> dicTypeConvert = dictionaryFacade.getListByGroupType(8);
|
|
|
+ List<DictionaryInfoDTO> dicIndicationManType = dictionaryFacade.getListByGroupType(11);
|
|
|
+ Map<String, String> dicTypeConvertMap
|
|
|
+ = EntityUtil.makeMapWithKeyValue(dicTypeConvert, "name", "val");
|
|
|
+ Map<String, String> dicIndicationManTypeMap
|
|
|
+ = EntityUtil.makeMapWithKeyValue(dicIndicationManType, "val", "name");
|
|
|
+ if (dicIndicationManTypeMap.containsKey(conditionIndexVO.getType().toString())
|
|
|
+ && dicTypeConvertMap.containsKey(dicIndicationManTypeMap.containsKey(conditionIndexVO.getType().toString()))) {
|
|
|
+ conditionIndexVO.setConceptLabel(dicTypeConvertMap.get(dicIndicationManTypeMap.get(conditionIndexVO.getType().toString())));
|
|
|
+ }
|
|
|
List<String> relationTypes = indicationRepository.getRelationTypes(conditionIndexVO.getConceptLabel());
|
|
|
List<String> conditionLabels = Lists.newArrayList();
|
|
|
//条件明细筛选范围
|